Learn R Programming

tspredit (version 1.2.747)

ts_fil_fft: FFT Filter

Description

Frequency-domain smoothing using the Fast Fourier Transform (FFT) to attenuate high-frequency components.

Usage

ts_fil_fft()

Arguments

Value

A ts_fil_fft object.

Details

The implementation estimates a cutoff based on spectral statistics and reconstructs the series from dominant frequencies.

References

  • J. W. Cooley and J. W. Tukey (1965). An algorithm for the machine calculation of complex Fourier series. Math. Comput.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab