Time-Series Econometrics & Forecasting
Newey-West Bartlett HAC Long-Run Variance and Standard Error Formula
Correct serially correlated regression or sample-mean standard errors using Newey and West’s (1987) Bartlett-kernel triangular weights w_j = 1 - j / (L + 1) that guarantee positive variance.
Understand why unweighted sample autocovariance sums can produce NEGATIVE variance!
In overlapping multi-period return regressions, inflation forecasts, and macro event studies, residuals exhibit strong serial correlation across lags j = 1..L. Simply summing unweighted sample autocovariances gamma_0 + 2 * SUM(gamma_j) (the truncated Hansen-Hodrick estimator) can yield a NEGATIVE variance estimate in finite samples! Newey and West (1987) multiply each lag-j sample autocovariance by Bartlett triangular kernel weight w_j = MAX(0, 1 - j / (L + 1)), guaranteeing positive semi-definiteness at every sample size!
Verify by hand for sample size T = 100 (B2), lag truncation L = 3 (B3, so L + 1 = 4 -> Bartlett weights 3/4, 2/4, 1/4!), variance gamma_0 = 4.00 (B4), and sample autocovariances gamma_1 = 2.00, gamma_2 = 1.00, gamma_3 = 0.40 (B5:B7). Unadjusted i.i.d. SE of the sample mean is SQRT(4.00 / 100) = 0.2000; Newey-West long-run variance is Omega_NW = 4.00 + 2 * (0.75*2.00 + 0.50*1.00 + 0.25*0.40) = 4.00 + 2 * (1.50 + 0.50 + 0.10) = 8.2000, lifting true HAC standard error SQRT(8.20 / 100) to 0.2864 (+43.18% wider than naive OLS!).
| HAC Variance Component (L = 3) | Formula Expression | Sample Output |
|---|---|---|
| Bartlett Weights w_1, w_2, w_3 | MAX(0, 1 - j / (L + 1)) | 0.75, 0.50, 0.25 |
| Naive i.i.d. Variance & SE | gamma_0 = 4.00; SQRT(gamma_0 / T) | 4.0000; SE = 0.2000 |
| Newey-West Long-Run Omega_NW | gamma_0 + 2 * SUM(w_j * gamma_j) | 8.2000 |
| Newey-West HAC Standard Error | SQRT(Omega_NW / T) | 0.2864 (1.4318x inflation) |
Newey-West Bartlett-Kernel Long-Run Variance Omega_NW Formula
Use MAX(0, 1 - j / (L + 1)) on each lag row so changing truncation bandwidth L in B3 (e.g., setting L = 0 for White heteroscedasticity-only variance or L = 2) automatically zeroes out lags j > L!
=LET(l_bw, B3, g_0, B4, IF(OR(B2 <= 1, l_bw < 0, g_0 <= 0), "Invalid HAC Input", LET(w_1, MAX(0, 1 - 1 / (l_bw + 1)), w_2, MAX(0, 1 - 2 / (l_bw + 1)), w_3, MAX(0, 1 - 3 / (l_bw + 1)), ROUND(g_0 + 2 * (w_1 * B5 + w_2 * B6 + w_3 * B7), 4))))HAC Standard Error of the Mean & Bandwidth L = 0 Reduction Check
Divide Omega_NW by sample size T and take SQRT. Test setting bandwidth L = 0 in B3: all Bartlett weights w_1, w_2, w_3 drop to 0, recovering Omega_NW = 4.0000 and standard error 0.2000 identically!
=IF(ISNUMBER(E3), ROUND(SQRT(E3 / B2), 4), E3)Try the example
Use the original values or change them to test your understanding.