calendar
extends the ARIMA model um
by including a set of
deterministic variables to capture the calendar variation in a monthly time
series. Two equivalent representations are available: (i) D0, D1, ..., D6,
(ii) L, D1-D0, ..., D6-D0 where D0, D2, ..., D6 are deterministic variables
representing the number of Sundays, Mondays, ..., Saturdays, L = D0 + D1 + ...
+ D6 is the of the month. Alternatively, the Leap Year indicator (LPY) can be
included instead of L. The seven trading days can also be compacted into two
variables: week days and weekends. Optionally, a deterministic variable to
estimate the Easter effect can also be included, see "easter
".
# S3 method for tfm
calendar(
mdl,
y = NULL,
form = c("dif", "td", "td7", "td6", "wd"),
ref = 0,
lom = TRUE,
lpyear = TRUE,
easter = FALSE,
len = 4,
easter.mon = FALSE,
n.ahead = 0,
p.value = 1,
envir = NULL,
...
)calendar(mdl, ...)
# S3 method for um
calendar(
mdl,
y = NULL,
form = c("dif", "td", "td7", "td6", "wd"),
ref = 0,
lom = TRUE,
lpyear = TRUE,
easter = FALSE,
len = 4,
easter.mon = FALSE,
n.ahead = 0,
p.value = 1,
envir = NULL,
...
)
a time series.
representation for calendar effects: (1) form = dif
, L,
D1-D0, ..., D6-D0; (2) form = td
, LPY, D1-D0, ..., D6-D0; (3)
form = td7
, D0, D2, ..., D6; (4) form = td6
, D1, D2, ..., D6;
(5) form = wd
, (D1+...+D5) - 2(D6+D0)/5.
a integer indicating the the reference day. By default, ref = 0.
a logical value indicating whether or not to include the lom/lead year indicator.
logical. If TRUE
an Easter effect is also estimated.
the length of the Easter, integer.
logical. TRUE indicates that Easter Monday is a public holiday.
a positive integer to extend the sample period of the
deterministic variables with n.ahead
observations, which could be
necessary to forecast the output.
estimates with a p-value greater than p.value are omitted.
environment in which the function arguments are evaluated. If NULL the calling environment of this function will be used.
other arguments.
An object of class "tfm
".
W. R. Bell & S. C. Hillmer (1983) Modeling Time Series with Calendar Variation, Journal of the American Statistical Association, 78:383, 526-534, DOI: 10.1080/01621459.1983.10478005
# NOT RUN {
Y <- tfarima::rsales
um1 <- um(Y, i = list(1, c(1, 12)), ma = list(1, c(1, 12)), bc = TRUE)
tfm1 <- calendar(um1)
# }
Run the code above in your browser using DataLab