powered by
Create a seasonal daily time series and its seasonal and non-seasonal components
daily_sim( n = 8, week_effect = 1, month_effect = 1, year_effect = 1, model = c(3, 1, 1), ar = c(-0.2, 0.5, 0.1), ma = -0.4, moving = T, week_cycles = 2, month_cycles = 3, year_cycles = 8 )
length of time series in years
increase size of seasonal factor for day-of-the-week
increase size of seasonal factor for day-of-the-month
increase size of seasonal factor for day-of-the-year
ARIMA model for trend and irregular component of series
coefficients for AR terms
coefficients for MA terms
should seasonal factors be moving (=T) or constant (=F)
number of cycles per week
number of cycles per month
number of cycles per year
The output is an xts time series containing the time series, the true seasonally adjusted series,
the day-of-the-week seasonal component, the day-of-the-month seasonal component and the
day-of-the-year seasonal component.
# NOT RUN { time_series <- daily_sim(n=4, year_effect=3) xtsplot(time_series[,1]) # Plot of the time series xtsplot(time_series[,3:5]) # Plot of the seasonal factors # }
Run the code above in your browser using DataLab