Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ariaghora/robust-period
Unofficial Implementation of RobustPeriod: Time-Frequency Mining for Robust Multiple Periodicities Detection
https://github.com/ariaghora/robust-period
Last synced: 15 days ago
JSON representation
Unofficial Implementation of RobustPeriod: Time-Frequency Mining for Robust Multiple Periodicities Detection
- Host: GitHub
- URL: https://github.com/ariaghora/robust-period
- Owner: ariaghora
- Created: 2021-04-29T16:59:57.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-26T13:53:06.000Z (over 1 year ago)
- Last Synced: 2024-08-01T16:35:03.687Z (3 months ago)
- Language: Python
- Size: 1.08 MB
- Stars: 91
- Watchers: 2
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Unofficial Implementation of RobustPeriod: Time-Frequency Mining for Robust Multiple Periodicities Detection.
> Please note that I could not fully replicate the paper, especially the optimization part.
In fact, I used a different optimization method rather than the said ADMM (the timing result will be greatly different from ones presented in the paper).
It is either the details in paper are insufficient or my understanding was lacking. I welcome any contribution.## Installation
`pip install --upgrade git+https://github.com/ariaghora/robust-period.git`## Usage example
```python
import numpy as np
import matplotlib.pyplot as plt
from robustperiod import robust_period, robust_period_full, plot_robust_period
from robustperiod.utils import sinewave, triangle
from statsmodels.datasets.co2.data import load_pandasm = 1000
y1 = sinewave(m, 20, 1)
y2 = sinewave(m, 50, 1)
y3 = sinewave(m, 100, 1)
tri = triangle(m, 10)
noise = np.random.normal(0, 0.1, m)
y = y1+y2+y3+tri+noise
y[m // 2] += 10 # sudden spikeplt.plot(y)
plt.title('Dummy dataset')
plt.show()lmb = 1e+6
c = 2
num_wavelets = 8
zeta = 1.345periods, W, bivar, periodograms, p_vals, ACF = robust_period_full(
y, 'db10', num_wavelets, lmb, c, zeta)
plot_robust_period(periods, W, bivar, periodograms, p_vals, ACF)
```## Input
## Output
Please note that I hacked some parts of result presentation code so the results match the paper as close as possible.