Periodicity detection: method notes & corrections #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context: time series in R, ~100–1000 points, has trend / non-stationary, goal is to discover an unknown period. Currently using
forecast::findfrequency()+ Fisher g test. Daniele suggested computing the FFT of the ACF instead.TL;DR
Why FFT-of-ACF is redundant and inferior
The real blocker: trend breaks both the g test and peak-picking
Recommended workflow (discovery, trended, 100–1000 pts)
diff()— kills linear/stochastic trend but is a high-pass filter, so peak amplitudes shift (fine for locating which frequency, worse for amplitude).findfrequencydoes internally).spec.pgram(x, spans=...)— Daniell-smoothed periodogram (trades frequency resolution for stability).spec.ar(x)— AR-model spectrum, sharp peaks, good at locating a cycle, but can invent peaks if AR order (AIC-chosen) is off. This isfindfrequency's engine.GeneCycle/ptest). Note: g test assumes a single embedded sinusoid; with multiple harmonics it loses power.Most robust single pipeline:
loess-detrend →
spec.pgram(moderate smoothing) to find candidate freq → Fisher g test on residuals to confirm.Gotcha: interpreting
findfrequency()1means "no peak passed my hardcoded threshold" — NOT evidence of no periodicity. Don't read1as a negative result.Confidence
Open question