Learn R Programming

UComp (version 5.3.1)

DAYforecast: DAYforecast

Description

Estimates and forecasts daily time series with weekly and monthly seasonal patterns

Usage

DAYforecast(
  y,
  u = NULL,
  initial_date,
  h = 24,
  lambda = 1,
  criterion = "aic",
  p0 = -9999.9,
  verbose = FALSE
)

Value

An object of class UComp. It is a list containing the model specification, estimated parameters, and forecasting results.

Arguments

y

A numeric vector, ts object or list containing daily observations of the dependent variable.

u

Optional matrix or vector of exogenous regressors. If provided, it must cover both the estimation and forecast periods.

initial_date

A character or Date object indicating the calendar start date of the series.

h

Integer indicating the forecast horizon (number of days ahead).

lambda

Box–Cox transformation parameter (NULL for automatic identification).

criterion

Information criterion used for model selection (AIC, BIC, AICc).

p0

Initial parameter vector for Maximum Likelihood estimation.

verbose

if TRUE, prints estimation details.

Author

Diego J. Pedregal

Details

DAYforecast estimates and forecasts daily univariate time series using Dynamic Harmonic Regression (DHR).

The function is tailored for daily data and explicitly accounts for:

  • Monthly seasonality through sinusoidal terms based on calendar months

  • Weekly seasonality through sinusoidal terms with periods of 7 days

Standard methods applicable to UComp objects are available.

See Also

UC, UCforecast, UCfilter, UCsmooth, UCdisturb, UCcomponents

Examples

Run this code
# \donttest{
y <- rnorm(400)
m <- DAYforecast(y, initial_date = "2015-01-01", h = 30)
# }

Run the code above in your browser using DataLab