Learn R Programming

boiwsa (version 1.1.4)

plot_spec: Compare AR spectra of original and seasonally adjusted series

Description

Computes and plots autoregressive (AR) spectral density estimates for the detrended original series and its seasonally adjusted counterpart. Spectra are estimated using spec.ar with AR order set to 60. The plot highlights frequencies corresponding to intramonthly and intrayearly cycles.

Usage

plot_spec(x)

Value

A ggplot2 object showing the AR spectral density estimates for the detrended original and seasonally adjusted series.

Arguments

x

A boiwsa() result object. Must contain components x, sa, and trend.

Examples

Run this code
# \donttest{
# Not run
# Seasonal adjustment of weekly US gasoline production
res <- boiwsa(x=gasoline.data$y,dates=gasoline.data$date)
plot_spec(res)# }

Run the code above in your browser using DataLab