Is it a random walk? The variance ratio test
Under a random walk, risk scales with the square root of time: the variance of a 10-day return is 10 times the variance of a 1-day return. If returns trend, the long-horizon variance is bigger than that; if they mean-revert, smaller. Comparing the two is one of the simplest and most widely used checks for predictability in prices.
Variance adds up only if returns are uncorrelated
The q-day return is the sum of q daily returns. Its variance is the sum of all their variances and covariances:
Divide by and you get step 2. If all autocorrelations are zero, VR = 1. If they’re positive, today’s move tends to continue, the q-day return is bigger than √q scaling suggests, and VR > 1. With negative autocorrelations, moves partly undo each other and VR < 1.
The ratio summarizes a weighted combination of autocorrelations: VR below one at a particular horizon does not prove that the price level is stationary or that every return autocorrelation is negative. Conversely, a ratio of one at one horizon does not establish independence or rule out predictability; positive and negative terms can cancel.
What makes it more useful than looking at autocorrelations one by one is that it adds up many small autocorrelations, each too small to be significant, into one number about the cumulative effect at horizon q. For AR(1) returns with coefficient φ, VR(q) climbs towards as q grows.
How big a deviation is significant?
Under the random-walk null (iid returns), the estimate based on overlapping q-day sums has the standard error in step 3. It grows with q, because longer horizons give fewer effectively independent q-day periods.
VR(q) = Var(q-day return) / (q · Var(1-day))
z-statistics against the random walk
With φ = 0.1 and 1,000 days, the sample VR climbs above 1 and the q = 2 and q = 5 statistics usually clear 1.96, though not every time. Try 250 days: the band is so wide that even φ = 0.1 is often invisible. Try φ = −0.1 for mean reversion, and φ = 0 to see how often a pure random walk produces a scary-looking curve that stays inside the band.
import numpy as np
from scipy.stats import norm
def variance_ratio(r, q):
"""Lo–MacKinlay variance ratio with overlapping q-period sums, and its iid z-statistic."""
r = np.asarray(r) - np.mean(r)
T = len(r)
var1 = np.mean(r**2)
rq = np.convolve(r, np.ones(q), mode="valid") # overlapping q-day sums
vr = np.mean(rq**2) / (q * var1)
se = np.sqrt(2 * (2 * q - 1) * (q - 1) / (3 * q * T))
z = (vr - 1) / se
return vr, z, 2 * norm.sf(abs(z))On 3,000 simulated random walks with T = 1,000, the standard deviation of was 0.108, against 0.107 from the formula. The sample VR is also biased slightly downwards in small samples (its mean was 0.993), because demeaning uses up information; bias-corrected versions exist.
Heteroskedasticity and what people found
Real returns aren’t iid even if they’re unpredictable: volatility clusters. Lo and MacKinlay (1988) also gave a heteroskedasticity-robust standard error, which allows for time-varying conditional variance and is often more appropriate for real returns. It need not be larger than the iid estimate in every sample. Their work found evidence against a random walk in weekly US stock index returns; interpretation requires care because, among other effects, nonsynchronous trading can induce apparent serial correlation.
At long horizons (years), variance ratios for stock indices tend to fall below 1 (Poterba and Summers, 1988), a sign of slow mean reversion, but with so few independent multi-year periods the evidence is weak. That’s the core limitation: long horizons need very long samples.
Where people slip in interviews
- Scaling vol by √T without checking. That assumes VR = 1. If returns mean-revert, long-horizon risk is lower than √T scaling says; if they trend, higher.
- Using the iid standard error on clustered-volatility data. Use the heteroskedasticity-robust version.
- Testing many horizons and reporting the most significant. That’s multiple testing again; use a joint test (Chow–Denning) or fix q in advance.
- Reading VR < 1 in prices as a trading strategy. Costs, and the tiny effective sample at long horizons, often wipe it out.
Try these before you open the answer
Warm-upThe first-order autocorrelation of daily returns is 0.1 and the rest are zero. What is VR(2)? VR(10)?Show answer
VR(2) = 1 + 2 × (1/2) × 0.1 = 1.1. VR(10) = 1 + 2 × (9/10) × 0.1 = 1.18.
SEWith T = 1,000 days, what's the standard error of VR(2)? Of VR(10)?Show answer
and .
TestA stock has VR(10) = 0.82 over 1,000 days. Do you reject the random walk at 5%?Show answer
z = (0.82 − 1)/0.107 ≈ −1.68. Not significant at 5% (two-sided) using the iid standard error. A heteroskedasticity-robust test needs the return data to estimate its own standard error; its result cannot be inferred from this calculation alone.
LimitFor AR(1) returns with coefficient φ, what does VR(q) tend to as q → ∞?Show answer
. For φ = 0.1 that’s 1.22; for φ = −0.1, 0.82.
RiskDaily vol is 1%, and VR(250) = 0.7. What's the annual vol, compared with the √250 rule?Show answer
√250 rule: 1% × 15.8 = 15.8%. Actual: . Mean reversion makes long-horizon risk smaller.
The standard error was checked against 3,000 simulated random walks for each horizon. The figure simulates AR(1) returns in your browser.