Statistics Glossary → ARIMA Forecast
ARIMA Forecastanalysis
A method that forecasts the future values of a time series with an autoregressive integrated moving average (ARIMA) model, which draws on the series' own past values and past forecast errors.
Concept
In many series today's value carries a trace of past values and of past 'surprises' (forecast errors). ARIMA models this memory with three parts: the autoregressive part (AR, p) for the effect of the last p values, the moving-average part (MA, q) for the effect of the last q errors, and the integrated part (I, d) for how many times a non-stationary series is differenced. Once the model has explained the series with this structure, it extends it into the future to produce forecasts and prediction intervals.
For example, an ARIMA(1,1,1) model first takes the monthly change (d = 1) and then links that change to the previous change and the previous error. For seasonal series (P, D, Q)m terms are added, which set up the same relationship with the values and errors m periods earlier. Competing models are compared with information criteria such as AIC, AICc or BIC, which reward fit while penalising unnecessary parameters.
ARIMA assumes that the differenced series is stationary and that the errors are independent; in a suitable model the residuals should resemble white noise (a non-significant Ljung-Box test). Prediction intervals widen as the horizon lengthens; forecasts for the distant future are far more uncertain than those for the near future. Structural breaks and events not in the model can spoil the forecasts.
When to use it
- For short- and medium-term forecasts of a single series from its own past (monthly sales, demand, patient numbers).
- If the forecast must also account for an external variable (price, a campaign, holidays), use ARIMAX; if several series influence one another, use VAR.
- If a simpler method that tracks trend and season with intuitive parameters is wanted, use exponential smoothing (Holt-Winters); if the components are to be interpreted separately, an unobserved components model is preferred.
An everyday example
A city council wants to plan next year's timetable for a city bus route using the past ten years of monthly passenger numbers. Ridership has been growing over the years and rises in the months when schools are open. A seasonal ARIMA model captures both this growth and the school-term wave and might forecast, say, 52,000 passengers for next October with a 95% prediction interval from 47,000 to 57,000; the council can then plan the need for extra buses around the upper limit of that interval.
Parameters in MerQur
AR (p), Difference (d), MA (q) (p 0-5, d 0-2, q 0-5; default 1, 1, 1)
Concept: p sets how many past values the model relies on, q how many past forecast errors, and d how many times the series is differenced to make it stationary. Roughly, an ACF that dies out gradually with a PACF that cuts off at a certain lag points to an AR structure, and the reverse to an MA structure.
Everyday example: If monthly ridership rises over the years, it is first differenced (d = 1): the model then works with 'how much did it change from last month' instead of 'how many passengers this month'. p = 1 says this change depends on the previous month's change, and q = 1 that it depends on last month's forecast error.
What it does: Differences a non-stationary series d times and models it with p autoregressive and q moving-average terms.
Effect on the result: Coefficients, log L, AIC/AICc/BIC and forecasts. With d = 0 the mean (constant) is in the model, with d ≥ 1 it is not.
On the validation data: AirPassengers (1,1,1) AICc 1394.86, forecast[1] 475.73; (0,2,2) AICc 1394.55, forecast[1] 461.62. lh AR(1) φ = 0.5739.
Include drift (d = 1)
Concept: A constant in the differenced series (drift) means that the original series rises or falls by the same amount on average every period. Forecasts therefore extend along a line with a constant slope rather than staying flat.
Everyday example: If the route gains about 150 passengers a month on average, the drift represents this slope and the forecasts keep rising by roughly 150 passengers each month. Without drift the forecast would stay at the last level.
What it does: When d = 1 (or d + D = 1), a constant in the differenced series, i.e. a linear trend in the level. With d = 0 and d = 2 no drift is added and this is stated in the result note.
Effect on the result: The drift coefficient, information criteria and forecasts.
On the validation data: AirPassengers (1,1,1) + drift: drift 2.450 (SE 3.27), AICc 1396.41 (1394.86 without drift). austa (0,1,1) + drift forecast[1] 7.109.
Automatic model selection (auto.arima)
Concept: Automatic selection fits many candidate ARIMA models, compares them with an information criterion (AICc) and picks the one with the lowest value. AICc rewards fit to the data while penalising the number of parameters, and is AIC corrected for small samples.
Everyday example: If the council's analyst does not know which p and q are suitable, automatic selection tries dozens of models. The chosen model's residuals should still be checked; the lowest AICc alone does not show that a model is adequate.
What it does: Selects d by the KPSS-based number-of-differences rule; compares p, q ≤ 5 (p + q ≤ 5) and the constant/drift options by AICc (full non-stepwise search, non-seasonal).
Effect on the result: The selected model and all results.
On the validation data: uschange consumption: ARIMA(3,0,0) + mean; WWWusage: ARIMA(3,1,0).
Forecast horizon (1-100) and Confidence Level
Concept: The forecast horizon sets how many periods ahead to forecast, and the confidence level sets the width of the prediction interval. A prediction interval is the range in which a single future observation may fall; because it includes both model uncertainty and each period's own random variation, it is wider than a confidence interval for the mean.
Everyday example: With 12 steps, a forecast is produced for each month of the coming year. Next month's 95% interval might be ±3,000 passengers while a year ahead it is ±8,000; asking for an 80% interval narrows both.
What it does: Forecast horizon and interval level. The interval is built with σ² = Σe²/(n* - k).
Effect on the result: Number of forecasts and interval width; the horizon does not change the values.
On the validation data: WWWusage (1,1,1): forecast[1] 218.880; %90 [213.68, 224.08], %95 [212.68, 225.08], %99 [210.74, 227.02].
Seasonal (P, D, Q) m (m = 0 off)
Concept: Seasonal terms set up the same relationship with values and errors one season (m periods) earlier: P is the number of seasonal AR terms, D the seasonal differences and Q the seasonal MA terms. A seasonal difference subtracts from each value the value of the same period a year before.
Everyday example: For monthly ridership m = 12. With D = 1 the model works with 'how different is this October from last October?', so the school-term wave is taken into account automatically every year.
What it does: Seasonal AR, difference and MA terms.
Effect on the result: Coefficients and forecasts.
On the validation data: USAccDeaths (0,1,1)(0,1,1)12: θ = -0.4303, Θ = -0.5528; euretail (0,1,3)(0,1,1)4: Θ = -0.6635.
Independent variables (ARIMAX)
Concept: ARIMAX fits a regression that explains the series with one or more external variables and models the errors of that regression with ARIMA. To forecast, the future values of the external variable must be known or forecast separately.
Everyday example: If fare changes are thought to affect ridership, the fare is added as an independent variable. To forecast next year, the fares the council plans to charge must also be supplied.
What it does: Regression with ARIMA errors; for forecasting, future regressor values are taken from rows where the dependent variable is empty.
Effect on the result: The regressor coefficient and forecasts.
On the validation data: LakeHuron (2,0,0) + (year - 1920): slope -0.0216; without future values no forecast is produced and this is stated in the note. uschange automatic + Income + last 8 observations: test RMSE 0.2176.
Transformation (None / log / Square root (λ = 0.5) / Box-Cox) and Box-Cox λ (lowest value = Guerrero)
Concept: A transformation moves the series to a log, square-root or Box-Cox scale to stabilise fluctuations that grow with the level; the model is fitted on that scale and the forecasts are transformed back to the original scale. Because information criteria are computed on the transformed scale, AIC values of models with different transformations cannot be compared.
Everyday example: If the gap between busy and quiet months grows as ridership grows, a log transformation makes this gap proportional and the model behaves more evenly. The forecasts are still reported as numbers of passengers.
What it does: Transforms a series whose amplitude grows with the level; for Box-Cox, λ is chosen manually or by the Guerrero method.
Effect on the result: Forecasts are back-transformed; AIC is on the transformed scale and cannot be compared across transformations.
On the validation data: AirPassengers (1,1,1) forecast[1]: log 463.19; square root 470.64; Box-Cox Guerrero (λ = -0.2947) 458.85.
Holdout set (last k observations), Additional output: Bias adjustment (biasadj), Residual diagnostics (ACF + normality), Save to dataset
Concept: A validation set holds back the last k observations when fitting the model so that the forecasts can be compared with these actual values; this is a more honest measure of performance than in-sample fit. Back-transforming from the log scale gives the median of the forecast; the bias adjustment gives the mean instead.
Everyday example: If the last 12 months are held out and the model is fitted to the previous nine years, one sees how far, on average, the forecasts miss that year's actual ridership. If forecasts are to be added up, for example into annual passenger totals, mean forecasts are needed and the bias adjustment should be switched on.
What it does: The last k observations are not used for fitting and test accuracy (RMSE, MAPE, MASE) is reported. biasadj gives the mean instead of the median forecast on back-transformation. Residual diagnostics include Jarque-Bera and Shapiro-Wilk; Save adds the forecast, limits and residual columns.
Effect on the result: Additional output; biasadj changes the forecast value.
On the validation data: Airline model, last 12 observations: RMSE 18.594, MAPE 2.905. biasadj: log (1,1,1) forecast[1] 465.60 instead of 463.19.
Estimation method (Maximum likelihood (ML) / Conditional least squares (CLS) / Unconditional least squares (ULS))
Concept: Sets the criterion used to estimate the model coefficients: maximum likelihood (ML) maximises the probability of the data, while conditional and unconditional least squares minimise the sum of squared errors. In long series the three give nearly the same coefficients; differences become noticeable in short series.
Everyday example: In the 120-month ridership series, the AR coefficients from ML and CLS may differ only in the second decimal place. With only a few years of data the gap would be larger.
What it does: Parameter estimation method. CLS conditions on the first p (+ difference) observations; ULS minimises the unconditional least-squares objective (σ² denominator n_e).
Effect on the result: Coefficients, σ² and SE; CLS and ULS values differ slightly from ML.
On the validation data: lh AR(1) CLS (conditional least squares): μ = 2.413392, φ = 0.585932, σ² = 0.206033. ULS WWWusage ARIMA(1,1,1): φ = 0.657313.
Example on real data
Data: AirPassengers, Box and Jenkins 1976, R datasets
Variables: date date (month), value passengers (monthly passengers, thousands)
- Question: How is the monthly airline passenger count (1949-1960, n = 144) modelled with ARIMA(1,1,1), and what is the forecast for the coming months?
- Model: In the first-differenced series AR(1) = -0.474 (SE 0.116, z = -4.09, p < .001) and MA(1) = 0.864 (SE 0.072, z = 12.00, p < .001); log L = -694.34, AIC = 1394.68, AICc = 1394.86, BIC = 1403.57.
- Fit: In-sample RMSE = 30.91, MAE = 24.12, MAPE = 8.57%, MASE = 0.753.
- Residual diagnostics: Ljung-Box Q*(22) = 231.49, p < .001 (24 lags); strong autocorrelation remains in the residuals because the 12-month seasonality of the series is not in the model.
- Forecast: 475.73 for January 1961 (95% interval 414.51 - 536.96); the intervals widen quickly as the horizon grows.
- Limitation: The default (1,1,1) structure is inadequate for seasonal series; seasonal (P, D, Q)12 terms or a log transformation should be tried.
- APA: ARIMA(1,1,1) model, φ1 = -0.47, θ1 = 0.86, AIC = 1394.68; Ljung-Box Q(22) = 231.49, p < .001.
Related concepts
ARIMA orders (p, d, q) and driftForecast horizon and forecast intervalTrain-test split (holdout)Exogenous variables (VARX, ARIMAX)Box-Cox transformationInformation criteria (AIC, AICc, BIC)Seasonality and seasonal periodMaximum likelihood (ML) estimation
The numbers in the examples are MerQur's output on independent, publicly available validation data; see the MerQur Technical Note for details.