sim_calendar: Simulate calendar effects

Description Usage Arguments Details Value Author(s) References Examples

View source: R/sim_calendar.R

Description

Simulate a time series containing specified calendar effects

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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

1
plot(sim_calendar(60, from=0, to=4, freq=12))

tssim documentation built on June 25, 2021, 5:06 p.m.

Related to sim_calendar in tssim...