Forecasting call bookings
Another time series with multiple seasonal periods is calls, which contains 20 consecutive days of 5-minute call volume data for a large North American bank. There are 169 5-minute periods in a working day, and so the weekly seasonal frequency is 5 x 169 = 845. The weekly seasonality is relatively weak, so here you will just model daily seasonality. calls is pre-loaded into your workspace.
The residuals in this case still fail the white noise tests, but their autocorrelations are tiny, even though they are significant. This is because the series is so long. It is often unrealistic to have residuals that pass the tests for such long series. The effect of the remaining correlations on the forecasts will be negligible.
Cet exercice fait partie du cours
Forecasting in R
Instructions
- Plot the
callsdata to see the strong daily seasonality and weak weekly seasonality. - Set up the
xregmatrix using order10for daily seasonality and0for weekly seasonality. Note that if you incorrectly specify your vector, your session may expire! - Fit a dynamic regression model called
fitusingauto.arima()withseasonal = FALSEandstationary = TRUE. - Check the residuals of the fitted model.
- Create the forecasts for 10 working days ahead as
fc, and then plot it. The exercise description should help you determine the proper value ofh.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Plot the calls data
___
# Set up the xreg matrix
xreg <- fourier(___, K = ___)
# Fit a dynamic regression model
fit <- auto.arima(___, xreg = ___, ___, ___)
# Check the residuals
___
# Plot forecasts for 10 working days ahead
fc <- forecast(fit, xreg = fourier(calls, c(10, 0), h = ___))
___