sim_sfac | R Documentation |
Simulate a seasonal factor
sim_sfac(
n,
freq = 12,
sd = 1,
change_sd = sd/10,
moving = TRUE,
beta_1 = 0.6,
beta_tau = 0.4,
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 = 7,
extra_smooth = FALSE
)
n |
Number of observations |
freq |
Frequency of the time series |
sd |
Standard deviation of the seasonal factor |
change_sd |
Standard deviation of shock to seasonal factor |
moving |
Is the seasonal pattern allowed to change over time |
beta_1 |
Persistence wrt to previous period of the seasonal change |
beta_tau |
Persistence wrt to one year/cycle 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 smoothed on a period-by-period basis |
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 in line with the chosen model.
The function returns a time series of class ts
containing a seasonal or periodic effect.
Daniel Ollech
Ollech, D. (2021). Seasonal adjustment of daily time series. Journal of Time Series Econometrics. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1515/jtse-2020-0028")}
ts.plot(sim_sfac(60))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.