← Back to Time Series Forecasting

Lesson 02

Stationarity & Differencing

A stationary series has constant mean, variance, and autocovariance structure over time. Most statistical forecasting models require stationarity. Prices are not stationary; returns usually are.

What stationarity means

A time series xt is weakly stationary if three conditions hold simultaneously: the mean E[xt] = μ is constant and does not depend on t; the variance Var(xt) = σ² is finite and constant; and the covariance Cov(xt, xt+k) depends only on the lag k, not on when in time you are measuring it.

A price series violates all three: the mean drifts upward, the variance grows proportionally with time, and the autocorrelation structure shifts as volatility regimes change. Log returns, by contrast, satisfy all three conditions well enough for practical modelling.

Non-stationary: Price
Stationary: Log Returns
Unit root: if xt = xt-1 + εt, the variance grows without bound — Var(xT) = Tσ². Regressing non-stationary series against each other produces spurious correlations with high R² but no predictive content. This is a classic and frequently repeated trap in financial empirical work.

The ADF test

The Augmented Dickey-Fuller (ADF) test is the standard hypothesis test for stationarity. It checks H0: the series has a unit root (non-stationary) against H1: the series is stationary. A p-value below 0.05 lets you reject the null and conclude the series is stationary.

The test works by regressing the differenced series on its lagged level and additional lagged differences. The coefficient on the lagged level is the key parameter: if it is significantly negative, the series mean-reverts, i.e., is stationary.

H₀: series has a unit root   (non-stationary)
H₁: series is stationary

ADF statistic: t = γ̂ / SE(γ̂)
  from the regression: Δxt = α + βt + γxt-1 + Σ φk Δxt-k + εt

Rule of thumb:
  ADF stat < critical value (−2.86 at 5%) → reject H₀ → stationary
  p-value < 0.05                       → reject H₀ → stationary
Always test BOTH the price series (typically fails — non-stationary) and the return series (typically passes — stationary). Never skip this step before fitting ARIMA. A model fitted to a non-stationary series will produce nonsense forecasts that diverge unboundedly.

Differencing

First differencing Δxt = xt − xt-1 removes linear trends from a series. Each application of the difference operator reduces the degree of integration by one. For a price series that follows a random walk (I(1) process), one round of differencing produces a stationary series. Log-differencing — taking Δ log(Pt) = log(Pt/Pt-1) — combines logging and differencing into a single step that produces log returns.

Three representations of the same series
Normalised price First difference Log return
Series Mean drifts? Variance grows? Stationary?
Price ✓ Yes ✓ Yes ✗ No
Δ Price ✗ No ~ Roughly ~ Usually
Log Return ✗ No ✗ Roughly constant ✓ Yes

Integration order d

A series is said to be integrated of order d, written I(d), if it requires d differences to become stationary. A random walk is I(1): one difference suffices. The letter I in ARIMA(p,d,q) records this: ARIMA models the d-times-differenced version of the original series using an ARMA(p,q) model.

For financial prices, d = 1 is almost universally sufficient. The log-price series is I(1), so log returns (first difference of log prices) are I(0) — stationary. There is almost never a need to use d = 2 on financial return data.

In practice: always use log prices, then take first differences (log returns). This gives d = 1. Do not over-difference — applying d = 2 to an already-stationary return series introduces artificial MA(1) structure into the residuals and inflates the model's complexity without benefit.