SAZED#

class pyriodicity.SAZED#

Spectral Autocorrelation Zero Ensemble Detector (SAZED).

Find the periods in a given signal or series using SAZED ensemble method [1].

Notes

While the original paper uses the Sheather-Jones bandwidth selector, this implementation uses the Improved Sheather-Jones (ISJ) selector [2].

References

[1]

Toller, M., Santos, T., & Kern, R. (2019). SAZED: parameter-free domain-agnostic season length estimation in time series data. Data Mining and Knowledge Discovery, 33(6), 1775-1798. https://doi.org/10.1007/s10618-019-00645-z

[2]

Botev, Z. I., Grotowski, J. F., & Kroese, D. P. (2010). Kernel density estimation via diffusion. The Annals of Statistics, 38(5), 2916-2957. https://doi.org/10.1214/10-AOS799

Examples

Start by loading Mauna Loa Weekly Atmospheric CO2 Data from statsmodels and downsampling its data to a monthly frequency.

>>> from statsmodels.datasets import co2
>>> data = co2.load().data
>>> data = data.resample("ME").mean().ffill()

Use SAZED to find periods using the ensemble method.

>>> from pyriodicity import SAZED
>>> SAZED.detect(data)
np.int64(12)

You can also use the majority voting method:

>>> SAZED.detect(data, method="majority")
np.int64(12)

Methods

detect(data[, window_func, detrend_func, method])

Detect a period in the input data using the SAZED ensemble method.