| genhol | R Documentation |
Generates moving-holiday regressors for weekly data based on supplied holiday occurrence dates using the Easter formula described in Table 2 of Findley et al. (1998). The function can be used to construct regressors for U.S. holidays such as Easter, Labor Day, and Thanksgiving, as well as for Israeli holidays such as Rosh Hashanah and Pesach. The resulting weekly holiday regressors are calendar-centered to avoid bias.
genhol(dates, holiday.dates, start = 7, end = 7)
dates |
A vector of class |
holiday.dates |
A vector of class |
start |
Integer. Number of days before each holiday date to include in the moving-holiday window. Negative values may be used to shift the start of the window to dates after the holiday. |
end |
Integer. Number of days after each holiday date to include in the moving-holiday window. Negative values may be used to shift the end of the window to dates before the holiday. |
A data frame with two columns:
Weekly dates corresponding to dates.
Calendar-centered moving-holiday regressor at weekly frequency.
The returned object can be merged into a matrix of holiday or trading-day
regressors supplied to boiwsa() via the H argument.
Findley, D.F., Monsell, B.C., Bell, W.R., Otto, M.C. and B.C Chen (1998). New capabilities and methods of the X-12-ARIMA seasonal-adjustment program. Journal of Business & Economic Statistics, 16(2), pp.127-152.
# Moving-holiday regressor for Israeli Rosh Hashanah
data(gasoline.data)
data(holiday_dates_il) # dates of Israeli Rosh Hashanah and Pesach
movehol=genhol(gasoline.data$date,holiday.dates = holiday_dates_il$rosh)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.