sim_calendar {tssim} | R Documentation |
Simulate calendar effects
Description
Simulate a time series containing specified calendar effects
Usage
sim_calendar(
n,
which = c("Easter", "Ascension"),
from = 0,
to = 0,
freq = 12,
effect_size = 3,
start = "2020-01-01",
multiplicative = TRUE,
time_dynamic = 1,
center = TRUE
)
Arguments
n |
Time series length |
which |
Holidays to be used, functions from timeDate package used |
from |
days before the Holiday to include |
to |
days after the Holiday to include |
freq |
Frequency of the time series |
effect_size |
Mean size of calendar effect |
start |
Start Date of output time series |
multiplicative |
Boolean. Is multiplicative time series model assumed? |
time_dynamic |
Should the calendar effect change over time |
center |
Should calendar variable be center, i.e. mean=0 |
Details
If multiplicative is true, the effect size is measured in percentage. If is not true, the effect size is unit less and thus adopts the unit of the time series the calendars are added to. The time_dynamic parameter controls the change of the calendar effect. The effect of the previous year is multiplied by the time_dynamic factor.
Value
The function returns a time series of class xts
Author(s)
Daniel Ollech
References
Ollech, D. (2021). Seasonal adjustment of daily time series. Journal of Time Series Econometrics. doi: 10.1515/jtse-2020-0028
Examples
plot(sim_calendar(60, from=0, to=4, freq=12))