13A.2 Unit roots and the Dickey–Fuller test
Motivation
Every mean-reversion trade rests on one claim: the spread is stationary. The natural test is to fit an AR(1) and check whether the coefficient is below one. The difficulty is that under the null hypothesis of a unit root the usual asymptotics fail. M10 · 10.7.2 quoted the result; here it is derived.
13A.2.1The regression form#
Start from
Subtract :
(unit root; shocks are permanent; no mean reversion). (stationary; shocks decay at rate per period). The test is one-sided: is an explosive process, not a stationary one. OLS gives
13A.2.2The limiting distribution#
Proposition 13A.1Dickey–Fuller, no deterministic terms
Under ,
Proof
Under , .
Numerator. Square : . Sum from 1 to ; the terms telescope:
Divide by . By the CLT , and by the LLN . So .
Denominator. Define the step function on . The functional CLT (Donsker) gives in . Since is constant on , . The map is continuous, so .
Jointly. Both limits are functionals of the same (the numerator is ), so they converge jointly and the continuous mapping theorem applies to the ratio:
The -ratio. with , so , which converges to the second expression.∎
Three consequences a trader should know.
- The rate is , not . is "superconsistent" under a unit root. The statistic collapses to zero, so the usual normal approximation is useless.
- The distribution is skewed left. . Even for a pure random walk, about two thirds of samples show "mean reversion" (). (Simulated with : 0.686.) This is the same downward bias that M10 · 10.7.2 corrected with Kendall's formula.
- Using over-rejects. The 5% quantile of is about with no constant and with a constant, not .
Deterministic terms With a constant in (13A.2) the regressor is effectively demeaned and is replaced by the demeaned Brownian motion (M10 · 10.7.2). With a constant and a linear trend, is replaced by the residual of its projection on . The proofs are identical after projecting out the deterministic regressors (Hamilton 1994, 17.4). The distribution changes each time:
| Regression | 1% | 5% | 10% | Simulated, , 20,000 draws (1%, 5%, 10%) |
|---|---|---|---|---|
No constant (n) |
−2.57 | −1.94 | −1.62 | −2.55, −1.95, −1.62 |
Constant (c) |
−3.43 | −2.86 | −2.57 | −3.46, −2.89, −2.57 |
Constant and trend (ct) |
−3.96 | −3.41 | −3.13 | −3.96, −3.42, −3.14 |
The first three columns are MacKinnon's asymptotic values, as used by statsmodels.tsa.stattools.adfuller; the last column is computed by simulate_df_quantiles in m13a_adf.py.
Which case for a spread? A spread has an unknown non-zero mean, so use a constant. The no-constant case is only for series whose mean is zero by construction (the Engle–Granger residual, 13A.5). The trend case answers a different question: "is the spread stationary around a trend?" A trend-stationary spread is not something you can trade by betting on a return to a fixed level.
13A.2.3Augmentation#
Daily spreads rarely follow an AR(1) exactly. If the true model is AR(), the residual in (13A.2) is serially correlated and the DF distribution no longer applies. The fix is to add lagged differences.
Proposition 13A.2ADF form
The AR() can be written
where . The process has a unit root () if and only if .
Proof
For , (telescoping). Substitute:
Swap the order of summation over the triangle : . Subtract from both sides. The coefficient of is , and is a root of iff this is zero.∎
With deterministic terms, the ADF regression actually run is
dropping or as the case requires. Under and with the other roots of outside the unit circle, is a stationary AR(), the coefficients are asymptotically normal, and the -ratio on has the same DF limit as before. Said and Dickey (1984) extend this to ARMA errors by letting grow with (at rate or slower). In practice choose by AIC or BIC, or by testing down from a generous maximum; adfuller(autolag="AIC") does the former.
Exercise link m13a_adf.py builds (13A.7) by hand and must match adfuller(maxlag=p, autolag=None) to for all three trend cases and several .
13A.2.4Power, and why more data is not always more information#
Unit-root tests have low power against near-unit-root alternatives. The useful way to see it: under an OU alternative sampled every , , and the information about grows with the span of the data, not with . Sampling a five-year spread every minute instead of every day gives many more observations with closer to one and almost no extra power (Shiller and Perron 1985). 13A.7 makes this precise: the relative standard error of is about .
A complementary test reverses the null. KPSS (Kwiatkowski, Phillips, Schmidt and Shin 1992) tests : stationary. Reporting both is good practice: "ADF does not reject a unit root and KPSS rejects stationarity" is a much stronger statement than either alone.
Practitioner notes
- A spread that "passes" ADF at 5% in one window and fails in the next is the normal case, not an anomaly. Low power plus parameter drift guarantees it. 13A.12 shows this for Indian pairs.
- Run the test on the spread you would actually trade, with the hedge ratio fixed before the test window, or use the Engle–Granger critical values of 13A.5. Estimating and then applying DF critical values over-rejects.
- Do not test price levels of a single stock for mean reversion and expect anything but a unit root. The question is always about a combination.