Statistics for Traders #18: Quadratic Spectral kernel n_eff = 108 on the same 196-release NFP × USDJPY sample — Andrews-1991's actually-preferred kernel gives 4% more correlation than Bartlett
Yesterday’s Stats #17 computed the Bartlett-kernel effective sample size (n_eff ≈ 112) on the 196-release NFP × USDJPY 15m |move_pips| series. Today’s post redoes it with the Quadratic Spectral kernel — the one Andrews (1991) actually recommended over Bartlett. Same sample, same autocorrelations, same Andrews AR(1)-plug-in bandwidth rule; different kernel: n_eff = 107.60 at S* = 3.72.
QS gives roughly 4% more autocorrelation-correction than Bartlett on this sample. The gap is small because ρ(1) = 0.26 dominates the profile and both kernels catch it. It would widen on a sample with more spread-out higher-lag correlation, which is exactly why Andrews Section 10 recommends QS as the general- purpose HAC kernel.

The QS kernel
Andrews (1991) equation 2.7 gives the QS kernel form:
with K_QS(0) = 1by L’Hopital’s rule. The kernel decays smoothly toward zero as x grows (roughly Gaussian-like envelope) but never taper-hits zero at a finite cutoff. That’s the “quadratic spectral” property: it’s the kernel whose Fourier transform is the squared-and-smoothed version of a spectral estimator, which makes it 2nd-order and asymptotically MSE-optimal.
Andrews’ automatic bandwidth for QS
Same paper, equations 5.3 (AR(1) plug-in for q=2 kernels) and 5.9 (bandwidth constant):
S* = 1.3221 · (a(2) · T)^(1/5)
On our sample (ρ(1) = 0.2601, T = 196):
S* = 1.3221 · (0.9029·196)^(1/5) = 1.3221·(176.97)^(1/5) = 1.3221·2.815 = 3.72
Note the exponent difference from Bartlett: 1/5 for QS (q=2 kernels) versus 1/3 for Bartlett (q=1). And note the differentplug-in formula — Bartlett uses (1 − ρ²)², QS/Parzen/TH use (1 − ρ)⁴. Mixing them up is a common HAC bug: applying the q=2 formula to the Bartlett kernel gives an off-by-a-factor bandwidth (M* ≈ 6.4 instead of 4.51 on today’s sample).
The kernel-family comparison table
| Method | n_eff | τ_int | Bandwidth | Nature |
|---|---|---|---|---|
| IID (ceiling) | 196 | 1.00 | — | Assumes zero autocorrelation |
| AR(1) formula (Stats #10) | 115 | 1.70 | — | Parametric; assumes AR(1) shape |
| Bartlett @ M* = 4.51 (Stats #17) | 112 | 1.75 | 4.51 | q=1 kernel, O(T^-0.6666666666666666) MSE rate |
| QS @ S* = 3.72 (today) | 108 | 1.82 | 3.72 | q=2 kernel, O(T^-0.8) MSE rate |
| Block bootstrap @ b_opt = 4.98 (Stats #16) | 39 | 5.03 | 4.98 | Whole sampling distribution |
AR(1) → Bartlett → QS all target the same quantity (variance of the mean) and converge 115 → 112 → 108in that order. The 7-point spread is small in absolute terms and the practical CI-width differences are ~2%, but the DIRECTION is consistent: each successive estimator captures more of the true autocorrelation structure. Block bootstrap 39 is the outlier because it’s the only method here that corrects for the ρ(k) autocorrelation across the whole distributionof the sample statistic, not just the mean’s variance.
Where the 4% QS-vs-Bartlett gap comes from
Both kernels evaluate the same ρ(k) autocorrelations and multiply by their respective K(k/bandwidth) weights, then sum. The gap is entirely in the K(k/bandwidth) weight functions. Here’s a side-by-side at the relevant lags:
| k | ρ(k) | Bartlett K(k/4.51) | QS K(k/3.72) | contribution ratio |
|---|---|---|---|---|
| 1 | +0.2601 | 0.778 | 0.842 | 1.08× |
| 2 | +0.2441 | 0.556 | 0.481 | 0.87× |
| 3 | +0.0452 | 0.335 | 0.155 | 0.46× |
| 4 | +0.2120 | 0.113 | −0.020 | −0.18× (opposite sign!) |
| 6 | +0.1333 | 0 | −0.108 | — (Bartlett truncated) |
| 11 | +0.2197 | 0 | +0.019 | — (Bartlett truncated) |
Two subtle features of the QS kernel that Bartlett can’t replicate:
1) Negative weights at some lags. QS K(k/S*) goes slightly negative around k/S* ≈ 1.05 (that’s where the cos(6πx/5) term begins to dominate the sin(6πx/5)/(6πx/5)term). On this sample it means the +0.212 ρ(4) autocorrelation contributes NEGATIVELY to the QS τ_int (−0.020 × 0.212 = −0.0084) — the smooth spectral window is doing local cancellation that Bartlett’s always-non-negative triangle window can’t.
2) Weight at lags past Bartlett’s cutoff. Bartlett zeroes out ρ(k) for k ≥ M = 4.51 — so ρ(6) = +0.133 and ρ(11) = +0.220 (both meaningful) contribute exactly zero to Bartlett’s n_eff. QS carries small positive/negative weights all the way out. On our sample this adds a modest net negative contribution (the small positive ρ(11), ρ(15) mass times small positive K weights, plus the small negative K weights around k/S* ≈ 1) that nudges QS n_eff below Bartlett n_eff.
Practical implication
If you were quoting a 95% t-CI for the mean absolute NFP-USDJPY move: iid formula gives width 10.53 pips; Bartlett-corrected gives 13.86 pips (Stats #17); QS-corrected today gives 14.11 pips. The gap between Bartlett and QS is 0.25 pipson a 13.86-pip CI — about 2%. Statistically insignificant on THIS sample. But on a sample where higher-lag autocorrelation was three or four times stronger (say a GARCH-heavy equity return series), the same computation would show QS pulling n_eff meaningfully below Bartlett as the smooth spectral window captures the wider-band mass.
Rule of thumb from Andrews 1991 Section 10: use QS + Andrews auto-bandwidth as the default. Fall back to Parzen (also q=2, similar S*) if computational speed matters (Parzen truncates at k = M like Bartlett, while QS sums all lags). Fall back to Bartlett + Newey-West 1994 auto-bandwidth only if you need PSD-by-construction and the software surface forces it — which is why today’s Paper Trail #18 goes back to Newey-West 1987 as the paper that gave the world the Bartlett HAC in the first place.
What this doesn’t say
QS n_eff isn’t “the right answer” either. It’s anasymptotically-efficient estimator of the variance-of-the-mean effective sample size. It remains an estimator of a quantity that itself is only well- defined asymptotically. On finite samples with T ≈ 200 and ρ(1) ≈ 0.3, the practical difference between Bartlett n_eff and QS n_eff will always be small (~5%) — the theoretical efficiency advantage is a large-T story.
Neither Bartlett nor QS handles distributional quantities.Both estimate the variance of the mean. For a CI on a median, a Sharpe ratio, or a bucket quantile, both kernel HAC estimates give the wrong answer — use the block bootstrap (Stats #15) or its automatic-block-length variant (Stats #16) instead.
The Andrews AR(1) plug-in is one specific rule. Newey-West 1994 (their “Automatic Lag Selection” paper) proposes a plug-in-free alternative: M = 4·(T/100)^(2/9) for Bartlett. On our T = 196 sample: M = 4·1.156 = 4.63, giving Bartlett n_eff ≈ 117. Very close to Andrews. Both rules exist because they optimize slightly different loss functions on the true spectral density; on smooth-and-well-behaved series like this one they agree.
Cross-verified: JS ( scripts/insights-charts/qsKernelNeff.ts) against Python (urllib+math), same numbers to 4 decimal places.