Statistical Methods
Integrate a sampled trajectory on an irregular time grid
Define the task
Write down the quantity being integrated and the units of both axes. An area under a concentration curve has concentration-times-time units, while an area under a survival curve has time units. Decide whether straight segments are a reasonable representation between observations. A step curve may require a different rule.
Carry out the check
For each neighboring pair, average the two measured heights and multiply by the elapsed time. Add the segment areas. Retain the actual coordinates because unequal intervals carry unequal widths. Check that times increase, resolve duplicate times, and document gaps or interventions before bridging them. SciPy's trapezoid function follows the supplied coordinate order rather than sorting it.
Worked hypothetical example
For hypothetical heights 2, 4 and 2 at times 0, 1 and 3, the segment areas are 3 and 6, giving total area 9. Averaging the heights and multiplying by the total span would give 8 and answer a different approximation. Sparse observations can miss short peaks. Report the interpolation rule, observed span and missing intervals alongside the numeric area.
Method checked 14 November 2026 against SciPy documentation: trapezoid.