1. Seasonal ARIMA models
ARIMA models can also handle seasonal time series.
2. ARIMA models
We just need to add seasonal differencing and a whole lot more lagged terms into the model.
As you know by now, an ARIMA(p,d,q) model involves d lag-1 differences, p lagged observations and q lagged errors.
For a seasonal ARIMA model,
3. ARIMA models
we have another P, D and Q, all uppercase, referring to seasonal versions of these.
4. ARIMA models
D refers to the number of seasonal differences to use, P to the number of seasonally lagged observations, and Q to the number of seasonally lagged errors. Finally, the m on the end indicates the seasonal period - the number of observations in each year of data.
As you can imagine, these models can get very complicated to write down. They are also no longer linear, as the seasonal parts get multiplied with the non-seasonal parts of the model. I won't attempt to show you the equations here.
5. Example: Monthly retail debit card usage in Iceland
Let's look at an example of monthly data. This is the total usage for debit cards in Iceland over a 13 year period. There is increasing variation, so we need to use a Box-Cox transformation. To keep it simple, I will use a log transformation and set lambda equals 0. Everything else about the model can be handled automatically using the auto-dot-arima function.
6. Example: Monthly retail debit card usage in Iceland
We apply auto-dot-arima to the data, setting lambda equals 0. The resulting model is an ARIMA(0,1,4)(0,1,1). That is, both seasonal and first differences have been used - indicated by the 1s in the middle slot of each part of the model. It also tells us that 4 lagged errors and 1 seasonally lagged error have been selected. The 0s indicate that no autoregression terms have been used.
The rest of the output tells us about the model coefficients and other model information.
ARIMA models can be hard to interpret, and all those coefficients don't have a neat explanation in terms of the original data. But they are very powerful models which can handle a very wide range of time series.
7. Example: Monthly retail debit card usage in Iceland
We can pass the model object to the forecast function to get forecasts. I'm forecasting 3 years ahead so you can clearly see the increasing trend and increasing variation due to the Box-Cox transformation. Notice how the seasonal parts of the model have captured the seasonality quite well.
A nice feature of seasonal ARIMA models is that they allow the seasonality to change over time. The forecasted seasonal pattern will be most affected by the shape of the seasonality near the end of the series, and not so much on the seasonal patterns at the start of the series.
You might wonder where the trend comes from in this model, as there is no drift term here. It turns out that whenever you do two lots of differencing of any kind, the forecasts will have a trend without needing to include the constant. Here we have done both ordinary and seasonal differencing, so there is a trend in the forecasts.
8. Let's practice!
Now it's your turn to try auto-dot-arima on a different seasonal time series.