Newey–West estimator

A Newey–West estimator is used in statistics and econometrics to provide an estimate of the covariance matrix of the parameters of a regression-type model where the standard assumptions of regression analysis do not apply.

[1] It was devised by Whitney K. Newey and Kenneth D. West in 1987, although there are a number of later variants.

[2][3][4][5] The estimator is used to try to overcome autocorrelation (also called serial correlation), and heteroskedasticity in the error terms in the models, often for regressions applied to time series data.

The abbreviation "HAC," sometimes used for the estimator, stands for "heteroskedasticity and autocorrelation consistent.

One version of Newey–West Bartlett requires the user to specify the bandwidth and usage of the Bartlett kernel from Kernel density estimation[6] Regression models estimated with time series data often exhibit autocorrelation; that is, the error terms are correlated over time.

The heteroscedastic consistent estimator of the error covariance is constructed from a term

The estimator thus can be used to improve the ordinary least squares (OLS) regression when the residuals are heteroscedastic and/or autocorrelated.

is the Bartlett kernel [8] and can be thought of as a weight that decreases with increasing separation between samples.

This weighting scheme also ensures that the resulting covariance matrix is positive semi-definite.

[9][10] In Julia, the CovarianceMatrices.jl package [11] supports several types of heteroskedasticity and autocorrelation consistent covariance matrix estimation including Newey–West, White, and Arellano.

In R, the packages sandwich[6] and plm[12] include a function for the Newey–West estimator.

In Stata, the command newey produces Newey–West standard errors for coefficients estimated by OLS regression.

[13] In MATLAB, the command hac in the Econometrics toolbox produces the Newey–West estimator (among others).

[14] In Python, the statsmodels[15] module includes functions for the covariance matrix using Newey–West.

In Gretl, the option --robust to several estimation commands (such as ols) in the context of a time-series dataset produces Newey–West standard errors.