Newey–West estimator

From HandWiki

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."[2] There are a number of HAC estimators described in,[6] and HAC estimator does not refer uniquely to Newey-West. 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 [math]\displaystyle{ X^{\operatorname{T}}\Sigma X }[/math], where [math]\displaystyle{ X }[/math] is the design matrix for the regression problem and [math]\displaystyle{ \Sigma }[/math] is the covariance matrix of the residuals. The least squares estimator [math]\displaystyle{ b }[/math] is a consistent estimator of [math]\displaystyle{ \beta }[/math]. This implies that the least squares residuals [math]\displaystyle{ e_i }[/math] are "point-wise" consistent estimators of their population counterparts [math]\displaystyle{ E_i }[/math]. The general approach, then, will be to use [math]\displaystyle{ X }[/math] and [math]\displaystyle{ e }[/math] to devise an estimator of [math]\displaystyle{ X^{\operatorname{T}}\Sigma X }[/math].[7] This means that as the time between error terms increases, the correlation between the error terms decreases. The estimator thus can be used to improve the ordinary least squares (OLS) regression when the residuals are heteroskedastic and/or autocorrelated.


[math]\displaystyle{ X^{\operatorname{T}}\Sigma X=\frac{1}{T} \sum^{T}_{t=1} e_t^{2}x_t x^{\operatorname{T}}_t + \frac{1}{T} \sum^{L}_{\ell=1} \sum^{T}_{t=\ell+1} w_{\ell} e_t e_{t-\ell}(x_t x^{\operatorname{T}}_{t-\ell} + x_{t-\ell} x^{\operatorname{T}}_t) }[/math]
[math]\displaystyle{ w_\ell=1 - \frac\ell {L+1} }[/math]

where T is the sample size, [math]\displaystyle{ e_t }[/math] is the [math]\displaystyle{ t^{th} }[/math] residual and [math]\displaystyle{ x_t }[/math] is the [math]\displaystyle{ t^{th} }[/math] row of the design matrix, and [math]\displaystyle{ w_\ell }[/math] is the Bartlett Kernel [8] and can be thought of as a weight that decreases with increasing separation between samples. Disturbances that are farther apart from each other are given lower weight, while those with equal subscripts are given a weight of 1. This ensures that second term converges (in some appropriate sense) to a finite matrix. This weighting scheme also ensures that the resulting covariance matrix is positive semi-definite.[2] L=0 reduces the Newey-West estimator to Huber–White standard error.[9] L specifies the "maximum lag considered for the control of autocorrelation. A common choice for L" is [math]\displaystyle{ T^{1/4} }[/math].[9][10]

Software implementations

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.[16]

In SAS, the Newey-West corrected standard errors can be obtained in PROC AUTOREG and PROC MODEL [17]

See also

References

  1. "Newey West estimator – Quantitative Finance Collector". http://www.mathfinance.cn/newey-west-estimator/. 
  2. 2.0 2.1 2.2 Newey, Whitney K; West, Kenneth D (1987). "A Simple, Positive Semi-definite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix". Econometrica 55 (3): 703–708. doi:10.2307/1913610. http://www.nber.org/papers/t0055.pdf. 
  3. Andrews, Donald W. K. (1991). "Heteroskedasticity and autocorrelation consistent covariance matrix estimation". Econometrica 59 (3): 817–858. doi:10.2307/2938229. http://cowles.yale.edu/sites/default/files/files/pub/d08/d0877-r.pdf. 
  4. Newey, Whitney K.; West, Kenneth D. (1994). "Automatic lag selection in covariance matrix estimation". Review of Economic Studies 61 (4): 631–654. doi:10.2307/2297912. http://www.nber.org/papers/t0144.pdf. 
  5. Smith, Richard J. (2005). "Automatic positive semidefinite HAC covariance matrix and GMM estimation". Econometric Theory 21 (1): 158–170. doi:10.1017/S0266466605050103. http://wrap.warwick.ac.uk/733/1/WRAP_Smith_Automatic_semidefinate.pdf. 
  6. 6.0 6.1 6.2 "sandwich: Robust Covariance Matrix Estimators". CRAN. https://cran.r-project.org/package=sandwich. 
  7. Greene, William H. (1997). Econometric Analysis (3rd ed.). https://archive.org/details/econometricanaly0000gree. 
  8. "time series - Bartlett Kernel (Newey West Covariance Matrix)" (in en). https://stats.stackexchange.com/q/329513. 
  9. 9.0 9.1 "Verallgemeinerte Kleinst-Quadrate-Schätzung". Uni-Kassel. https://www.uni-kassel.de/fb07/index.php?eID=dumpFile&t=f&f=2817&token=d05ecfbfd0070bb022cff4d2384120b19ec2628e. 
  10. Greene, William H. (2012). Econometric analysis (7th ed.). Boston: Pearson. ISBN 978-0-273-75356-8. OCLC 726074601. 
  11. "CovarianceMatrices.jl package". https://github.com/gragusa/CovarianceMatrices.jl. 
  12. "plm: Linear Models for Panel Data". CRAN. https://cran.r-project.org/package=plm. 
  13. "Regression with Newey–West standard errors". Stata Manual. https://www.stata.com/manuals14/tsnewey.pdf. 
  14. "Heteroscedasticity and autocorrelation consistent covariance estimators". Econometrics Toolbox. https://www.mathworks.com/help/econ/hac.html. 
  15. "statsmodels: Statistics". statsmodels. http://www.statsmodels.org/dev/stats.html. 
  16. "Robust covariance matrix estimation". Gretl User's Guide, chapter 22. http://gretl.sourceforge.net/gretl-help/gretl-guide.pdf. 
  17. "Usage Note 40098: Newey-West correction of standard errors for heteroscedasticity and autocorrelation". http://support.sas.com/kb/40/098.html. 

Further reading