Back to Research
Statistical Arbitrage September 17, 2026 • 11 min read

Trend or Noise? The Variance-Ratio Test for Random Walks

Every range-bound market has a chorus calling the breakout — and most breakouts in a chop are noise. The variance-ratio test (Lo-MacKinlay 1988) answers the real question with a number and a confidence level: is this a trend, mean reversion, or just a random walk?

Every range-bound market comes with a chorus. Price grinds sideways, and under every candle a hundred traders call the breakout — long the highs, short the lows, certain that this is the move. Most of the time it isn't. In a chop, the majority of "breakouts" are noise: the price is not trending, it is random-walking, and the fees paid to chase moves that were never there are how good traders bleed out in a bad tape. The useful question is not "which way?" but "is there a way at all?" — and that one has a statistical answer.

1. The random-walk null

A random walk has a signature you can check. If successive returns are unpredictable, then variance grows linearly with the horizon: the variance of a two-day move is exactly twice the variance of a one-day move, a q-day move exactly q times. Any departure from that linear scaling is memory — the returns are not independent. That is the whole idea behind the variance ratio: compare the variance at a longer horizon to what a random walk would imply, and read the difference.

2. The variance ratio

Formally, the variance ratio at horizon q is the variance of q-period returns divided by q times the one-period variance:

VR(q) = σ²(q) / ( q · σ²(1) )

Under a random walk VR(q) = 1. Above 1, long-horizon moves are more variable than independence allows — returns reinforce each other, the mark of positive autocorrelation and trending / momentum. Below 1, long-horizon moves are less variable — moves partly cancel, the mark of mean reversion. The ratio is a direct read on which regime the tape is in. Our descriptive variance-ratio measure reports exactly this number.

3. From a number to a test

A ratio of 0.9 is not automatically mean reversion — on a short, noisy sample it could be a random walk that happened to look that way. Lo & MacKinlay (1988), in "Stock Market Prices Do Not Follow Random Walks," supply the missing piece: a standard error, so you can ask whether VR(q) is far enough from 1 to reject chance. The standardized statistic

z(q) = √n · (VR(q) − 1) / √θ(q)

is asymptotically standard normal under the null, which turns the ratio into a proper hypothesis test with a p-value. A small p-value rejects the random walk; the side of the ratio then tells you momentum (>1) or mean reversion (<1).

4. The robust version is the one that matters

There are two forms of the variance θ. The simple one assumes constant volatility — a poor assumption in any real market, and a disastrous one in crypto, where volatility clusters violently. On such data the naive test throws false rejections: it mistakes changing variance for predictable returns. The heteroskedasticity-robust form corrects for exactly that, so a rejection reflects genuine serial dependence rather than a volatility regime change. On live returns, trust the robust statistic; the homoskedastic one is a teaching aid.

5. Reading it honestly

The test tells you about the sample and horizon you fed it, nothing more. A market can be a random walk at a daily horizon and mean-reverting intraday; regime can change next week. It is a diagnostic, not a promise — but as a diagnostic it is exactly the right tool for the "is this a trend or just noise?" question, replacing a gut call with a number and a confidence level. In a sideways market, knowing you are in a random walk is itself a tradable conclusion: it says stop paying to chase breakouts. We framed that case for a trading audience in a note on telling trend from noise.

6. Computing it

Our open-source orderflow-metrics library ships the full Lo-MacKinlay test, dependency-free, in TypeScript and Python — the ratio, both z-statistics, and their p-values in one call:

import { varianceRatioTest } from "orderflow-metrics";

// a sideways, mean-reverting return series
const returns = [0.012,-0.008,0.005,-0.021,0.015,0.004,-0.011,0.02,-0.006,0.009,
                 0.001,-0.014,0.017,-0.003,0.006,0.011,-0.032,0.007,0.002,-0.01];

varianceRatioTest(returns, 2);
// { ratio: 0.492, zStatistic: -2.272, robustZStatistic: -2.633, ... robustPValue: 0.0085 }
// VR < 1 and the robust p-value rejects the random walk → mean reversion, not chance

Here the ratio of 0.49 and a robust p-value of 0.0085 say this series is genuinely mean-reverting, not a random walk that got lucky. The Python distribution exposes the same function (variance_ratio_test). It sits beside the mean-reversion and Hurst exponent regime diagnostics in the wider market-microstructure toolkit — install from our open-source page (npm and PyPI, MIT-licensed).

7. Conclusion

Before you pick a direction, ask whether the market has one. The variance-ratio test answers that with a single number and a confidence level: near 1 is a random walk (fade the breakouts), above 1 is momentum (follow), below 1 is mean reversion (fade the extremes) — with the robust version keeping volatility clusters from faking a signal. Trade the regime you can measure, not the one you hope for. Explore the rest of the toolkit in our quantitative research library, or read the implementation in our open-source metrics.

For more on market efficiency, regime diagnostics, and open-source tooling, visit our official resources:

🧩 Open Source 💻 orderflow-metrics on GitHub 📚 More Research