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.
This exercise is part of the course
Forecasting in R
Exercise instructions
- Plot the
calls
data to see the strong daily seasonality and weak weekly seasonality. - Set up the
xreg
matrix using order10
for daily seasonality and0
for weekly seasonality. Note that if you incorrectly specify your vector, your session may expire! - Fit a dynamic regression model called
fit
usingauto.arima()
withseasonal = FALSE
andstationary = 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
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample 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 = ___))
___