Estimates and forecasts weekly time series with monthly and annual seasonal patterns
WEEKforecast(
y,
u = NULL,
initial_date,
h = 24,
lambda = 1,
criterion = "aic",
p0 = -9999.9,
verbose = FALSE
)An object of class UComp. It is a list containing the model specification,
estimated parameters, and forecasting results.
A numeric vector, ts object or list containing weekly observations of the
dependent variable.
Optional matrix or vector of exogenous regressors. If provided, it must cover both the estimation and forecast periods.
A character or Date object indicating the calendar start date
of the series.
Integer indicating the forecast horizon (number of weeks ahead).
Box–Cox transformation parameter.
Information criterion used for model selection (AIC, BIC or AICc).
Initial parameter vector for Maximum Likelihood estimation.
if TRUE, prints estimation details.
Diego J. Pedregal
WEEKforecast estimates and forecasts univariate weekly time series using
Dynamic Harmonic Regression (DHR).
The function is designed for weekly data but builds the seasonal structure from underlying daily calendar information. In particular, it incorporates:
Monthly seasonality via harmonic terms derived from calendar months
Annual seasonality via multiple harmonic components based on calendar years
Standard methods applicable to UComp objects are available.
UC, UCforecast, UCfilter,
UCsmooth, UCdisturb,
UCcomponents
# \donttest{
y <- rnorm(400)
m <- WEEKforecast(y, initial_date = "2015-01-01", h = 12)
# }
Run the code above in your browser using DataLab