periodicity-detection¶
Overview¶
tbd
import numpy as np
import periodicity_detection as pyd
# Create sample data
data = np.sin(np.linspace(0, 40 * np.pi, 1000)) + np.random.default_rng(42).random(1000)
# Calculate period size using a specific method
period_size = pyd.findfrequency(data, detrend=True)
assert period_size == 50
# Calculate period size using the default method
period_size = pyd.estimate_periodicity(data)
assert period_size == 50
Supported period estimation algorithms¶
autocorrelation()
reference: https://stackoverflow.com/a/59267175.autoperiod()
, reference: https://epubs.siam.org/doi/epdf/10.1137/1.9781611972757.40.fft()
, Fast Fourier Transform (FFT)-based method, reference: https://stackoverflow.com/a/59267175.find_length()
from the TSB-UAD repository.findfrequency()
, Python-adaption of the R packageforecast
’sfindfrequency
-functionnumber_peaks()
, Number of Peaks-method from tsfresh, source:number_peaks()
.
Installation¶
Prerequisites:
python >= 3.7, <= 3.11
pip >= 20
periodicity-detection is published to PyPI and you can install it using pip:
pip install periodicity-detection
License¶
The project is licensed under the MIT license. See the LICENSE file for more details.
Copyright (c) 2022-2023 Sebastian Schmidl
User Guide¶
Check out our User Guides to get started with the periodicity-detection package. The user guides explain the API and the CLI.
API Reference¶
The API reference guide contains a detailed description of the functions, modules, and objects included in this package. The API reference describes how the methods work and which parameters can be used.