genhol: Generate a moving-holiday regressor for weekly data

View source: R/genhol.R

genholR Documentation

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)

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.

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.

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


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



boiwsa documentation built on Dec. 14, 2025, 5:06 p.m.