Quant Memo
Core

Pair Selection and Multiple Testing

Testing thousands of stock pairs for cointegration will find plenty that pass by pure chance — pair selection has to correct for how many tests were run, not just how good the best result looks.

Prerequisites: Cointegration

Take 500 stocks, form every possible pair, and test each one for cointegration at the usual 5% significance level. There are roughly 125,000 pairs. Even if not a single one is genuinely cointegrated, about 5% of them — over 6,000 pairs — will pass the test purely by chance. Picking the "best" ones from a screen like that isn't finding real relationships; it's cherry-picking noise.

Running one statistical test at a 5% significance level means a 5% chance of a false positive. Running 10,000 tests and only reporting the passes means expecting hundreds of false positives, even with no real signal anywhere in the data. Pair selection has to account for how many pairs were screened, not treat each result in isolation.

Why the naive approach fails

A single cointegration test controls the chance of a false positive for that one test. It says nothing about the chance of at least one false positive across a whole universe of tests, and that chance grows fast: testing nn independent pairs at significance level α\alpha, the probability of at least one spurious pass is roughly 1(1α)n1 - (1-\alpha)^n, which is already over 99% once nn exceeds a few hundred. A desk that screens thousands of pairs and trades the twenty with the lowest p-values is, without correction, mostly trading statistical noise dressed up as an edge.

pairs tested 100 1,000 10,000 50,000 expected false positives at 5% significance
The number of chance passes scales with how many pairs you screen, not with how real your average result looks.

Worked example

A desk screens 20,000 pairs and finds 1,050 pass a cointegration test at the standard 5% level. At 5% significance with no real signal at all, chance alone predicts about 20,000×0.05=1,00020{,}000 \times 0.05 = 1{,}000 false positives — meaning the 1,050 "hits" are statistically indistinguishable from pure noise. Applying a Bonferroni correction — dividing the significance threshold by the number of tests, 0.05/20,000=0.00000250.05 / 20{,}000 = 0.0000025 — and re-checking which pairs still clear that far stricter bar leaves perhaps a handful of genuinely surprising results, the ones actually worth investigating economically.

What this means in practice

The practical fix is two-layered: apply a multiple-testing correction (Bonferroni is conservative but simple; a false-discovery-rate procedure is less punishing and more common in practice) to decide which statistical results survive scrutiny, and separately require an economic story — a real shared business link — for any pair before trading it, since statistics alone cannot distinguish a lucky pair from a true one.

Re-running a screen after seeing the results, tweaking the universe or lookback window until more pairs "pass," reintroduces exactly the same problem in a sneakier form: each adjustment is an implicit additional test, whether or not you count it as one.

Related concepts

Practice in interviews

Further reading

  • Harvey, Liu & Zhu, '... and the Cross-Section of Expected Returns', Review of Financial Studies (2016)
ShareTwitterLinkedIn