Quant Memo

Paper Explained

Finding Every Hidden Anchor at Once: Johansen's Cointegration Test

Engle and Granger could test whether two wandering series were tied together. Johansen showed how to find all the invisible ropes binding a whole basket of them, in one shot.

QM
Quant Memo

July 13, 2026

The paper

Statistical Analysis of Cointegration Vectors

Søren Johansen · 1988

Read the original →

Cointegration is one of the most commercially valuable ideas in all of econometrics. The insight is that two series can each wander aimlessly forever, and yet the gap between them can be perfectly well-behaved and mean-reverting. Two drunks staggering home, tied together by a rope. Individually unpredictable. Jointly, never more than a rope's length apart.

Engle and Granger gave us the first practical way to test for that rope between two series. But real markets are not made of pairs. They are made of yield curves with a dozen maturities, futures strips with twelve contract months, baskets of related commodities, and stocks in the same industry. In those settings, the obvious question is not "is there a rope?" but "how many ropes are there, and where are they?"

That is the question Søren Johansen answered in 1988, and the answer turned cointegration from a two-asset trick into a portfolio-level tool.

The problem: two-step testing does not scale, and it plays favourites

The Engle-Granger recipe is a two-step affair. Pick one series to be the dependent variable, regress it on the other, then test whether the leftover residual is stationary. It works. But it has two flaws that become fatal as soon as you add more than two series.

First, it forces you to pick a favourite. Regressing A on B and regressing B on A do not give you the same residual, and in finite samples they can give you different verdicts. With two series that is merely irritating. With ten series, you have a genuinely arbitrary choice with no defensible basis.

Second, and much worse, it can only find one rope. Suppose you have four maturities on a yield curve. There might well be three separate stable relationships hiding in there: several different spreads and butterflies that each mean-revert. A single regression can, by construction, produce only a single residual. It will find at most one relationship, and quite possibly a scrambled mixture of several, mistaken for one.

You need a method that treats all the series symmetrically and can tell you how many independent stable combinations exist.

The key idea via analogy: count the ropes before you describe them

Picture a group of five drunks staggering across a field. They are tied to each other by some unknown number of ropes. You cannot see the ropes. You can only watch them move.

If there are zero ropes, all five wander off in five different directions and you will eventually lose them all.

If there are four ropes (the maximum useful number here), they are so tightly bound that they effectively cannot wander at all. Every one of them is anchored.

The interesting cases are in between. Maybe there are two ropes: which would mean the group has two independent stable relationships and three genuinely independent directions of aimless drift. The drunks as a whole still wander, but in a lower-dimensional way than five free drunks would.

Johansen's insight is that the number of ropes is a countable, testable quantity, and it corresponds to a piece of linear algebra: the rank of a particular matrix that describes how the system pulls itself back together after a shock.

Here is the intuition without the algebra. Write down a model of how the whole system moves each period: today's changes depend on yesterday's levels. If the levels have no pull whatsoever, the coefficient block linking them to today's changes is effectively empty, and the system is pure drift. If the levels exert some pull, that block is not empty, and its rank counts exactly how many independent restoring forces exist. Rank two means two ropes. Rank zero means no cointegration at all.

Johansen's contribution was to work out how to estimate that structure by maximum likelihood, and to derive tests that let you march up the ladder: is the rank zero? If we reject that, is it at most one? At most two? You keep going until you cannot reject, and where you stop is your answer for the number of cointegrating relationships. Crucially, the same procedure hands you the actual combinations (the weights that define each stable spread), estimated jointly and without anyone being arbitrarily crowned the dependent variable.

Why it mattered

  • It made multi-asset statistical arbitrage possible on a rigorous footing. Yield curves, futures curves, related commodities, sector baskets: these are all systems where several stable relationships coexist. Johansen gives you all of them at once, with estimated weights ready to be turned into portfolio positions.
  • It removed the arbitrary normalisation. Every series is treated the same way. You are not silently making one asset the "explained" one and hoping the choice does not matter.
  • It gives you the error-correction structure for free. The same estimation tells you not just what the stable combinations are, but how fast each series is pulled back when the combination drifts away from equilibrium. For a trader, that speed is the difference between a spread that pays in a week and one that pays in a decade, which is to say the difference between a strategy and a hope.
  • It became the standard. In macroeconomics and in quant finance, "run Johansen" is the default when there are more than two series involved. The pairing of Johansen's tests with Engle-Granger's simpler check is now routine.

The honest limitations

Johansen's test is powerful, and its power is exactly what makes it dangerous in careless hands.

  • It is famously trigger-happy in small samples. With limited data, the test tends to find more cointegrating relationships than actually exist. If you hand it a basket of loosely related assets and a few years of data, it will very often report ropes that are not there. Those phantom ropes become phantom strategies, and phantom strategies lose real money.
  • The results are sensitive to specification choices. How many lags you include, whether you allow for a constant or a trend, and where you allow it, can all change the reported number of relationships. These choices are not obvious, and the test does not make them for you.
  • It assumes the relationships are constant. Cointegration means the rope has a fixed length. In markets, ropes fray. Central bank policy shifts, index rebalances, a company's business model changes. A relationship that was genuinely stable for five years can simply stop being stable, and the test, fitted on history, will not warn you.
  • Statistical significance is not tradeable significance. A relationship can be real, confirmed, robust, and still revert so slowly, or with such thin spreads, that no trader could ever profit from it after costs. The test says the rope exists. It does not say the rope is worth pulling.
  • It assumes linearity and Gaussian-ish behaviour. Real markets exhibit regime changes and fat tails. The relationship might hold in calm markets and shatter precisely when you need it to hold.

The one-line takeaway

Johansen showed that in a group of wandering series, the number of hidden stable relationships is a countable quantity you can test for directly, which turned cointegration from a two-asset curiosity into a tool for finding every mean-reverting combination in an entire basket at once, with all the opportunity and all the overfitting danger that implies.