Skip to main content

Cointegration: Hedge Ratio, Spread Z-Score and Half-Life

IntermediateQuantitative FinanceAlso known as: cointegration, Engle Granger, mean reversion of spread, half-life of mean reversion

Finds: whether a pair behaves like a stable spread and how fast it reverts.

When to use it: Use it to test whether two prices share a long-run link. Each price may wander, but if a mix of them is stable the pair is cointegrated and the gap tends to close. The half-life says how fast. A full test also needs a unit-root test on the spread (Engle-Granger), which this calculator does not run, so treat the result as a screen and not proof.

The formula

β\displaystyle \beta=Cov(Y,X)Var(X),  st=Yt−βXt−α,  st=ϕst−1+ε,  t1/2=−ln⁡2ln⁡ϕ\displaystyle =\frac{Cov(Y,X)}{Var(X)},\; s_{t}=Y_{t}-\beta X_{t}-\alpha,\; s_{t}=\phi s_{t-1}+\varepsilon,\; t_{1/2}=\frac{-\ln 2}{\ln\phi}

In words: Hedge ratio beta = Covariance(Y, X) / Variance(X); Spread = Y − beta x X − alpha; Fit spread today = phi x spread yesterday; Half-life = -ln 2 / ln(phi)

What each symbol means

Y, XTwo price series that may move togethermoney
betaHedge ratio from regressing Y on Xnumber
alphaIntercept of that regressionmoney
phiAutoregressive coefficient of the spread. Between 0 and 1 means it revertsnumber
t_1/2Half-life: periods for a gap to close by halfperiods

Worked example

Two price series of 30 observations each are given in the calculator. Regress Y on X, build the spread, find its latest z-score and the half-life.

Hedge ratio1.3940
Intercept14.7347
Spread series0.56, −0.32, −0.37, −0.77, −0.93, 0, −0.38, −0.05, 0.59, 0.12, 0.17, 0.35, 0.43, −0.41, −0.14, 0.90, −0.31, 0.33, 0.17, −0.39, 0.70, 0.84, −0.38, −0.32, −0, −0.26, −0.17, −0.41, −0.12, 0.55
Latest z-score1.181
phi0.1321
Half-life−ln(2) ÷ ln(0.132143)0.34
The answer

The hedge ratio is 1.3940 and the intercept is 14.7347. The latest spread sits 1.181 standard deviations from its mean. The spread's persistence is 0.1321, so a gap closes by half in 0.34 periods.

Want every formula on a few pages?Get the free Cheat Sheet (PDF) →

Calculator

Hedge ratio1.3940
Latest z-score1.181
phi0.1321
Half-life0.34

Keep going