Learn R Programming

tfarima (version 0.1.1)

calendar: Calendar effects

Description

calendar extends the ARIMA model um by estimating a transfer function model with seven deterministic variables to capture the calendar variation in a monthly time series. Two equivalent representations are available: (1) D1, D2, ..., D7, (2) L, D1-D7, ..., D6-D7 where D1, D2, ..., D7 are deterministic variables representing the number of Mondays, Tuesdays, ..., Sundays, L = D1 + D2 + ... + D7 is the of the month. Optionally, a deterministic variable to estimate the Easter effect can also be included.

Usage

calendar(um, ...)

# S3 method for um calendar( um, z = NULL, form = c("dif", "td"), easter = FALSE, n.ahead = 0, p.value = 1, ... )

Arguments

um

an object of class um.

...

additional arguments.

z

a time series.

form

representation for calendar effects: form = td form (1) above, form = dif form (1).

easter

logical. If TRUE an Easter effect is also estimated.

n.ahead

a positive integer to extend the sample period of the deterministic variables with n.ahead observations, which could be necessary to forecast the output.

p.value

estimates with a p-value greater than p.value are omitted.

Value

An object of class "tfm".

References

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

Examples

Run this code
# 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