pyhctsa.operations.stationarity.peak_intervals

pyhctsa.operations.stationarity.peak_intervals(y, min_prom=1)

Statistics on the prominences of, and intervals between, the peaks of a time series.

The series is z-scored (so that prominence is in units of its standard deviation) and its peaks (local maxima; a flat-topped peak counts once, at the middle of its plateau) with prominence of at least min_prom are found with scipy.signal.find_peaks. Summaries are then taken of the peaks’ prominences and of the inter-peak intervals (in samples): a periodic series has regularly spaced, equally prominent peaks (low cvInt), while a noisy or aperiodic one does not.

Parameters:
y : array-like

The input time series.

min_prom : float, optional

The minimum prominence of a peak to count it, in standard deviations of the series (a peak’s prominence is its height above the higher of the two lowest points between it and the nearest higher peak on each side). Default is 1.

Returns:

  • ‘meanProm’: the mean prominence of the peaks (NaN if there are none),

  • ’cvInt’: the coefficient of variation (std / mean) of the inter-peak intervals (NaN unless there are at least 3 intervals),

  • ’acInt1’: the lag-1 autocorrelation (Pearson correlation of successive intervals) of the inter-peak intervals (NaN unless there are at least 5 intervals; 0 if the intervals are all equal).

All NaN for a time series shorter than 20 samples, containing non-finite values, or constant.

Return type:

dict