sim_sfac: Simulate a seasonal factor

Description Usage Arguments Details Value Author(s) References Examples

View source: R/sim_sfac.R

Description

Simulate a seasonal factor

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
sim_sfac(
  n,
  freq = 12,
  sd = 1,
  change_sd = 0.02,
  beta_1 = 0.9,
  beta_tau = 0,
  start = c(2020, 1),
  multiplicative = TRUE,
  ar = NULL,
  ma = NULL,
  model = c(1, 1, 1),
  sc_model = list(order = c(1, 1, 1), ar = 0.65, ma = 0.25),
  smooth = TRUE,
  burnin = 3,
  extra_smooth = FALSE
)

Arguments

n

Number of observations

freq

Frequency of the time series

sd

Standard deviation of the seasonal factor

change_sd

Standard deviation of simulation change to seasonal factor

beta_1

Persistance wrt to previous period of the seasonal change

beta_tau

Persistance wrt to one year/cycle before of the seasonal change

start

Start date of output time series

multiplicative

Boolean. Should multiplicative seasonal factors be simulated

ar

AR parameter

ma

MA parameter

model

Model for initial seasonal factor

sc_model

Model for the seasonal change

smooth

Boolean. Should initial seasonal factor be smoothed

burnin

(burnin*n-n) is the burn-in period

extra_smooth

Boolean. Should the seasonal factor be smooth on a period-by-period basis

Details

Standard deviation of the seasonal factor is in percent if a multiplicative time series model is assumed. Otherwise it is in unitless. Using a non-seasonal ARIMA model does not impact the seasonality of the time series. It can just make it easier for human eyes to grasp the seasonal nature of the series. The definition of the ar and ma parameter needs to be inline with the chosen model.

Value

The function returns a time series of class ts containing a seasonal or periodic effect.

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

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

Related to sim_sfac in tssim...