Small Group Tutorials

Here to help students catch up, keep up, and move ahead. Book a consultation here.

How Newey–West HAC Algorithms Repair Financial Regression Standard Errors: Lagged Score Covariances, Bartlett Weights, Bandwidth Choice, PSD Matrices and Inference Failure

Reader question: An ordinary least-squares regression can have sensible coefficient estimates even when its residuals are heteroskedastic and serially correlated. How do we repair the uncertainty estimates without changing the coefficients themselves?

Newey–West heteroskedasticity-and-autocorrelation-consistent (HAC) covariance estimation keeps the OLS coefficient vector unchanged and replaces its naive covariance matrix with a weighted sum of lagged score autocovariances. Bartlett weights taper the higher-lag terms so the resulting long-run covariance estimator is positive semidefinite by construction.

This article owns one precise computational job: HAC covariance construction for time-series regression inference under heteroskedastic and serially correlated errors. It does not own OLS coefficient estimation, Diebold–Mariano forecast comparison, panel clustering, Fama–MacBeth cross-sectional regressions, or generic bootstrap inference.

This is public mathematical and computational education. It is not financial advice and does not make a misspecified regression economically correct merely by widening its standard errors.

1. The regression setup

Consider:

yt = xtTβ + ut.

OLS estimates:

β̂ = (XTX)−1XTy.

If ut were homoskedastic and serially independent, the familiar OLS covariance formula would be appropriate.

Financial time series often violate both assumptions:

  • volatility changes through time;
  • returns or regression residuals can be serially dependent;
  • overlapping-horizon observations mechanically create autocorrelation;
  • forecast errors can cluster.

2. What Newey–West changes—and what it does not

Newey–West does not change β̂.

It changes the estimated covariance matrix:

Var̂(β̂).

That changes:

  • standard errors;
  • t statistics;
  • confidence intervals;
  • Wald tests.

If the OLS coefficients are biased because of endogeneity, omitted variables, measurement error or nonstationarity, HAC standard errors do not fix that bias.

3. Score vectors

Define the regression score-like vector:

gt = xtt.

Under serial dependence, the long-run covariance of the sum of gt depends not only on same-time variance but also on lagged covariance:

Cov(gt,gt−j).

The HAC estimator attempts to estimate the spectral density at frequency zero—the long-run variance relevant for the asymptotic distribution of the coefficient estimator.

4. Sample lagged covariance matrices

For lag j, define schematically:

Γ̂j = Σt=j+1T gtgt−jT.

At lag zero:

Γ̂0 = Σ gtgtT.

The exact normalization depends on software/sample-scaling convention, but the same convention must flow consistently into the sandwich covariance formula.

5. Bartlett weights

With maximum lag L, Newey–West uses:

wj = 1 − j/(L+1),

for j=1,…,L.

The HAC “meat” is:

Ω̂ = Γ̂0 + Σj=1Lwj(Γ̂j+Γ̂jT).

The coefficient covariance then has sandwich form:

Var̂(β̂) = (XTX)−1 Ω̂ (XTX)−1

up to the normalization convention used.

6. Why taper the lagged covariances

High-lag sample autocovariances are noisy.

If all lags up to L received full weight, the long-run covariance estimate could have large variance and poor finite-sample behavior.

Bartlett tapering gives:

  • weight 1 at lag zero;
  • progressively smaller weight as j increases;
  • zero weight beyond L.

This is a bias–variance compromise.

7. Positive semidefinite by construction

The original Newey–West construction was notable because the weighted covariance estimate is positive semidefinite under the Bartlett-kernel form.

This matters because a covariance matrix should not imply negative variance for some linear combination of coefficients.

Falsifier: if a supposedly standard Bartlett Newey–West implementation produces materially negative eigenvalues beyond floating-point noise, inspect the lag symmetrization, weights and scaling.

8. Bandwidth L is the central tuning parameter

If L is too small:

  • important residual autocorrelation is omitted;
  • standard errors can remain understated;
  • tests over-reject.

If L is too large:

  • many noisy autocovariances enter;
  • variance of the covariance estimator rises;
  • finite-sample t statistics can become unstable.

Bandwidth selection is therefore not a cosmetic default.

9. Automatic lag selection

Newey and West later developed automatic lag-selection procedures designed to choose the number of autocovariances under a mean-squared-error criterion for a given kernel.

Other HAC literature develops alternative kernels and data-dependent bandwidth rules.

A production workflow should record:

  • kernel;
  • bandwidth;
  • prewhitening choice;
  • small-sample correction;
  • software convention.

10. Overlapping returns create mechanical serial correlation

Suppose a one-month return is calculated every day:

Rt,t+22.

Adjacent observations share 21 of 22 daily returns.

Even if one-day shocks were independent, the overlapping monthly returns are mechanically autocorrelated.

Naive OLS standard errors treating them as independent can be far too small.

HAC covariance is therefore especially common in predictive regressions with overlapping horizons.

11. Hansen–Hodrick versus Newey–West

Hansen–Hodrick covariance estimators were developed for overlapping forecast errors and related serial-correlation structures.

Newey–West generalizes the idea with kernel tapering that yields a positive-semidefinite estimator.

The methods are neighbors, not identical formulas.

12. Heteroskedasticity alone

If residuals are heteroskedastic but serially independent, L=0 reduces the HAC meat to:

Γ̂0,

which resembles a heteroskedasticity-robust sandwich covariance estimator.

Thus Newey–West extends robust covariance beyond same-time heteroskedasticity to autocorrelation.

13. Serial correlation diagnostics

Before choosing L blindly, inspect:

  • residual ACF;
  • score-vector autocorrelation;
  • Ljung–Box or related diagnostics;
  • known overlap length;
  • economic timing of the regression.

A bandwidth should cover dependence relevant to the estimator, not just visually convenient residual lags.

14. Inputs and outputs

Inputs can include:

  • X and y;
  • OLS residuals;
  • kernel;
  • bandwidth L;
  • prewhitening setting;
  • finite-sample adjustment;
  • time ordering;
  • missing-data policy.

Outputs can include:

  • unchanged β̂;
  • HAC covariance matrix;
  • HAC standard errors;
  • t statistics;
  • confidence intervals;
  • Wald tests;
  • lag contribution table;
  • PSD eigenvalue check;
  • bandwidth sensitivity;
  • residual dependence diagnostics.

15. Evidence polarity

Evidence for confidence includes:

  • standard errors stabilize over a reasonable bandwidth range;
  • lagged score autocovariances decay;
  • the covariance matrix is PSD;
  • simulation coverage is close to nominal under a realistic error process;
  • known overlapping-horizon dependence is covered by the bandwidth;
  • results agree with independent software implementations using matching conventions.

Evidence against confidence includes:

  • t statistics swing wildly with L;
  • residual dependence extends far beyond the chosen bandwidth;
  • structural breaks dominate autocovariance;
  • effective sample size is tiny relative to L;
  • PSD failure from coding mistakes;
  • coefficient bias/endogeneity remains untreated.

16. Counterexample: bandwidth too short

A 12-month overlapping return regression uses monthly observations with long overlap.

A default L=1 ignores most mechanical serial dependence.

Falsifier: expand L through the overlap horizon and inspect standard-error stability. If inference changes materially, the short bandwidth was inadequate.

17. Counterexample: bandwidth too long

A sample contains only 120 monthly observations, but L=60.

High-lag autocovariances are estimated from very few pairs.

The HAC estimate can become extremely noisy.

Falsifier: compare automatic bandwidth rules and smaller L values; inspect each lag contribution and finite-sample coverage.

18. Counterexample: structural break masquerades as autocorrelation

Suppose regression residuals shift mean after a policy change.

Newey–West treats this as dependence in a stationary long-run covariance calculation.

It does not model the break.

Falsifier: test for regime/change points and re-specify the regression if the data-generating process changed.

19. Counterexample: spurious regression

Two unrelated nonstationary series can produce a high R² and apparently significant coefficient.

HAC standard errors do not turn a spurious regression into a valid one.

Falsifier: test stationarity/cointegration and choose the correct regression framework before HAC inference.

20. Counterexample: endogeneity

If xt is correlated with ut, OLS β̂ is generally biased/inconsistent.

Newey–West only estimates covariance around that OLS estimator.

Falsifier: use instruments, structural identification or another estimator if endogeneity is material.

21. Counterexample: panel dependence

A panel regression may contain both time-series autocorrelation and cross-sectional dependence within firms/sectors.

A single-series Newey–West covariance does not automatically solve clustering across entities.

Falsifier: match covariance architecture to the sampling structure—cluster, two-way cluster, Driscoll–Kraay or another appropriate method where justified.

22. Counterexample: prewhitening changes the result

Some software applies AR prewhitening before HAC estimation; some does not.

Two functions both labelled “Newey–West” can therefore return different standard errors.

Falsifier: document and align preprocessing, kernel, lag and finite-sample options before comparing outputs.

23. Newey–West versus Diebold–Mariano

Diebold–Mariano algorithms own a forecast-comparison test based on the mean loss differential.

A HAC long-run variance estimator can appear inside the DM test, but Newey–West owns the generic covariance-construction mechanism used across many regressions/tests.

24. Newey–West versus ordinary White robust errors

White-type robust standard errors address heteroskedasticity without serial correlation.

Newey–West extends the covariance estimate to lagged dependence through weighted autocovariances.

25. Newey–West versus block bootstrap

A block bootstrap can preserve dependence by resampling blocks of observations and can approximate a fuller finite-sample distribution.

It is computationally heavier and introduces its own block-length choice.

HAC is analytic/asymptotic and typically much cheaper.

26. Alternatives

White/HC covariance: heteroskedasticity only.

Hansen–Hodrick: overlapping-observation covariance structure.

Andrews kernels/bandwidths: alternative HAC weighting choices.

Prewhitened HAC: reduce finite-sample autocorrelation before kernel estimation.

Cluster-robust covariance: grouped dependence structures.

Block bootstrap: resampling-based dependence-robust inference.

27. Weak links

  • bandwidth default used without thought;
  • kernel mismatch;
  • time order incorrect;
  • missing observations handled inconsistently;
  • structural breaks;
  • nonstationarity;
  • endogeneity;
  • small sample versus large L;
  • software convention differences;
  • assuming robust standard errors repair a bad model.

28. What would falsify confidence?

Confidence should be withdrawn if inference is extremely bandwidth-sensitive; if simulations show poor confidence-interval coverage; if residual/score dependence extends beyond the modeled lag structure; if the data are structurally nonstationary; or if the regression estimator itself is inconsistent because of endogeneity or misspecification.

29. Verification and update triggers

Preserve the regression design, residuals, time ordering, kernel, bandwidth, small-sample scaling, prewhitening and software version.

Revalidate when:

  • forecast/return horizon changes;
  • sampling frequency changes;
  • residual dependence changes;
  • the sample becomes much shorter;
  • structural breaks appear;
  • covariance software defaults change;
  • the data structure becomes panel/clustered.

30. Primary and high-quality references

Educational boundary: Newey–West repairs a covariance estimate under weak dependence; it does not repair biased coefficients, nonstationary economics, bad identification, or a misspecified causal story.

Discover more from Bukit Timah Tutor

Subscribe now to keep reading and get access to the full archive.

Continue reading