13A.7 The Ornstein–Uhlenbeck spread: estimation, half-life and precision
Motivation
Once a spread is judged stationary, a trader needs three numbers: the level it reverts to, how fast, and how noisy. The OU process supplies all three, and its estimation errors are larger than most backtests admit.
13A.7.1Model and exact discretisation#
Apply Itô to : . Integrate over :
The stochastic integral is Gaussian with mean zero and variance by the Itô isometry. This is M10 (10.18). So the sampled series is an exact Gaussian AR(1):
The stationary law is , and the stationary standard deviation equals . The half-life is (M10 (10.19)).
13A.7.2Maximum likelihood#
Proposition 13A.7exact conditional MLE
Given at spacing , the maximum-likelihood estimates conditional on are
where are OLS estimates from regressing on and , provided .
Proof
By (13A.23) the conditional log-likelihood is , maximised over by OLS and over by . The map of (13A.23) is a bijection from onto , and maximum likelihood is invariant under reparametrisation.∎
If there is no OU fit: the data are more consistent with a random walk or an explosive process. fit_ou raises an error in that case rather than return a negative . The exact (unconditional) likelihood adds the stationary density of ; the difference is negligible for long samples. The Euler approximation is the first-order expansion of ; it understates by a relative amount of about , which is tiny for daily data and slow spreads.
13A.7.3How precisely is known?#
Proposition 13A.8precision and bias of , first order
With observations spanning and small,
Proof
For a stationary AR(1), . The delta method on gives . With and : . For the bias, Kendall's approximation (M10 · 10.7.2) is , so .∎
So the precision depends on , the number of mean-reversion time units in the sample (about 1.44 times the number of half-lives observed), and not on the sampling frequency.
Worked example
A daily spread with and (log units), year:
- per year; half-life years trading days (the approximation gives 23.10);
- per ; stationary standard deviation , i.e. about 4.1%.
- With two years of data (), . By (13A.25) the relative standard error is about 36% and the upward bias about 26%. A simulation of 2,000 such samples (
m13a_ou.py, computed for this course) gives a mean of 1.27, a median of 1.20 and a standard deviation of 0.44. Inverting that sampling distribution, the point estimate "half-life 23 days" from two years of data is consistent with a true half-life from about 19 to 38 days (16th to 84th percentiles of the simulated , 4,000 draws) and from about 14 to 52 days at the 2.5th and 97.5th percentiles.
Practitioner notes
- Report the half-life with an interval. Bias-correct (M10 · 10.7.2) before converting to .
- A half-life of a few days estimated on intraday data from one month is not evidence of anything: is small whatever the number of bars.
- If the half-life exceeds the period you are willing to hold a losing trade, the spread is not tradeable for you, whatever the test says.