Statistical Methods
Specify local-peak and plateau rules before counting events
Define the task
A local maximum is a geometric feature of a sequence, not automatically a meaningful event. Define the sampling interval, expected event duration and noise handling before counting peaks. Decide whether endpoints should be eligible and whether a flat-topped maximum should count once. Preserve a record of any smoothing because it can merge peaks or move their locations.
Carry out the check
A simple interior peak has lower immediate neighbors. For a flat peak, identify the consecutive equal values and check that both outside neighbors are lower. SciPy reports the middle sample, rounding down for an even plateau length. Its additional height, distance, prominence and width criteria answer different questions. The accompanying calculator implements only the basic local-maximum and plateau rule, with zero-based indices and no filtering.
Worked hypothetical example
For the hypothetical sequence 0, 2, 2, 0, 1, 0, the plateau occupies indices 1 and 2, so the reported index is 1. The second peak is at index 4. A sequence that is only increasing has no interior local maximum under this rule, even though its last value is largest. Report the rule, indexing convention and filtering parameters. Missing values must be handled explicitly, and a noisy peak count should not be interpreted as a clinical event rate.
Method checked 15 November 2026 against SciPy documentation: find_peaks.