Arte SheetsLearn. Try. Understand.

Quantitative Finance & Time Series

Lo-MacKinlay Variance Ratio VR(q) Random-Walk Test Formula

Test the Random Walk Hypothesis in Excel and Arte Sheets using Lo and MacKinlay’s (1988) variance ratio VR(q) = var_q / (q * var_1) and asymptotic Z(q) statistic.

Exploit linear variance scaling Var(r_t(q)) = q * Var(r_t) to detect momentum vs mean reversion

A fundamental property of a log-price Random Walk is that the variance of q-period returns equals exactly q times the variance of 1-period returns! Lo and MacKinlay (1988) formed VR(q) = var_q / (q * var_1) = 1 + 2 * SUM_{k=1}^{q-1} (1 - k/q) * rho_k: positive return autocorrelation (momentum) pushes VR(q) > 1, whereas negative autocorrelation (bid-ask bounce or mean reversion) pulls VR(q) < 1, with asymptotic IID standard error SE(q) = SQRT((2 * (2*q - 1) * (q - 1)) / (3 * q * n_obs)).

Verify on n_obs = 280 weekly log returns (B3) at aggregation horizon q = 4 weeks (B2) with 1-week variance var_1 = 0.0004 (B4) and 4-week variance var_q = 0.0020 (B5): VR(4) = 0.0020 / (4 * 0.0004) = 1.2500. Asymptotic variance is (2 * 7 * 3) / (3 * 4 * 280) = 42 / 3360 = 1/80 = 0.0125 (SE = 0.1118), giving Z(4) = (1.25 - 1) / SQRT(0.0125) = +2.2361 (>= 1.96, rejecting Random Walk in favor of positive momentum)!

Multi-Period Variance Regime (q = 4, n = 280)Variance Ratio VR(4)Lo-MacKinlay Z(4) & Verdict
Positive Autocorrelation (var_4 = 0.0020)1.2500 (> 1)+2.2361 (Momentum / Reject RW)
Exact Random Walk (var_4 = 0.0016)1.0000 (= 1)0.0000 (Consistent with RW)
Mean Reversion (var_4 = 0.0012)0.7500 (< 1)-2.2361 (Mean Reversion / Reject RW)

Lo-MacKinlay Variance Ratio VR(q) = var_q / (q * var_1) Formula

Require integer aggregation horizon q >= 2, sample count n_obs > q, and positive variances var_1 > 0, var_q >= 0.

=LET(q_hor, B2, n_obs, B3, v_one, B4, v_agg, B5, IF(OR(q_hor < 2, n_obs <= q_hor, v_one <= 0, v_agg < 0), "Invalid VR Input (Require q >= 2)", ROUND(v_agg / (q_hor * v_one), 4)))

Asymptotic Homoskedastic Z(q) = (VR(q) - 1) / SQRT(2*(2q-1)*(q-1) / (3*q*n)) Formula

Note that under GARCH volatility clustering, Lo and MacKinlay’s heteroskedasticity-consistent Z*(q) widens SE(q) — so any series that already fails homoskedastic |Z(q)| < 1.96 certainly cannot reject Random Walk under GARCH.

=LET(q_hor, B2, n_obs, B3, v_one, B4, v_agg, B5, IF(OR(q_hor < 2, n_obs <= q_hor, v_one <= 0, v_agg < 0), "Invalid VR Input (Require q >= 2)", LET(vr_q, v_agg / (q_hor * v_one), se_q, SQRT((2 * (2 * q_hor - 1) * (q_hor - 1)) / (3 * q_hor * n_obs)), ROUND((vr_q - 1) / se_q, 4))))

Try the example

Use the original values or change them to test your understanding.

Further reading