| boiwsa | R Documentation |
Performs seasonal adjustment and forecasting of weekly time series using a regression-based decomposition framework estimated by discounted least squares. Seasonality is modeled using trigonometric regressors, while holiday, trading-day, and calendar effects are incorporated through additional covariates. Additive outliers can be detected automatically using an optional outlier search procedure. The function supports both additive and multiplicative decompositions and produces seasonally adjusted series together with the associated model components. Worked examples and additional usage illustrations are available in the package repository on GitHub. See Ginker (2024), boiwsa: An R Package for Seasonal Adjustment of Weekly Data, The R Journal, 16(3), 186–197.
boiwsa(
x,
dates,
r = 0.8,
auto.ao.search = TRUE,
out.threshold = 3.8,
ao.list = NULL,
my.k_l = NULL,
H = NULL,
ic = "aicc",
method = "additive"
)
x |
Numeric vector containing the observed weekly time series. |
dates |
A vector of class |
r |
Numeric scalar in (0, 1] defining the rate of decay of the observation weights. Defaults to |
auto.ao.search |
Logical. If |
out.threshold |
Numeric. t-statistic threshold used in the additive outlier search. Defaults to |
ao.list |
Optional vector of class |
my.k_l |
Optional numeric vector of length two specifying the number of yearly and monthly trigonometric variables. If |
H |
Optional matrix of holiday and trading-day regressors with the same number of rows as |
ic |
Character string specifying the information criterion used in the automatic selection of trigonometric regressors. One of |
method |
Character string specifying the decomposition type. Either |
The methodological framework implemented in this function is described in Ginker (2024), boiwsa: An R Package for Seasonal Adjustment of Weekly Data, The R Journal, 16(3), 186–197.
A list with the following components:
Seasonally adjusted series.
Number of trigonometric regressors used to model seasonality.
Estimated seasonal component.
Estimated holiday and trading-day effects.
Estimated additive outlier effects.
Regression coefficients estimated for the last year of data.
Unweighted lm object estimated on the full sample.
Tim Ginker
# Not run
# Seasonal adjustment of weekly US gasoline production
data("gasoline.data")
res=boiwsa(x=gasoline.data$y,dates=gasoline.data$date)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.