Learn R Programming

boiwsa (version 1.1.4)

genhol: Generate a moving-holiday regressor for weekly data

Description

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.

Usage

genhol(dates, holiday.dates, start = 7, end = 7)

Value

A data frame with two columns:

date

Weekly dates corresponding to dates.

moving_holiday

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.

Arguments

dates

A vector of class "Date" corresponding to the weekly observation dates.

holiday.dates

A vector of class "Date" giving the holiday occurrence dates (e.g., Easter, Labor Day, Thanksgiving, Rosh Hashanah, Pesach). Dates outside the range of dates are ignored.

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.

References

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.

Examples

Run this code

# 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)


Run the code above in your browser using DataLab