| ts_fil_fft | R Documentation |
Frequency-domain smoothing using the Fast Fourier Transform (FFT) to attenuate high-frequency components.
ts_fil_fft()
The implementation estimates a cutoff based on spectral statistics and reconstructs the series from dominant frequencies.
A ts_fil_fft object.
J. W. Cooley and J. W. Tukey (1965). An algorithm for the machine calculation of complex Fourier series. Math. Comput.
# Frequency-domain smoothing via FFT cutoff
# Load package and example data
library(daltoolbox)
data(tsd)
tsd$y[9] <- 2 * tsd$y[9] # inject an outlier
# Fit FFT-based filter and reconstruct without high frequencies
filter <- ts_fil_fft()
filter <- fit(filter, tsd$y)
y <- transform(filter, tsd$y)
# Compare original vs frequency-smoothed series
plot_ts_pred(y = tsd$y, yadj = y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.