What might happen next? Forecast with ARIMA, automatic selection and smoothing
In brief
In the card "How does a value develop over time?" there is the section "What might happen next? (forecast)" below the decomposition. Nothing is calculated without a click. You can choose the automatic selection (Statable suggests an ARIMA model), ARIMA with an order you choose yourself, and exponential smoothing (simple, with trend, Holt-Winters additive or multiplicative). The result shows a checklist first, then the chart with the 80% and 95% band, the forecast table, the model, with the automatic selection the five best models, and a test period.
When the forecast is blocked
- If values are missing in the series, Statable calculates no forecast. It fills in nothing.
- Not with unequal intervals, with fewer than 20 values, or if all values are equal either.
- The automatic selection works up to 600 values. Above that, "choose ARIMA yourself" and smoothing remain.
The choices
- Horizon: by default one period (12 for months), 5 without a season. At most two periods and at most a quarter of the series, at least 1.
- Log scale (ARIMA only, only for values above 0): on by default if the decomposition suggests multiplicative, that is, the fluctuation grows with the level. Forecast and limits are back-transformed; the forecast is then a median, not a mean.
- Choose ARIMA yourself: p, q, P and Q from 0 to 5, d up to 2, D up to 1. The seasonal part (P, D, Q) works only with a period of 2 to 24. The constant exists only for d + D up to 1 (mean or drift).
- Smoothing: with a season only with a period of 2 or more and at least two periods plus one value; multiplicative only for values above 0.
How the automatic selection chooses
Statable follows Hyndman and Khandakar (2008). First the number of differences: d (0 to 2) by the KPSS test (limit 0.463), D (0 or 1) by the seasonal strength (limit 0.64). Then it fits all models up to p, q ≤ 2 with a season (up to 3 without), P, Q ≤ 1 and p + q + P + Q ≤ 5, with and without a constant, and orders them by AICc. The first is the suggestion. The table shows the five best with ΔAICc. With a period above 24 or fewer than three full periods the automatic selection ignores the season.
Trap: the smallest AICc is no proof
The AICc only compares the models it sees. If the second model is less than 2 above (ΔAICc < 2), several models are about equally good; then compare the forecasts ("Calculate this model" in the table). With fewer than 50 values the choice of model is uncertain (Box and Jenkins). The AICc is not suitable for comparing models with different differences.
Reading the result
- Checklist: it comes before the numbers. Each sentence applies if its condition is met. The first always applies: a forecast extends the past and holds only if the conditions stay the same.
- Chart and table: line of the values, dashed the forecast, with an 80% and a 95% band. The vertical line stands at the last value. The bands widen with the horizon.
- Residuals: the Ljung-Box test checks whether the model's errors are still related. p < .05 means: the model does not capture the whole pattern, and the intervals are unreliable.
- Test period: the last values (one period, up to 5 without a season) are held back and the same model is estimated anew with the earlier values. The comparison is with the simple rule (last value, with a season the value one period earlier). If the model was not better (RMSE equal or larger), the forecast is no gain. If the series is too short, the checklist says so.
- Lower limit below 0 with only positive values: the model does not know the lower bound of 0. The log scale avoids that.
Requirements and limits
- Equal intervals, no gaps, at least 20 values. Better over 50.
- The forecast assumes that the conditions stay the same: no structural break, no new rule, no crisis. The model cannot know that.
- Statable does not handle calendar effects (leap years, working days), holidays, explanatory series or several seasons.
- The intervals of the smoothing (HoltWinters) are an approximation, especially multiplicative.
Reporting the result
For the monthly airline passengers ARIMA(0,1,1)(0,1,1)[12] was estimated on the log scale (MA 1 = −.402, seasonal MA 1 = −.557; AICc = −483.21). Ljung-Box Q(24) = 26.45, df = 22, p = .233. In the 12-month test period the RMSE was 18.59 against 50.71 for the simple rule. Forecast for the first month: 450, 95% interval [419, 484].
For specialists
Everything is calculated by R (only stats, no extra package): arima (maximum likelihood), predict for the mean and standard error, HoltWinters, stl for the seasonal strength, Box.test. The model selection corresponds to forecast::auto.arima with stepwise = FALSE and approximation = FALSE: on ten series, each with and without log, all 20 runs gave the same model, the same AICc and the same point forecast.
The limits deliberately differ from forecast: forecast calculates σ² with a degrees-of-freedom correction, Statable uses stats::predict (σ² from maximum likelihood).
Differences from SPSS
- Sign of the MA coefficients: R and Statable write the model after Box and Jenkins; SPSS shows MA with the opposite sign (airline passengers: −.402 and −.557 against .402 and .558).
- Standard errors and limits: SPSS estimates and calculates the variance differently. Example airline passengers, first month: Statable 419 to 484, SPSS 419 to 485. Example Nile, first year: 541 to 1092 against 534 to 1098.
- Starting values of the smoothing: Nile with simple smoothing: Statable α = .2466 and 805, SPSS α = .248 and 804.
- Point forecasts agree up to rounding (Nile with ARIMA(1,1,1) without a constant: 816, 836, 840, 842, 842 in both).
Sources
Hyndman, R. J., & Khandakar, Y. (2008). Automatic time series forecasting: The forecast package for R. Journal of Statistical Software, 27(3).
Box, G. E. P., & Jenkins, G. M.: Time series analysis: Forecasting and control (Wiley).
Kwiatkowski, D., Phillips, P. C. B., Schmidt, P., & Shin, Y. (1992). Testing the null hypothesis of stationarity against the alternative of a unit root. Journal of Econometrics, 54, 159-178.
Typical examples
- Enrolments in a course per month: how many are to be expected next semester - and was the model better in the test period than "same as last year"?
- Yearly measurements without a season (for example water level): smoothing or ARIMA without a seasonal part, with the test period of the last five years.