0bps

Learn / Track II / lesson 2 of 4

Stationarity and autocorrelation

Why you model returns rather than prices, how to test whether a series wanders or reverts, and what autocorrelation means for your P&L.

11 min read

Statistics learned on the past only tell you about the future if the process generating the data has not changed. A series whose statistical properties stay constant over time is called stationary.

Weak stationarity

A time series XtX_t is (weakly) stationary if

  1. its mean E[Xt]=μ\mathbb{E}[X_t] = \mu does not depend on tt,
  2. its variance is finite and constant, and
  3. its autocovariance Cov⁡(Xt,Xt−k)\operatorname{Cov}(X_t, X_{t-k}) depends only on the lag kk, not on tt.

Prices fail this: they drift and their variance grows with time. Returns are much closer to stationary, which is why almost all modelling is done on returns.

The random walk and the unit root

The simplest non-stationary model is a random walk, Pt=Pt−1+εtP_t = P_{t-1} + \varepsilon_t. More generally, consider

Xt=ϕXt−1+εtX_t = \phi X_{t-1} + \varepsilon_t

This is an AR(1) process. If ∣ϕ∣<1|\phi| < 1 the series is stationary and mean-reverting, with a long-run variance of σε2/(1−ϕ2)\sigma_\varepsilon^2/(1-\phi^2). If ϕ=1\phi = 1 it has a unit root: shocks never decay, and the series wanders like a price.

The Augmented Dickey–Fuller (ADF) test checks the null hypothesis ϕ=1\phi = 1. Rejecting it (a sufficiently negative test statistic) is evidence the series is mean-reverting. The test is the standard first step in pairs trading, applied to the spread between two assets.

Half-life of mean reversion

For a stationary AR(1), a deviation decays by a factor ϕ\phi each period. The time for half of it to disappear is

h=−ln⁡2ln⁡ϕh = -\frac{\ln 2}{\ln \phi}

A spread with ϕ=0.95\phi = 0.95 per day has a half-life of about 13.5 days. That number tells you how long trades will last, how often you’ll trade, and therefore whether costs will eat the edge.

Autocorrelation

The autocorrelation at lag kk is

ρk=Cov⁡(Xt,Xt−k)Var⁡(Xt)\rho_k = \frac{\operatorname{Cov}(X_t, X_{t-k})}{\operatorname{Var}(X_t)}

For returns, a positive ρ1\rho_1 means moves tend to continue (momentum); negative means they tend to reverse (mean reversion). Under the null of no autocorrelation, sample estimates have a standard error of roughly 1/T1/\sqrt{T}, so with 1,000 observations anything inside ±0.063\pm 0.063 is indistinguishable from noise at the usual 95% level.

Intuition

Raw returns of liquid assets show tiny autocorrelation, but their squared or absolute returns show strong, slowly decaying autocorrelation. Direction is hard to predict; volatility is not. That is the empirical fact behind volatility targeting and GARCH models.

Why it matters for your P&L

If your strategy’s daily returns are autocorrelated, the usual N\sqrt{N} annualisation is off. A useful correction for the variance of a qq-period sum is

Var⁡(∑t=1qrt)=q σ2(1+2∑k=1q−1(1−kq)ρk)\operatorname{Var}\Big(\sum_{t=1}^{q} r_t\Big) = q\,\sigma^2 \Big(1 + 2\sum_{k=1}^{q-1}\big(1 - \tfrac{k}{q}\big)\rho_k\Big)

Positive autocorrelation inflates long-horizon risk; negative autocorrelation (common in mean-reversion strategies) reduces it, which flatters the annualised Sharpe ratio.

Common mistake

Running a regression of one price on another and reading off a high R2R^2. Two independent random walks regularly produce “significant” regressions — the classic spurious regression. Regress returns, or test the residual for stationarity first.

Put it to work

esc

Try , , or .

↑↓ move↵ open