Phase 12 - Lesson 12.3

ARIMA and Forecasting

Differencing away a unit root, the Box-Jenkins loop, and how to produce point forecasts with honest, widening prediction intervals.

⏱ 55 min● Intermediate🔗 Prereqs: 12.1, 12.2
↖ Phase 12 hub
Builds on: 12.2 gave ARMA; 12.1 gave the unit-root/differencing diagnostic.
Leads to: Forecast-error variance recurs in the Kalman filter (12.5) and backtests (12.6).

Learning Objectives

Click a status chip to cycle: Not started → In progress → Studied → Practiced → Needs review → Mastered.

Key Vocabulary

ARIMA(\(p,d,q\))
An ARMA(\(p,q\)) fitted to the series after differencing \(d\) times: \(\phi(L)(1-L)^d X_t=\theta(L)\varepsilon_t\).
Integrated of order \(d\)
A series \(I(d)\) that becomes stationary after \(d\) differences; a random walk is \(I(1)\).
Differencing
The transform \(\nabla X_t=X_t-X_{t-1}=(1-L)X_t\) that removes a unit root / linear trend.
ADF test
Augmented Dickey-Fuller: a hypothesis test whose null is a unit root (non-stationarity).
h-step forecast
The conditional expectation \(\hat X_{t+h\mid t}=\E[X_{t+h}\mid \mathcal F_t]\), the minimum-MSE predictor.
Forecast-error variance
The variance of \(X_{t+h}-\hat X_{t+h\mid t}\); grows with \(h\) toward the unconditional variance.
Prediction interval
A band, e.g. \(\hat X_{t+h\mid t}\pm1.96\,\sigma_h\), quantifying forecast uncertainty at horizon \(h\).

Intuition & Motivation

Intuition
Many important series - prices, indices, GDP - are not stationary: they wander. ARMA cannot model a wanderer directly. The ‘I’ in ARIMA is the fix: difference the series until the wandering stops, model the stationary differences with ARMA, then cumulate the forecasts back up. One difference removes a random-walk (unit-root) trend; occasionally two are needed; more than that usually means you have over-differenced and injected artificial structure.

Forecasting from the fitted model is just conditional expectation: the best \(h\)-step forecast under squared loss is \(\E[X_{t+h}\mid\text{past}]\), which you build by iterating the recursion and setting future shocks to their mean of zero. The crucial honesty is in the interval: uncertainty compounds with the horizon. A one-step forecast is fairly tight; a twenty-step forecast for a stationary series fans out until it is no more informative than the unconditional mean. Reporting a point forecast without its widening band is the forecasting equivalent of a point estimate with no standard error.

From ARMA to ARIMA: differencing

If \(X_t\) has a unit root, \((1-L)X_t\) removes it. An ARIMA(\(p,d,q\)) posits that the \(d\)-th difference is a stationary, invertible ARMA:

\[\phi(L)\,(1-L)^d X_t=\theta(L)\,\varepsilon_t.\] (12.4)

Choose \(d\) by testing: the ADF test has a unit-root null, the KPSS test a stationarity null; use them together. Difference once, re-test, and stop as soon as the series is stationary. Log-transform first when the variance grows with the level (typical for prices). Beware over-differencing - it introduces a non-invertible MA unit root and inflates variance.

The Box-Jenkins loop

  1. Identify: transform to stationarity (log, difference); read ACF/PACF to propose \((p,d,q)\).
  2. Estimate: fit by MLE / conditional least squares; check that roots satisfy stationarity and invertibility.
  3. Diagnose: residuals must be white noise (ACF flat, Ljung-Box \(p\)-value large); if not, revise orders.
  4. Select & forecast: among adequate models pick the lowest AIC/BIC, then forecast with intervals - and validate out of time.

Optimal forecasts and their variance

Worked Example - Forecasting an AR(1) and its error fan
1
Model \(X_t=\phi X_{t-1}+\varepsilon_t\), \(|\phi|\lt 1\). One step: \(\hat X_{t+1\mid t}=\phi X_t\) (set \(\E[\varepsilon_{t+1}]=0\)).
2
Iterate: \(\hat X_{t+h\mid t}=\phi^h X_t\to0\) (the unconditional mean) as \(h\to\infty\).
3
Forecast error: \(X_{t+h}-\hat X_{t+h\mid t}=\sum_{j=0}^{h-1}\phi^j\varepsilon_{t+h-j}\), so the variance is \(\sigma_h^2=\sigma^2\sum_{j=0}^{h-1}\phi^{2j}=\sigma^2\frac{1-\phi^{2h}}{1-\phi^2}\).
4
As \(h\to\infty\), \(\sigma_h^2\to\sigma^2/(1-\phi^2)=\gamma(0)\): the interval widens to the unconditional variance and the forecast is worthless beyond a horizon set by \(\phi\).

For a general MA(\(\infty\)) representation \(X_t=\sum_k\psi_k\varepsilon_{t-k}\), the \(h\)-step forecast-error variance is \(\sigma_h^2=\sigma^2\sum_{j=0}^{h-1}\psi_j^2\), and the interval is \(\hat X_{t+h\mid t}\pm1.96\,\sigma_h\) under Gaussian shocks.

Key Idea
A stationary model forecasts back to its mean, and its interval saturates at the unconditional variance. For an \(I(1)\) (differenced) series the level forecast’s interval instead grows without bound like \(\sqrt h\) - a random walk’s best forecast is its last value, with ever-widening uncertainty.

Interactive: iterate forecasts and watch the interval fan out

Common Mistakes to Avoid
  • Over-differencing (taking \(d\) too large); it creates a non-invertible MA unit root and needlessly inflates forecast variance.
  • Reporting point forecasts with no interval, or with a constant interval that ignores horizon growth.
  • Forecasting the level of an \(I(1)\) series with a stationary model’s saturating band - the true band grows like \(\sqrt h\).
  • Choosing orders purely by in-sample AIC without out-of-time validation on financial data.
  • Confusing a good in-sample fit with forecast skill; a random walk (forecast = last value) beats most elaborate models on prices.
Quant Practitioner Tips
  • Use ADF and KPSS together; if they disagree, inspect the ACF and prefer the more parsimonious \(d\).
  • Benchmark every forecast against the naive random-walk / last-value predictor - if you cannot beat it out of sample, you have no edge.
  • For prices, model returns (already differenced logs) rather than levels; it sidesteps the unit root cleanly.
  • Evaluate forecasts by out-of-time RMSE and interval coverage (are 95% intervals right ~95% of the time?), not in-sample fit.

Knowledge Check

Q1 Easy
The \(d\) in ARIMA(\(p,d,q\)) specifies:
The number of AR lags
The number of times the series is differenced to reach stationarity
The number of MA lags
The forecast horizon
Q2 Medium
For a stationary AR(1), as the forecast horizon \(h\to\infty\), the forecast-error variance:
Grows without bound
Approaches the unconditional variance \(\sigma^2/(1-\phi^2)\)
Shrinks to zero
Stays equal to \(\sigma^2\)
Q3 Medium
Over-differencing a series (taking \(d\) larger than needed) typically:
Improves stationarity for free
Introduces a non-invertible MA unit root and inflates variance
Removes all autocorrelation
Has no effect

Practical Exercise

You must forecast a stock price index. (a) Why fit ARIMA rather than ARMA, and what is a sensible \(d\)? (b) A colleague’s ARIMA(2,1,2) has in-sample RMSE far below a random walk but loses to it out of sample. Diagnose. (c) State how you would report a 10-day-ahead forecast honestly.

▶ Show full solution

(a) The index has a unit root (prices wander), so ARMA on the level is invalid; ARIMA with \(d=1\) (equivalently modeling log-returns) makes the differenced series stationary. Usually \(d=1\) suffices; check with ADF/KPSS and avoid \(d\ge2\) unless clearly needed.

(b) Classic over-fitting: ARIMA(2,1,2) has enough parameters (and likely near-canceling AR/MA roots) to fit in-sample noise, but the true mean-predictability of returns is near zero, so it cannot beat the naive last-value forecast out of sample. The in-sample RMSE is optimistic (11.3); orders were chosen without out-of-time validation.

(c) Report the point forecast (for an \(I(1)\) level, close to the last value) with a prediction interval that widens with the horizon - for the differenced series the level-forecast band grows roughly like \(\sigma\sqrt{h}\). Include out-of-time RMSE versus the random-walk benchmark and the empirical coverage of the interval. If it does not beat the random walk, say so.

After the reveal, answer for yourself: On prices, ‘the forecast is roughly today’s value, and here is how fast my uncertainty grows’ is often the most honest answer.

Lesson Summary

ARIMA(\(p,d,q\)) differences a series \(d\) times to remove unit roots, then fits a stationary invertible ARMA, following the Box-Jenkins identify-estimate-diagnose loop. Optimal forecasts are conditional expectations obtained by iterating the recursion with future shocks set to zero; the forecast-error variance grows with the horizon, saturating at the unconditional variance for stationary series but growing like \(\sqrt h\) for \(I(1)\) levels. Always report widening intervals and benchmark against the naive random walk - on financial prices it is a stiff, honest competitor.

Formula Sheet Additions

ARIMA
\[\phi(L)(1-L)^d X_t=\theta(L)\varepsilon_t\]
ARMA on the \(d\)-th difference; \(d\) kills unit roots.
Forecast-error variance
\[\sigma_h^2=\sigma^2\textstyle\sum_{j=0}^{h-1}\psi_j^2\]
Widens with \(h\); the basis of prediction intervals.
Error Log Checklist
  • Did I test for a unit root and pick the smallest \(d\) that gives stationarity?
  • Did I check for over-differencing (an MA unit root)?
  • Did I report horizon-widening prediction intervals, not just points?
  • Did I beat the random-walk benchmark out of time?

Retrieval Practice

Close the lesson and answer from memory before checking. This is deliberate, effortful recall - the single highest-yield study action.

▶ Show retrieval prompts & answers
Q: What does the \(d\) in ARIMA do and how is it chosen?
A: It differences the series \(d\) times to remove unit roots; choose the smallest \(d\) making the series stationary (ADF/KPSS).
Q: How does forecast-error variance behave with horizon for a stationary AR(1) versus an \(I(1)\) series?
A: Stationary: saturates at the unconditional variance \(\sigma^2/(1-\phi^2)\). \(I(1)\) level: grows without bound like \(\sigma\sqrt h\).
Q: What is the naive benchmark every price forecast must beat?
A: The random walk / last-value forecast; if you cannot beat it out of sample you have no predictive edge.

Flashcards

Click to flip. These feed the site-wide spaced-repetition queue.

ARIMA
\(\phi(L)(1-L)^d X_t=\theta(L)\varepsilon_t\); difference \(d\) times, then ARMA.
Box-Jenkins
Identify (stationarize, ACF/PACF) -> Estimate -> Diagnose residuals -> Select/forecast.
Interval growth
Stationary: band saturates at unconditional variance. \(I(1)\): band grows like \(\sqrt h\).

Completion Checklist

Confidence / mastery rating
Personal notes

Source References

This lesson synthesizes and paraphrases concepts from the sources below. No copyrighted text, problem sets, or solutions are reproduced. Return to the originals for full depth.