Simulate a daily seasonal series as described in Ollech (2021).
sim_daily(
N,
sd = 5,
moving = TRUE,
week_sd = NA,
month_sd = NA,
year_sd = NA,
week_change_sd = NA,
month_change_sd = NA,
year_change_sd = NA,
innovations_sd = 1,
sa_sd = NA,
model = list(order = c(3, 1, 1), ma = 0.5, ar = c(0.2, -0.4, 0.1)),
beta_tau7 = 0.01,
beta_tau31 = 0,
beta_tau365 = 0.2,
start = c(2020, 1),
multiplicative = TRUE,
extra_smooth = FALSE,
calendar = list(which = "Easter", from = -2, to = 2),
outlier = NULL,
timewarping = FALSE,
as_index = FALSE
)
Multiple simulated daily time series of class xts including:
The original series
The original series without calendar and seasonal effects
The day-of-the-week effect
The day-of-the-month effect
The day-of-the-year effect
The calendar effects
The outlier effects
length in years
Standard deviation for all seasonal factors
Is the seasonal pattern allowed to change over time
Standard deviation of the seasonal factor for day-of-the-week
Standard deviation of the seasonal factor for day-of-the-month
Standard deviation of the seasonal factor for day-of-the-year
Standard deviation of shock to seasonal factor
Standard deviation of shock to seasonal factor
Standard deviation of shock to seasonal factor
Standard deviation of the innovations used in the non-seasonal regarima model
Standard deviation of the non-seasonal time series
Model for non-seasonal time series. A list.
Persistance wrt to one year/cycle before of the seasonal change for day-of-the-week
Persistance wrt to one year/cycle before of the seasonal change for day-of-the-month
Persistance wrt to one year/cycle before of the seasonal change for day-of-the-year
Start date of output time series
Boolean. Should multiplicative seasonal factors be simulated
Boolean. Should the seasonal factors be smooth on a period-by-period basis
Parameters for calendar effect, a list, see sim_calendar
Parameters for outlier effect, a list, see sim_outlier
Should timewarping be used to obtain the day-of-the-month factors
Shall series be made to look like an index (i.e. shall values be relative to reference year = second year)
Daniel Ollech
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 for the initialization of the seasonal factor 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. The parameters that can be set for calendar and outlier are those defined in sim_outlier and sim_calendar.
Ollech, D. (2021). Seasonal adjustment of daily time series. Journal of Time Series Econometrics. tools:::Rd_expr_doi("10.1515/jtse-2020-0028")
x=sim_daily(5, sd=10, multiplicative=TRUE, outlier=list(k=5, type=c("AO", "LS")))
ts.plot(x[,1])
Run the code above in your browser using DataLab