plot_spec: Compare AR spectra of original and seasonally adjusted series

View source: R/plot_spec.R

plot_specR Documentation

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)

Arguments

x

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

Value

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

Examples


# Not run
# Seasonal adjustment of weekly US gasoline production
res <- boiwsa(x=gasoline.data$y,dates=gasoline.data$date)
plot_spec(res)


boiwsa documentation built on Dec. 14, 2025, 5:06 p.m.