This example illustrates a Box-Jenkins time series analysis for seasonal data using the series G data set in Box, Jenkins, and Reinsel, 1994. A plot of the 144 observations is shown below.
Non-constant variance can be removed by performing a natural log transformation.
Next, we remove trend in the series by taking first differences. The resulting series is shown below.
Analyzing Autocorrelation Plot for Seasonality
To identify an appropriate model, we plot the ACF of the time series.
If very large autocorrelations are observed at lags spaced n periods apart, for example at lags 12 and 24, then there is evidence of periodicity. That effect should be removed, since the objective of the identification stage is to reduce the autocorrelation throughout. So if simple differencing is not enough, try seasonal differencing at a selected period, such as 4, 6, or 12. In our example, the seasonal period is 12.
A plot of Series G after taking the natural log, first differencing, and seasonal differencing is shown below.
The number of seasonal terms is rarely more than one. If you know the shape of your forecast function, or you wish to assign a particular shape to the forecast function, you can select the appropriate number of terms for seasonal AR or seasonal MA models.
The book by Box and Jenkins, Time Series Analysis Forecasting and Control (the later edition is Box, Jenkins and Reinsel, 1994) has a discussion on these forecast functions on pages 326 – 328. Again, if you have only a faint notion, but you do know that there was a trend upwards before differencing, pick a seasonal MA term and see what comes out in the diagnostics.
An ACF plot of the seasonal and first differenced natural log of series G is shown below.
The plot has a few spikes, but most autocorrelations are near zero, indicating that a seasonal MA(1) model is appropriate.
We fit a seasonal MA(1) model to the data
where θ1 represents the MA(1) parameter and ψ1 represents the seasonal parameter. The model fitting results are shown below.
Residual standard deviation = 0.0367
Log likelihood = 244.7
AIC = -483.4
Test the randomness of the residuals up to 30 lags using the Box-Ljung test. Recall that the degrees of freedom for the critical region must be adjusted to account for two estimated parameters.
H0: The residuals are random.
Ha: The residuals are not random.
Test statistic: Q = 29.4935
Significance level: α = 0.05
Degrees of freedom: h = 30 – 2 = 28
Critical value: Χ 21-α,h = 41.3371
Critical region: Reject H0 if Q > 41.3371
Since the null hypothesis of the Box-Ljung test is not rejected we conclude that the fitted model is adequate.
Using our seasonal MA(1) model, we forcast values 12 periods into the future and compute 90 % confidence limits.
All the anlayses in this page can be generated using R code.