Skip to content
AI360XpertBeta
Core ML

Visual explainer

Time Series Forecasting (ARIMA)

Difference observed levels, forecast the next change and accumulate back to a level, then check future errors, prediction intervals and an unseen break.

Shuffling observations changes the adjacent pairs used by a time series model.
Shuffling observations changes the adjacent pairs used by a time series model.

ARIMA forecasts a series using past values and past forecast errors, with differencing when needed. It models temporal dependence rather than requiring a separate trend-and-season decomposition first. The useful question is whether its assumptions and forecasts hold on the series being modeled.

The left trace shows synthetic weekly observations [5, 7, 8, 10]; the right uses the same values in order [10, 5, 8, 7]. Both plots share a zero and vertical scale. The adjacent pairs change when the observations move. Four points cannot establish stationarity, a reliable trend or predictive skill. Some time series have little usable dependence; chronological order still matters when evaluating forecasts of the future.

Difference Adjacent Values

First differencing replaces levels with changes between adjacent observations.
First differencing replaces levels with changes between adjacent observations.

Each pair of connecting lines gathers neighboring observations. Subtract the earlier level from the later one: 7 − 5 = 2, 8 − 7 = 1, and 10 − 8 = 2. The resulting series w is [2, 1, 2]. This is first differencing, d = 1. It can remove some forms of nonstationarity, but three changes do not prove that it succeeded. Inspect a longer series and use appropriate diagnostics; unnecessary differencing can introduce unwanted dependence. ARIMA allows d = 0 when differencing is not needed. Seasonality can require seasonal terms or seasonal differencing. See ARIMA and differencing.

Forecast the Next Change

An ARMA step adds a weighted past change and a weighted past error.
An ARMA step adds a weighted past change and a weighted past error.

Use an illustrative model for the differenced series:

wt=0.5wt−1+et+0.5et−1.w_t = 0.5w_{t-1} + e_t + 0.5e_{t-1}.

There is no constant term. Assume the latest change is 2 and the latest one-step residual is 1, meaning its fitted change was 1 while the observed change was 2. At the forecast origin, the next innovation has conditional mean zero. The predicted change is therefore 0.5 × 2 + 0.5 × 1 = 1.5. The top and middle bars encode contributions 1 and 0.5; their lengths add in the bottom bar. These coefficients are chosen for arithmetic, not estimated from four observations. AR and MA coefficients generally need not sum to one. Moving average here refers to past errors, not a rolling average of observed levels.

Interpret the Orders

The AR and MA orders count past changes and past errors used in prediction.
The AR and MA orders count past changes and past errors used in prediction.

The two lanes feed one previous change w and one previous residual e into the next prediction: p = 1 and q = 1. Combined with the single differencing operation, this is ARIMA(1, 1, 1). These orders count lag terms and differencing operations; they are not three interchangeable complexity settings. In practice, select differencing and candidate orders with suitable diagnostics, estimate parameters, and check forecasts on later observations. There is no universally best order of two or mandatory starting model.

Return to the Level

Undo differencing by adding the predicted change to the last observed level.
Undo differencing by adding the predicted change to the last observed level.

The last level is 10. Add the predicted change 1.5 to forecast the next level at 11.5. The vertical movement is exactly 1.5 units on the level scale; the mint endpoint is a forecast and the solid white point is observed. This accumulation reverses first differencing. It would be wrong to report 1.5 as the next level or to apply the difference-model equation directly to the original levels.

Compare on Future Observations

The worked ARIMA model loses to a naive baseline on these three future observations.
The worked ARIMA model loses to a naive baseline on these three future observations.

Suppose the next three observed levels are 11, 13 and 12. Evaluate rolling one-step forecasts: after each observation, update the last change and residual, keeping the illustrative parameters fixed. The ARIMA forecasts are 11.5, 11.25 and 14.875. After observing 11, the change is 1 and residual −0.5, so the next change forecast is 0.5 − 0.25 = 0.25. After observing 13, the change is 2 and residual 1.75, so the following change forecast is 1 + 0.875 = 1.875.

For each future date, the upper outlined bar is the naive absolute error and the lower filled bar is the ARIMA absolute error, on the same scale. Naive persistence forecasts [10, 11, 13], giving errors [1, 2, 1] and mean absolute error 4/3 ≈ 1.3333. ARIMA errors are [0.5, 1.75, 2.875], giving MAE 5.125/3 ≈ 1.7083. ARIMA loses on this tiny synthetic sample. This is a checkable comparison, not an empirical benchmark or evidence that naive persistence always wins. Use chronological validation, an untouched test period, and a baseline appropriate to the application; see forecast evaluation. MAE is not forecast variance.

Inspect Residual Structure

Alternating residuals reveal a pattern the model has left unexplained.
Alternating residuals reveal a pattern the model has left unexplained.

This separate diagnostic example has residuals [1, −1, 1, −1, 1, −1]. Their mean is zero, but the repeated alternation is visible. A zero average alone does not make residuals white noise. Examine residual autocorrelation and other diagnostics on enough data, then investigate missed structure, transformations or model choices. This six-point drawing illustrates dependence; it does not report a statistical test or use the rolling errors from the preceding frame.

Forecast Several Steps Ahead

Multistep forecasts accumulate shrinking predicted changes into future levels.
Multistep forecasts accumulate shrinking predicted changes into future levels.

Return to the original forecast origin, with last level 10, change 2 and residual 1. No future observations have arrived in this frame. The first predicted change is 1.5. For step two, substitute the predicted change and set the unknown future innovation to its conditional mean of zero: 0.5 × 1.5 = 0.75. Step three gives 0.375. Accumulating them produces level forecasts 11.5, 12.25 and 12.625. Horizontal positions are horizons 0 through 3; vertical steps encode the increments on one common scale. Using zero for future innovations in a point forecast does not mean future realized errors will be zero.

Show Prediction Uncertainty

Prediction intervals widen as future innovations accumulate in the level forecast.
Prediction intervals widen as future innovations accumulate in the level forecast.

Keep the same model and assume known parameters and independent Gaussian innovations with standard deviation 1. The effect of successive innovations on the level has coefficients 1, 2 and 2.5. Consequently the forecast-error variances at horizons 1, 2 and 3 are 1, 1 + 2² = 5, and 1 + 2² + 2.5² = 11.25. Multiplying their standard deviations by 1.96 gives approximate 95% pointwise prediction half-widths 1.96, 4.382693 and 6.574040.

The whiskers center on the three level forecasts and use the same vertical scale. They concern a future observation, not uncertainty about the mean alone. They exclude parameter uncertainty, order-selection uncertainty and structural changes. Coverage is conditional on the assumptions and is pointwise, not a 95% guarantee that the entire future path stays inside. Other ARIMA models have different horizon behavior; stationary models can approach a finite long-horizon variance.

Where It Breaks

A history-only forecast cannot foresee an unannounced change in the data process.
A history-only forecast cannot foresee an unannounced change in the data process.

For this final limit, switch explicitly to a random walk without drift, ARIMA(0, 1, 0). Given a last observed level of 10, its point forecasts remain at 10. The future observations instead jump to 30 after an unannounced change. The first forecast misses by 20. The white line joins observed samples; the dashed amber line is the forecast made before the jump.

The same observed history could precede either a continued level or a break. A history-only model receives no new information to distinguish those futures in advance. Adaptation after the observation depends on the model and update procedure; a random walk updates its next forecast immediately to the newly observed level. There is no universal six-week lag. Relevant external information, revised models and monitoring can help, but adding a regressor cannot predict an event whose future value is itself unknown.

The Quick Version

  • Time order determines the adjacent observations a model uses.
  • Differencing replaces levels with adjacent changes.
  • ARMA combines past changes and past errors here.
  • Orders count lag terms and differencing operations.
  • Accumulation returns predicted changes to the original level.
  • Compare against naive forecasts on later observations.
  • Residual patterns reveal unexplained temporal structure.
  • Multistep point forecasts substitute expected future innovations.
  • Prediction intervals depend on model assumptions and horizon.
  • History alone cannot foresee an unannounced structural break.