Learn R Programming

tfarima (version 0.1.1)

CalendarVar: Calendar variables

Description

CalendarVar creates a set of deterministic variables to capture calendar effects.

Usage

CalendarVar(x, form = c("dif", "lom", "td"), easter = FALSE, n.ahead = 0)

Arguments

x

an object of class ts used to determine the sample period and frequency.

form

a character indicated the set of calendar variables.

easter

logical. If TRUE an additional deterministic variable is generated to capture Easter effects.

n.ahead

number of additional observations to extend the sample period.

Value

A matrix of explanatory variables.

References

Bell, W.R. and Hillmer, S.C. (1983) <U+201C>Modeling time series with calendar variation<U+201D>, Journal of the American Statistical Society, Vol. 78, pp. 526<U+2013>534.

Examples

Run this code
# NOT RUN {
Y <- rsales
X <- CalendarVar(Y, easter = TRUE)

# }

Run the code above in your browser using DataLab