Unit 13, lesson 102

Cointegration and statistical arbitrage

What integration order and cointegration mean, how a common trend cancels in a stationary spread, how an autoregressive spread gives an error-correction relation, and why statistical arbitrage is not arbitrage.

  • Video 102
  • Validation, multiple testing and cointegration

Two related stocks have log prices that wander far from their starting levels over the years, yet one particular combination of the two keeps returning to the same band. Is that combination a dependable source of profit, and what exactly does a statistical model of it say? This lesson fixes a convention for the order of integration, builds two nonstationary series whose common trend cancels in one combination, derives the error-correction relation of an autoregressive spread together with its forecast moments, and separates the stationary spread from any trading guarantee.

Key terms

Integration order

Definition Dates are integers. A process is integrated of order zero, written I(0), if it is covariance stationary with an autocovariance function γ\gamma that satisfies ∑h∣γ(h)∣<∞\sum_{h} \lvert \gamma(h) \rvert < \infty and has positive long-run variance

ω2=∑h=−∞∞γ(h)>0.\omega^2 = \sum_{h=-\infty}^{\infty} \gamma(h) > 0 .

Under the summability condition, nVar⁡(xˉn)→ω2n \operatorname{Var}(\bar x_n) \to \omega^2 for the mean xˉn\bar x_n of nn consecutive values, which is why ω2\omega^2 is called the long-run variance. A process XX is integrated of order one, I(1), if its first difference ΔXt=Xt−Xt−1\Delta X_t = X_t - X_{t-1} is I(0), and more generally I(dd) if dd differences give an I(0) process. The positive long-run variance makes the order unique. The difference of an I(0) process has autocovariances 2γ(h)−γ(h−1)−γ(h+1)2\gamma(h) - \gamma(h - 1) - \gamma(h + 1), whose sum is 00, so it is not I(0), and in particular the level of an I(1) process is not I(0). These conditions fix the short-memory meaning used in this lesson, and other texts use other conventions.

In plain words An I(0) series fluctuates around a fixed mean with dependence that dies out fast enough for averages to settle. An I(1) series wanders like a random walk, while its changes are I(0). Differencing a series that was already I(0) does not give another I(0) series under this convention.

Example A random walk Zt=Zt−1+ηtZ_t = Z_{t-1} + \eta_t with independent, identically distributed increments of mean 00 and variance ση2>0\sigma_\eta^2 > 0 is I(1), since ΔZt=ηt\Delta Z_t = \eta_t has long-run variance ση2\sigma_\eta^2. Started at Z0=0Z_0 = 0 it has Var⁡(Zt)=t ση2\operatorname{Var}(Z_t) = t\,\sigma_\eta^2. White noise ete_t with variance σe2>0\sigma_e^2 > 0 is I(0), but its difference has autocovariances 2σe22\sigma_e^2 at lag 00 and −σe2-\sigma_e^2 at lags ±1\pm 1, with sum 00, so ee is not I(1). An AR(1) process zt=ρzt−1+utz_t = \rho z_{t-1} + u_t with ∣ρ∣<1\lvert \rho \rvert < 1 and white noise innovations of variance σu2>0\sigma_u^2 > 0 is I(0) with long-run variance σu2/(1−ρ)2\sigma_u^2/(1 - \rho)^2. For ρ=0.8\rho = 0.8 and σu2=0.04\sigma_u^2 = 0.04 its variance is 1/91/9 and its long-run variance is 11.

Common trend

Definition A common trend is an I(1) component shared by several series. In the first constructed model of this lesson, ZZ is a random walk started at Z0=0Z_0 = 0 with independent, identically distributed increments ηt\eta_t of mean 00 and variance ση2>0\sigma_\eta^2 > 0, and (et)(e_t) and (vt)(v_t) are independent, identically distributed sequences with mean 00 and variances σe2>0\sigma_e^2 > 0 and σv2>0\sigma_v^2 > 0, the three sequences being mutually independent. The log series are

Xt=Zt+et,Yt=2Zt+vt.\begin{gathered} X_t = Z_t + e_t, \\[0.4em] Y_t = 2Z_t + v_t . \end{gathered}

Both carry the trend ZZ, with loadings 11 and 22, and Var⁡(Xt)=t ση2+σe2\operatorname{Var}(X_t) = t\,\sigma_\eta^2 + \sigma_e^2 and Var⁡(Yt)=4t ση2+σv2\operatorname{Var}(Y_t) = 4t\,\sigma_\eta^2 + \sigma_v^2 grow linearly in tt, so neither level is covariance stationary. The difference ΔXt=ηt+et−et−1\Delta X_t = \eta_t + e_t - e_{t-1} has γ(0)=ση2+2σe2\gamma(0) = \sigma_\eta^2 + 2\sigma_e^2, γ(±1)=−σe2\gamma(\pm 1) = -\sigma_e^2 and γ(h)=0\gamma(h) = 0 for ∣h∣≥2\lvert h \rvert \ge 2, so its long-run variance is ση2>0\sigma_\eta^2 > 0, and in the same way ΔYt\Delta Y_t has long-run variance 4ση24\sigma_\eta^2. Both XX and YY are therefore I(1). Systems of more series can have several common trends and several independent cointegrating relations, and in the standard representation of a linear I(1) system of kk series with rr independent cointegrating vectors there are k−rk - r common trends. That representation is further study.

In plain words One random walk drives both series, so both wander, and they wander in a fixed proportion. The extra noise in each series is short-lived and does not stop the wandering.

Example Take the constructed values ση2=0.0004\sigma_\eta^2 = 0.0004, σe2=0.01\sigma_e^2 = 0.01 and σv2=0.04\sigma_v^2 = 0.04 in squared log units. After 250250 periods, Var⁡(X250)=0.1+0.01=0.11\operatorname{Var}(X_{250}) = 0.1 + 0.01 = 0.11 and Var⁡(Y250)=0.4+0.04=0.44\operatorname{Var}(Y_{250}) = 0.4 + 0.04 = 0.44, and both keep growing. The difference of XX has γ(0)=0.0204\gamma(0) = 0.0204 and lag-one autocovariances −0.01-0.01 from the shared noise terms, and these cancel the extra 2σe2=0.022\sigma_e^2 = 0.02 when the autocovariances are summed, which leaves the long-run variance ση2=0.0004\sigma_\eta^2 = 0.0004.

Cointegration

Definition Two I(1) series XX and YY are cointegrated if some nonzero vector (a,b)(a, b) makes aXt+bYtaX_t + bY_t an I(0) process. Such a vector is a cointegrating vector. It is defined only up to a nonzero factor, and a normalization such as b=1b = 1 fixes it. In the common-trend model,

Yt−2Xt=2Zt+vt−2(Zt+et)=vt−2et,\begin{aligned} Y_t - 2X_t &= 2Z_t + v_t \\[0.4em] &\quad - 2(Z_t + e_t) \\[0.4em] &= v_t - 2e_t , \end{aligned}

an independent, identically distributed sequence, hence I(0), with variance σv2+4σe2\sigma_v^2 + 4\sigma_e^2 by independence. So (−2,1)(-2, 1) is a cointegrating vector, and up to a factor it is the only one. Indeed aXt+bYt=(a+2b)Zt+aet+bvtaX_t + bY_t = (a + 2b)Z_t + a e_t + b v_t, and when a+2b≠0a + 2b \ne 0 its difference has long-run variance (a+2b)2ση2>0(a + 2b)^2\sigma_\eta^2 > 0, so the combination is I(1). Cointegration is a statement about the levels and their stochastic trend. A high sample correlation of two levels does not establish it, and two independent random walks, which are not cointegrated, have a sample correlation of levels that does not settle at zero as the sample grows.

In plain words Each series wanders, but one weighted difference of them does not, because its weights cancel the shared trend exactly. The weights belong to the model. With market data they have to be estimated.

Example With σv2=0.04\sigma_v^2 = 0.04 and σe2=0.01\sigma_e^2 = 0.01, the spread Y−2XY - 2X has variance 0.04+4⋅0.01=0.080.04 + 4 \cdot 0.01 = 0.08 at every date, while the variances of the levels grow without bound. The factor 22 enters the variance squared, so 0.04+2⋅0.01=0.060.04 + 2 \cdot 0.01 = 0.06 would be wrong. For contrast, in a simulation of 10,00010{,}000 pairs of independent random walks with standard normal increments and 1,0001{,}000 steps each, the absolute sample correlation of the levels exceeded 0.50.5 in about 4040 percent of the pairs.

Stationary spread

Definition In a second constructed model, XX is a random walk of log prices with independent, identically distributed increments of positive, finite variance, Yt=2Xt+ztY_t = 2X_t + z_t, and the spread follows

zt=ρzt−1+ut,∣ρ∣<1.\begin{gathered} z_t = \rho z_{t-1} + u_t , \\[0.4em] \lvert \rho \rvert < 1 . \end{gathered}

The innovations utu_t are independent and identically distributed with mean 00 and variance σu2>0\sigma_u^2 > 0, and the whole sequence (ut)(u_t) is independent of XX. Let Ft\mathcal{F}_t be the information generated by XsX_s and YsY_s for s≤ts \le t, so that zt=Yt−2Xtz_t = Y_t - 2X_t is known at tt and utu_t is independent of Ft−1\mathcal{F}_{t-1}. The stationary solution is

zt=∑j=0∞ρjut−j,z_t = \sum_{j=0}^{\infty} \rho^j u_{t-j} ,

which converges in mean square because σu2∑jρ2j<∞\sigma_u^2 \sum_j \rho^{2j} < \infty, and its variance is

σˉz2=σu21−ρ2.\bar\sigma_z^2 = \frac{\sigma_u^2}{1 - \rho^2} .

The spread is I(0), and ΔYt=2 ΔXt+Δzt\Delta Y_t = 2\,\Delta X_t + \Delta z_t has long-run variance 4Var⁡(ΔXt)>04\operatorname{Var}(\Delta X_t) > 0, so XX and YY are I(1) and cointegrated with the vector (−2,1)(-2, 1). For a horizon h≥1h \ge 1, the forecast and its conditional variance are

E[zt+h∣Ft]=ρhzt,Var⁡(zt+h∣Ft)=σu2∑j=0h−1ρ2j=σˉz2(1−ρ2h).\begin{aligned} &\mathbb{E}[z_{t+h} \mid \mathcal{F}_t] = \rho^h z_t , \\[0.4em] &\operatorname{Var}(z_{t+h} \mid \mathcal{F}_t) \\[0.4em] &\quad = \sigma_u^2 \sum_{j=0}^{h-1}\rho^{2j} \\[0.4em] &\quad = \bar\sigma_z^2\bigl(1 - \rho^{2h}\bigr) . \end{aligned}

When ρ≠0\rho \ne 0 the conditional variance is below σˉz2\bar\sigma_z^2 for every hh and approaches it as hh grows. At ρ=1\rho = 1 the spread is a random walk, the denominator 1−ρ21 - \rho^2 vanishes and no stationary solution exists.

In plain words Each period the spread keeps the fraction ρ\rho of its current value and receives a fresh shock. Old shocks fade, so its variance stays finite, and a forecast from a known current value is pulled toward zero while its uncertainty grows toward the stationary variance.

Example Take the constructed values ρ=0.8\rho = 0.8 and σu2=0.04\sigma_u^2 = 0.04. The stationary variance is 0.04/0.36=1/9≈0.11110.04/0.36 = 1/9 \approx 0.1111. From z0=1z_0 = 1, the ten-step forecast is 0.810≈0.1073740.8^{10} \approx 0.107374 with conditional variance

19(1−0.820)≈0.109830,\tfrac19\bigl(1 - 0.8^{20}\bigr) \approx 0.109830 ,

slightly below 1/91/9. If the innovations are moreover normal, so that u1u_1 has standard deviation 0.20.2, the next spread exceeds the current value 11 exactly when u1>0.2u_1 > 0.2, which has probability 1−Φ(1)≈0.15871 - \Phi(1) \approx 0.1587. A mean-reverting spread can move further away in the next step.

Error correction

Definition In the stationary-spread model, subtract the level identity Yt−1=2Xt−1+zt−1Y_{t-1} = 2X_{t-1} + z_{t-1} from Yt=2Xt+ztY_t = 2X_t + z_t, and subtract zt−1z_{t-1} from both sides of the spread recursion, which gives Δzt=(ρ−1)zt−1+ut\Delta z_t = (\rho - 1)z_{t-1} + u_t. Replacing zt−1z_{t-1} by Yt−1−2Xt−1Y_{t-1} - 2X_{t-1} gives the error-correction relation

ΔYt=2 ΔXt+(ρ−1)(Yt−1−2Xt−1)+ut.\begin{aligned} &\Delta Y_t = 2\,\Delta X_t \\[0.4em] &\quad + (\rho - 1)(Y_{t-1} - 2X_{t-1}) \\[0.4em] &\quad + u_t . \end{aligned}

The coefficient ρ−1\rho - 1 of the lagged deviation is the adjustment coefficient, and ∣ρ∣<1\lvert \rho \rvert < 1 means it lies strictly between −2-2 and 00. The relation follows from the two identities alone, with no separate assumption that prices move toward each other. Because utu_t has mean 00 and is independent of Ft−1\mathcal{F}_{t-1} and ΔXt\Delta X_t together,

E[ΔYt∣Ft−1,ΔXt]=2 ΔXt+(ρ−1) zt−1.\begin{aligned} &\mathbb{E}[\Delta Y_t \mid \mathcal{F}_{t-1}, \Delta X_t] \\[0.4em] &= 2\,\Delta X_t + (\rho - 1)\,z_{t-1} . \end{aligned}

When zt−1>0z_{t-1} > 0 the expected change of the spread is negative, and when zt−1<0z_{t-1} < 0 it is positive. For −1<ρ<0-1 < \rho < 0 the expected next spread ρzt−1\rho z_{t-1} also has the opposite sign, so the correction overshoots. A realized innovation can still push the spread further from zero. In larger systems the link between cointegration and error correction is the Granger representation theorem, which is further study.

In plain words Each period the spread is expected to close the fraction 1−ρ1 - \rho of its current gap. The level YY moves by twice the move of XX, plus that expected correction, plus a new shock, so correction describes conditional means, not a guaranteed path.

Example Take ρ=0.8\rho = 0.8 and z0=1z_0 = 1, and suppose the next period brings ΔX1=0.05\Delta X_1 = 0.05 and u1=0.1u_1 = 0.1. The relation gives

ΔY1=0.1−0.2+0.1=0,\begin{aligned} \Delta Y_1 &= 0.1 - 0.2 + 0.1 \\[0.4em] &= 0 , \end{aligned}

so the spread changes by ΔY1−2 ΔX1=−0.1\Delta Y_1 - 2\,\Delta X_1 = -0.1 and z1=0.9z_1 = 0.9. Before u1u_1 was seen, the expected spread was 0.80.8, and the gap between the realized 0.90.9 and the forecast 0.80.8 is exactly the innovation.

Statistical arbitrage

Definition Statistical arbitrage is a name for trading strategies whose expected profit rests on a statistical model, for example positions that bet on a stationary spread moving back toward its mean. It is not an arbitrage in the pricing sense, which needs zero or negative initial cost, a nonnegative payoff in every state and a positive payoff with positive probability, because a spread position can lose money. Assessing such a strategy takes its wealth process, built from holdings in shares of instruments with currency prices PtXP^X_t and PtYP^Y_t, a cash account with its financing, rebalancing that satisfies the self-financing condition, and costs and margin. A coefficient in a relation between log prices is not a number of shares. With Xt=ln⁡PtXX_t = \ln P^X_t and Yt=ln⁡PtYY_t = \ln P^Y_t, a position short one currency unit of the second instrument and long two currency units of the first, rebalanced to these values every period, earns over one period, before dividends, financing and costs,

−(eΔYt−1)+2(eΔXt−1)≈−(ΔYt−2 ΔXt)=−Δzt,\begin{aligned} &-(e^{\Delta Y_t} - 1) + 2(e^{\Delta X_t} - 1) \\[0.4em] &\approx -(\Delta Y_t - 2\,\Delta X_t) = -\Delta z_t , \end{aligned}

where the approximation is the first-order Taylor expansion of the exponential. The exact result depends on both log changes, not only on the spread.

In plain words A stationary spread is a model statement about a combination of log prices. Money is made or lost by actual positions in actual instruments, which can move against the trade, cost money to trade and hold, and need financing.

Example In the update of the previous card, ΔX1=0.05\Delta X_1 = 0.05 and ΔY1=0\Delta Y_1 = 0, so the spread fell by 0.10.1. The short-spread position earns 2(e0.05−1)≈0.10252(e^{0.05} - 1) \approx 0.1025 per currency unit of the short leg before dividends, financing and costs, not exactly 0.10.1. Losses are possible as well. If the innovations are normal and independent of XX, then for every value of ΔX1\Delta X_1 a large enough innovation makes the one-period result negative, so the position loses with positive probability and is not an arbitrage.

Check yourself

  1. A constructed spread follows zt=0.5 zt−1+utz_t = 0.5\,z_{t-1} + u_t with independent, identically distributed innovations of mean 00 and variance 0.030.03. Find the stationary variance. The spread is 0.40.4 today. Find the two-step forecast and its conditional variance.
Show the answer

Since ∣0.5∣<1\lvert 0.5 \rvert < 1, the stationary variance is

0.031−0.25=0.04.\frac{0.03}{1 - 0.25} = 0.04 .

The two-step forecast is 0.52⋅0.4=0.10.5^2 \cdot 0.4 = 0.1. The conditional variance adds the two future shocks with weights 11 and 0.520.5^2, so it is 0.03 (1+0.25)=0.03750.03\,(1 + 0.25) = 0.0375, which agrees with 0.04 (1−0.54)=0.03750.04\,(1 - 0.5^4) = 0.0375 and lies below the stationary variance 0.040.04.

  1. In a constructed model Xt=Zt+etX_t = Z_t + e_t and Yt=3Zt+vtY_t = 3Z_t + v_t, where ZZ is a random walk and the noises are independent of each other and of ZZ, with variances σe2=0.02\sigma_e^2 = 0.02 and σv2=0.05\sigma_v^2 = 0.05. A colleague argues that Y−XY - X is stationary because both series share ZZ. Find the cointegrating combination with coefficient 11 on YY and its variance, and check the colleague’s claim.
Show the answer

The trend cancels when the coefficient of XX is −3-3, since

Yt−3Xt=3Zt+vt−3Zt−3et=vt−3et.\begin{aligned} Y_t - 3X_t &= 3Z_t + v_t \\[0.4em] &\quad - 3Z_t - 3e_t \\[0.4em] &= v_t - 3e_t . \end{aligned}

Its variance is 0.05+9⋅0.02=0.230.05 + 9 \cdot 0.02 = 0.23, because the factor 33 enters squared. Using 0.05+3⋅0.02=0.110.05 + 3 \cdot 0.02 = 0.11 is a common mistake. The colleague’s combination is Yt−Xt=2Zt+vt−etY_t - X_t = 2Z_t + v_t - e_t, which keeps twice the random walk, so its variance grows linearly in time and it is I(1), not stationary. Sharing a trend is not enough. The weights have to match the loadings.

  1. An estimated spread model has ρ=−0.5\rho = -0.5. What is the adjustment coefficient in the error-correction relation, and what are the expected change and the expected value of the next spread when the current spread is 0.40.4? Is this spread stationary? What changes if instead ρ=1\rho = 1?
Show the answer

The adjustment coefficient is ρ−1=−1.5\rho - 1 = -1.5. The expected change is −1.5⋅0.4=−0.6-1.5 \cdot 0.4 = -0.6, so the expected next spread is 0.4−0.6=−0.2=ρ⋅0.40.4 - 0.6 = -0.2 = \rho \cdot 0.4. The correction overshoots and changes the sign of the expected spread, yet the spread is stationary because ∣ρ∣=0.5<1\lvert \rho \rvert = 0.5 < 1, with stationary variance σu2/(1−0.25)\sigma_u^2/(1 - 0.25). At ρ=1\rho = 1 the adjustment coefficient is 00, so the error-correction term disappears and the spread is a random walk. Its variance given a starting value equals t σu2t\,\sigma_u^2 after tt periods, the formula σu2/(1−ρ2)\sigma_u^2/(1 - \rho^2) has a zero denominator, and with innovations independent of XX the two series are not cointegrated at all, so the model gives no basis for expecting the spread to return.

How this lesson connects