freqr: Frequency response calculation for STL decomposition

Description Usage Arguments Value Note Author(s) References See Also Examples

Description

Calculates the frequency response function for the seasonal, trend, and high-pass filters of an STL decomposition at a specified grid of fourier frequencies for the symmetric smoothing case. This can be used to visualize the power transfer function or phase shift function to evaluate the spectral properties of an STL model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Default S3 method:
freqr(n.p, s.window, s.degree = 0, 
   t.window = NULL, t.degree = 1, l.window = nextodd(n.p), 
   l.degree = t.degree, periodic = FALSE, M = 400)
## S3 method for class 'stl'
freqr(x, ...)
## S3 method for class 'stl2'
freqr(x, ...)
## S3 method for class 'stlop'
freqr(x, ...)

Arguments

n.p, s.window, s.degree, t.window, t.degree, l.window, l.degree, periodic

STL parameters (see stlOp).

x

object of class "stl", "stl2", or "stlop". Parameters from these objects are passed on to freqr.default.

M

density of the grid of fourier frequencies, which range from 0 to 0.5.

...

Value

A data frame of class "freqr" consisting of frequencies fk and frequency response values frfv.

Note

To investigate the spectral properties of an STL model at an asymmetric smoothing location, one can use the freqrlo function with a "stlop" object to obtain the frequency response function at any smoothing point.

Author(s)

Ryan Hafen

References

R. B. Cleveland, W. S. Cleveland, J. E. McRae, and I. Terpenning (1990) STL: A Seasonal-Trend Decomposition Procedure Based on Loess. Journal of Official Statistics, 6, 3-73.

R. Shumway and D. Stoffer. Time series analysis and its applications. Springer Verlag, 2000.

See Also

stlOp, freqrlo, plot.freqr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
co2.stl <- stl2(co2, t=as.vector(time(co2)), n.p=12, 
   s.window=35, s.degree=1, t.degree=1, 
   s.blend=0.5, t.blend=0.5)

co2op <- stlOp(co2.stl)

# symmetric filter
co2fr <- freqr(co2op, M=1000)
# seasonal, trend, and overall filter at endpoint
co2fr1 <- freqrlo(co2op$fit, at=1, M=800)
co2fr1.s <- freqrlo(co2op$seas, at=1)
co2fr1.t <- freqrlo(co2op$trend, at=1)
# overall filter at 10 points from end and middle
co2fr10 <- freqrlo(co2op$fit, at=10, M=800)
co2frm <- freqrlo(co2op$fit, at=234, M=800)

plot(co2fr, aspect=0.25)
plot(co2fr1, aspect=0.25)
plot(co2fr1.s, aspect=0.25)
plot(co2fr1.t, aspect=0.25)
plot(co2frm, aspect=0.25)

hafen/operator documentation built on May 17, 2019, 2:23 p.m.