Correlation measures how strongly two variables move together over a specified sample and frequency.
Cointegration asks whether a fixed
linear combination of non-stationary series is stationary. In pairs research, high return correlation can help screen candidates. Cointegration provides a different input by suggesting that a fitted spread has stable long-run statistical properties.
Build two highly correlated series whose spread still wanders
Let
Ut,
Vt and
Wt be independent random walks, each driven by independent mean-zero increments with unit
variance. Define
Xt=Ut+cVt,Yt=Ut+cWt,
where
c>0. The
covariance of
ΔXt and
ΔYt is one and each has variance
1+c2, so their return correlation is
1/(1+c2). For
c=0.2 that is about 0.962. For any hedge coefficient
b, however,
Xt−bYt=(1−b)Ut+cVt−bcWt.
Because the three walks are independent, its variance is
t[(1−b)2+c2+b2c2], which grows with
t for every
b. No hedge coefficient cancels every
stochastic trend.
Now use Xt=Ut and Yt=1.3Ut+et, where et is a stationary AR(1) process independent of Ut. The spread Yt−1.3Xt=et is stationary even though both price series are I(1). Large transitory shocks in et can reduce daily return correlation while leaving the long-run relationship intact.
In the independent-random-walk construction, any linear combination Xt−bYt includes cVt and −bcWt. Since these innovations are independent, their variances add and cannot cancel each other. With c>0, at least one permanent component remains even when b cancels the shared walk. As c gets small, the return correlation approaches one. The remaining permanent component can be small and still accumulate with the horizon. That is enough to break the inference from high correlation to a reliable spread anchor.
In the stationary-residual case, the expected residual after k steps is 0.7ket. This follows by applying the one-step conditional expectation repeatedly and dropping each new innovation because its conditional mean is zero. A residual starting at 0.05 is expected to reach half that size after roughly log(0.5)/log(0.7)=1.94 periods. That is a description of conditional decay under this fitted equation. It gives you a holding-period hypothesis to test against spreads and borrowing costs before it gives you a trade.
How a stationary spread changes the question
Suppose the second model has
et=0.7et−1+ηt with mean-zero innovations. If today's residual is 0.05, the conditional expected residual three days later is
0.73(0.05)≈0.017. The expected reduction is about 0.033 log units. This gives a candidate direction and a holding-period hypothesis for a convergence trade. A
backtest still needs to test entry and exit timing, adverse moves, parameter stability, and costs of trading the two legs. A stationary spread can be slow to revert relative to funding costs, and historical
stationarity can fail when the economic relationship changes.
Simulate common and idiosyncratic trends
import numpy as np
rng = np.random.default_rng(12)
u, v, w = rng.normal(size=(3, 2_000))
x, y = np.cumsum(u + 0.2 * v), np.cumsum(u + 0.2 * w)
print("Return correlation:", np.corrcoef(np.diff(x), np.diff(y))[0, 1])
print("Spread change volatility:", np.diff(x - y).std())
The first printed statistic will typically be close to the theoretical correlation. The derived variance formula explains why the resulting spread level can drift over longer horizons.