Helper to create generic calendar regressors without relying on any country-specific datasets shipped with the package. This is deliberate: production holiday calendars should usually come from an authoritative institutional source, not from a generic package dataset.
Usage
build_user_xreg(
y,
td_candidates = NULL,
holidays = NULL,
frequency = NULL,
td_usertype = "holiday",
default_center = c("calendar", "mean", "none")
)Arguments
- y
A
ts(or ts-boxable) target series used for alignment.- td_candidates
Optional named list of precomputed regressors (ts-boxable).
- holidays
Optional list defining moving-holiday regressors. Each element may be:
a
Datevector (holiday dates), ora list with fields
dates(Date),start(int),end(int),center(chr),name(chr) Windows are in days relative to the holiday date. Defaults:start=-7,end=0. Names on theholidayslist are preserved whennameis not supplied inside an element.
- frequency
Optional frequency to use for holiday regressors (defaults to
frequency(y)).- td_usertype
X-13 usertype label for all returned regressors (default "holiday").
- default_center
Default centering for holiday regressors.
Value
A named list of ts regressors aligned to y. Attribute td_usertype
is attached for downstream use.
Details
Supports:
Precomputed regressors (
td_candidates): named list of ts-boxable seriesMoving-holiday regressors (
holidays): built viaseasonal::genhol()
The output is directly consumable by auto_seasonal_analysis() via its
td_candidates argument.
