Misplaced Pages

Heteroskedasticity-consistent standard errors

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Asymptotic variances under heteroskedasticity

The topic of heteroskedasticity-consistent (HC) standard errors arises in statistics and econometrics in the context of linear regression and time series analysis. These are also known as heteroskedasticity-robust standard errors (or simply robust standard errors), Eicker–Huber–White standard errors (also Huber–White standard errors or White standard errors), to recognize the contributions of Friedhelm Eicker, Peter J. Huber, and Halbert White.

In regression and time-series modelling, basic forms of models make use of the assumption that the errors or disturbances ui have the same variance across all observation points. When this is not the case, the errors are said to be heteroskedastic, or to have heteroskedasticity, and this behaviour will be reflected in the residuals u ^ i {\textstyle {\widehat {u}}_{i}} estimated from a fitted model. Heteroskedasticity-consistent standard errors are used to allow the fitting of a model that does contain heteroskedastic residuals. The first such approach was proposed by Huber (1967), and further improved procedures have been produced since for cross-sectional data, time-series data and GARCH estimation.

Heteroskedasticity-consistent standard errors that differ from classical standard errors may indicate model misspecification. Substituting heteroskedasticity-consistent standard errors does not resolve this misspecification, which may lead to bias in the coefficients. In most situations, the problem should be found and fixed. Other types of standard error adjustments, such as clustered standard errors or HAC standard errors, may be considered as extensions to HC standard errors.

History

Heteroskedasticity-consistent standard errors are introduced by Friedhelm Eicker, and popularized in econometrics by Halbert White.

Problem

Consider the linear regression model for the scalar y {\displaystyle y} .

y = x β + ε , {\displaystyle y=\mathbf {x} ^{\top }{\boldsymbol {\beta }}+\varepsilon ,\,}

where x {\displaystyle \mathbf {x} } is a k x 1 column vector of explanatory variables (features), β {\displaystyle {\boldsymbol {\beta }}} is a k × 1 column vector of parameters to be estimated, and ε {\displaystyle \varepsilon } is the residual error.

The ordinary least squares (OLS) estimator is

β ^ O L S = ( X X ) 1 X y . {\displaystyle {\widehat {\boldsymbol {\beta }}}_{\mathrm {OLS} }=(\mathbf {X} ^{\top }\mathbf {X} )^{-1}\mathbf {X} ^{\top }\mathbf {y} .\,}

where y {\displaystyle \mathbf {y} } is a vector of observations y i {\displaystyle y_{i}} , and X {\displaystyle \mathbf {X} } denotes the matrix of stacked x i {\displaystyle \mathbf {x} _{i}} values observed in the data.

If the sample errors have equal variance σ 2 {\displaystyle \sigma ^{2}} and are uncorrelated, then the least-squares estimate of β {\displaystyle {\boldsymbol {\beta }}} is BLUE (best linear unbiased estimator), and its variance is estimated with

V ^ [ β ^ O L S ] = s 2 ( X X ) 1 , s 2 = i ε ^ i 2 n k {\displaystyle {\hat {\mathbb {V} }}\left=s^{2}(\mathbf {X} ^{\top }\mathbf {X} )^{-1},\quad s^{2}={\frac {\sum _{i}{\widehat {\varepsilon }}_{i}^{2}}{n-k}}}

where ε ^ i = y i x i β ^ O L S {\displaystyle {\widehat {\varepsilon }}_{i}=y_{i}-\mathbf {x} _{i}^{\top }{\widehat {\boldsymbol {\beta }}}_{\mathrm {OLS} }} are the regression residuals.

When the error terms do not have constant variance (i.e., the assumption of E [ u u ] = σ 2 I n {\displaystyle \mathbb {E} =\sigma ^{2}\mathbf {I} _{n}} is untrue), the OLS estimator loses its desirable properties. The formula for variance now cannot be simplified:

V [ β ^ O L S ] = V [ ( X X ) 1 X y ] = ( X X ) 1 X Σ X ( X X ) 1 {\displaystyle \mathbb {V} \left=\mathbb {V} {\big }=(\mathbf {X} ^{\top }\mathbf {X} )^{-1}\mathbf {X} ^{\top }\mathbf {\Sigma } \mathbf {X} (\mathbf {X} ^{\top }\mathbf {X} )^{-1}}

where Σ = V [ u ] . {\displaystyle \mathbf {\Sigma } =\mathbb {V} .}

While the OLS point estimator remains unbiased, it is not "best" in the sense of having minimum mean square error, and the OLS variance estimator V ^ [ β ^ O L S ] {\displaystyle {\hat {\mathbb {V} }}\left} does not provide a consistent estimate of the variance of the OLS estimates.

For any non-linear model (for instance logit and probit models), however, heteroskedasticity has more severe consequences: the maximum likelihood estimates of the parameters will be biased (in an unknown direction), as well as inconsistent (unless the likelihood function is modified to correctly take into account the precise form of heteroskedasticity). As pointed out by Greene, “simply computing a robust covariance matrix for an otherwise inconsistent estimator does not give it redemption.”

Solution

If the regression errors ε i {\displaystyle \varepsilon _{i}} are independent, but have distinct variances σ i 2 {\displaystyle \sigma _{i}^{2}} , then Σ = diag ( σ 1 2 , , σ n 2 ) {\displaystyle \mathbf {\Sigma } =\operatorname {diag} (\sigma _{1}^{2},\ldots ,\sigma _{n}^{2})} which can be estimated with σ ^ i 2 = ε ^ i 2 {\displaystyle {\widehat {\sigma }}_{i}^{2}={\widehat {\varepsilon }}_{i}^{2}} . This provides White's (1980) estimator, often referred to as HCE (heteroskedasticity-consistent estimator):

V ^ HCE [ β ^ OLS ] = 1 n ( 1 n i x i x i ) 1 ( 1 n i x i x i ε ^ i 2 ) ( 1 n i x i x i ) 1 = ( X X ) 1 ( X diag ( ε ^ 1 2 , , ε ^ n 2 ) X ) ( X X ) 1 , {\displaystyle {\begin{aligned}{\hat {\mathbb {V} }}_{\text{HCE}}{\big }&={\frac {1}{n}}{\bigg (}{\frac {1}{n}}\sum _{i}\mathbf {x} _{i}\mathbf {x} _{i}^{\top }{\bigg )}^{-1}{\bigg (}{\frac {1}{n}}\sum _{i}\mathbf {x} _{i}\mathbf {x} _{i}^{\top }{\widehat {\varepsilon }}_{i}^{2}{\bigg )}{\bigg (}{\frac {1}{n}}\sum _{i}\mathbf {x} _{i}\mathbf {x} _{i}^{\top }{\bigg )}^{-1}\\&=(\mathbf {X} ^{\top }\mathbf {X} )^{-1}(\mathbf {X} ^{\top }\operatorname {diag} ({\widehat {\varepsilon }}_{1}^{2},\ldots ,{\widehat {\varepsilon }}_{n}^{2})\mathbf {X} )(\mathbf {X} ^{\top }\mathbf {X} )^{-1},\end{aligned}}}

where as above X {\displaystyle \mathbf {X} } denotes the matrix of stacked x i {\displaystyle \mathbf {x} _{i}^{\top }} values from the data. The estimator can be derived in terms of the generalized method of moments (GMM).

Also often discussed in the literature (including White's paper) is the covariance matrix Ω ^ n {\displaystyle {\widehat {\mathbf {\Omega } }}_{n}} of the n {\displaystyle {\sqrt {n}}} -consistent limiting distribution:

n ( β ^ n β ) d N ( 0 , Ω ) , {\displaystyle {\sqrt {n}}({\widehat {\boldsymbol {\beta }}}_{n}-{\boldsymbol {\beta }})\,\xrightarrow {d} \,{\mathcal {N}}(\mathbf {0} ,\mathbf {\Omega } ),}

where

Ω = E [ X X ] 1 V [ X ε ] E [ X X ] 1 , {\displaystyle \mathbf {\Omega } =\mathbb {E} ^{-1}\mathbb {V} \operatorname {\mathbb {E} } ^{-1},}

and

Ω ^ n = ( 1 n i x i x i ) 1 ( 1 n i x i x i ε ^ i 2 ) ( 1 n i x i x i ) 1 = n ( X X ) 1 ( X diag ( ε ^ 1 2 , , ε ^ n 2 ) X ) ( X X ) 1 {\displaystyle {\begin{aligned}{\widehat {\mathbf {\Omega } }}_{n}&={\bigg (}{\frac {1}{n}}\sum _{i}\mathbf {x} _{i}\mathbf {x} _{i}^{\top }{\bigg )}^{-1}{\bigg (}{\frac {1}{n}}\sum _{i}\mathbf {x} _{i}\mathbf {x} _{i}^{\top }{\widehat {\varepsilon }}_{i}^{2}{\bigg )}{\bigg (}{\frac {1}{n}}\sum _{i}\mathbf {x} _{i}\mathbf {x} _{i}^{\top }{\bigg )}^{-1}\\&=n(\mathbf {X} ^{\top }\mathbf {X} )^{-1}(\mathbf {X} ^{\top }\operatorname {diag} ({\widehat {\varepsilon }}_{1}^{2},\ldots ,{\widehat {\varepsilon }}_{n}^{2})\mathbf {X} )(\mathbf {X} ^{\top }\mathbf {X} )^{-1}\end{aligned}}}

Thus,

Ω ^ n = n V ^ HCE [ β ^ OLS ] {\displaystyle {\widehat {\mathbf {\Omega } }}_{n}=n\cdot {\hat {\mathbb {V} }}_{\text{HCE}}}

and

V ^ [ X ε ] = 1 n i x i x i ε ^ i 2 = 1 n X diag ( ε ^ 1 2 , , ε ^ n 2 ) X . {\displaystyle {\widehat {\mathbb {V} }}={\frac {1}{n}}\sum _{i}\mathbf {x} _{i}\mathbf {x} _{i}^{\top }{\widehat {\varepsilon }}_{i}^{2}={\frac {1}{n}}\mathbf {X} ^{\top }\operatorname {diag} ({\widehat {\varepsilon }}_{1}^{2},\ldots ,{\widehat {\varepsilon }}_{n}^{2})\mathbf {X} .}

Precisely which covariance matrix is of concern is a matter of context.

Alternative estimators have been proposed in MacKinnon & White (1985) that correct for unequal variances of regression residuals due to different leverage. Unlike the asymptotic White's estimator, their estimators are unbiased when the data are homoscedastic.

Of the four widely available different options, often denoted as HC0-HC3, the HC3 specification appears to work best, with tests relying on the HC3 estimator featuring better power and closer proximity to the targeted size, especially in small samples. The larger the sample, the smaller the difference between the different estimators.

An alternative to explicitly modelling the heteroskedasticity is using a resampling method such as the wild bootstrap. Given that the studentized bootstrap, which standardizes the resampled statistic by its standard error, yields an asymptotic refinement, heteroskedasticity-robust standard errors remain nevertheless useful.

Instead of accounting for the heteroskedastic errors, most linear models can be transformed to feature homoskedastic error terms (unless the error term is heteroskedastic by construction, e.g. in a linear probability model). One way to do this is using weighted least squares, which also features improved efficiency properties.

See also

Software

  • EViews: EViews version 8 offers three different methods for robust least squares: M-estimation (Huber, 1973), S-estimation (Rousseeuw and Yohai, 1984), and MM-estimation (Yohai 1987).
  • Julia: the CovarianceMatrices package offers several methods for heteroskedastic robust variance covariance matrices.
  • MATLAB: See the hac function in the Econometrics toolbox.
  • Python: The Statsmodel package offers various robust standard error estimates, see statsmodels.regression.linear_model.RegressionResults for further descriptions
  • R: the vcovHC() command from the sandwich package.
  • RATS: robusterrors option is available in many of the regression and optimization commands (linreg, nlls, etc.).
  • Stata: robust option applicable in many pseudo-likelihood based procedures.
  • Gretl: the option --robust to several estimation commands (such as ols) in the context of a cross-sectional dataset produces robust standard errors.

References

  1. Kleiber, C.; Zeileis, A. (2006). "Applied Econometrics with R" (PDF). UseR-2006 conference. Archived from the original (PDF) on April 22, 2007.
  2. Eicker, Friedhelm (1967). "Limit Theorems for Regression with Unequal and Dependent Errors". Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability. Vol. 5. pp. 59–82. MR 0214223. Zbl 0217.51201.
  3. Huber, Peter J. (1967). "The behavior of maximum likelihood estimates under nonstandard conditions". Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability. Vol. 5. pp. 221–233. MR 0216620. Zbl 0212.21504.
  4. White, Halbert (1980). "A Heteroskedasticity-Consistent Covariance Matrix Estimator and a Direct Test for Heteroskedasticity". Econometrica. 48 (4): 817–838. CiteSeerX 10.1.1.11.7646. doi:10.2307/1912934. JSTOR 1912934. MR 0575027.
  5. King, Gary; Roberts, Margaret E. (2015). "How Robust Standard Errors Expose Methodological Problems They Do Not Fix, and What to Do About It". Political Analysis. 23 (2): 159–179. doi:10.1093/pan/mpu015. ISSN 1047-1987.
  6. Eicker, F. (1963). "Asymptotic Normality and Consistency of the Least Squares Estimators for Families of Linear Regressions". The Annals of Mathematical Statistics. 34 (2): 447–456. doi:10.1214/aoms/1177704156.
  7. Eicker, Friedhelm (January 1967). "Limit theorems for regressions with unequal and dependent errors". Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, Volume 1: Statistics. 5 (1): 59–83.
  8. Giles, Dave (May 8, 2013). "Robust Standard Errors for Nonlinear Models". Econometrics Beat.
  9. Guggisberg, Michael (2019). "Misspecified Discrete Choice Models and Huber-White Standard Errors". Journal of Econometric Methods. 8 (1). doi:10.1515/jem-2016-0002.
  10. Greene, William H. (2012). Econometric Analysis (Seventh ed.). Boston: Pearson Education. pp. 692–693. ISBN 978-0-273-75356-8.
  11. MacKinnon, James G.; White, Halbert (1985). "Some Heteroskedastic-Consistent Covariance Matrix Estimators with Improved Finite Sample Properties". Journal of Econometrics. 29 (3): 305–325. doi:10.1016/0304-4076(85)90158-7. hdl:10419/189084.
  12. Long, J. Scott; Ervin, Laurie H. (2000). "Using Heteroscedasticity Consistent Standard Errors in the Linear Regression Model". The American Statistician. 54 (3): 217–224. doi:10.2307/2685594. ISSN 0003-1305.
  13. C., Davison, Anthony (2010). Bootstrap methods and their application. Cambridge Univ. Press. ISBN 978-0-521-57391-7. OCLC 740960962.{{cite book}}: CS1 maint: multiple names: authors list (link)
  14. "EViews 8 Robust Regression".
  15. CovarianceMatrices: Robust Covariance Matrix Estimators
  16. "Heteroskedasticity and autocorrelation consistent covariance estimators". Econometrics Toolbox.
  17. sandwich: Robust Covariance Matrix Estimators
  18. Kleiber, Christian; Zeileis, Achim (2008). Applied Econometrics with R. New York: Springer. pp. 106–110. ISBN 978-0-387-77316-2.
  19. See online help for _robust option and regress command.
  20. "Robust covariance matrix estimation" (PDF). Gretl User's Guide, chapter 19.

Further reading

Categories: