CFDAutoperiod#
- class pyriodicity.CFDAutoperiod#
CFD-Autoperiod periodicity detector.
Find the periods in a given signal or series using CFD-Autoperiod [1].
See also
pyriodicity.AutoperiodAutoperiod periodicity detector.
References
[1]Puech, T., Boussard, M., D’Amato, A., & Millerand, G. (2020). A fully automated periodicity detection in time series. In Advanced Analytics and Learning on Temporal Data: 4th ECML PKDD Workshop, AALTD 2019, Würzburg, Germany, September 20, 2019, Revised Selected Papers 4 (pp. 43-54). Springer International Publishing. https://doi.org/10.1007/978-3-030-39098-3_4
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
CFDAutoperiodto find the list of periods in the data.>>> from pyriodicity import CFDAutoperiod >>> CFDAutoperiod.detect(data) array([12])
You can specify a lower percentile value should you wish for a more lenient detection
>>> CFDAutoperiod.detect(data, percentile=90) array([12])
You can also increase the number of random data permutations for a more robust power threshold estimation
>>> CFDAutoperiod.detect(data, k=300) array([12])
CFDAutoperiodis considered a more robust variant ofAutoperiodagainst noise. The detection algorithm found exactly one periodicity length of 12, suggesting a strong yearly periodicity.Methods
detect(data[, k, percentile, detrend_func, ...])Find periods in the given series.