gastropy.cycle_stats

Contents

gastropy.cycle_stats#

gastropy.cycle_stats(durations)[source]#

Compute summary statistics for cycle durations.

Parameters:

durations (array_like) – Array of cycle durations in seconds.

Returns:

Dictionary with keys:

  • n_cycles : Number of cycles.

  • mean_cycle_dur_s : Mean duration (seconds).

  • sd_cycle_dur_s : Standard deviation (seconds, Bessel-corrected).

  • prop_within_3sd : Proportion of cycles within 3 SD of the mean.

  • lower_3sd_s : Lower 3-sigma bound (seconds).

  • upper_3sd_s : Upper 3-sigma bound (seconds).

Return type:

dict

Examples

>>> from gastropy.metrics import cycle_stats
>>> stats = cycle_stats([20.1, 19.8, 20.3, 19.9, 20.0])
>>> stats["mean_cycle_dur_s"]
20.02