What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Heteroskedasticity Econometric Methods Lecture 3 Andrzej Torój , Ph.D. Warsaw School of Economics Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Outline 1 What is heteroskedasticity? 2 Testing for heteroskedasticity White Goldfeld-Quandt Breusch-Pagan 3 Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Outline 1 What is heteroskedasticity? 2 Testing for heteroskedasticity 3 Dealing with heteroskedasticity Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Recall: variance-covariance matrix of ε E εεT = var (ε1 ) cov (ε1 ε2 ) . . . cov (ε1 εT ) cov (ε1 ε2 ) var (ε2 ) . . . cov (ε2 εT ) = . . . .. . . . . . . . cov (ε1 εT ) cov (ε2 εT ) . . . var (εT ) OLS assumptions = σ2 0 0 σ2 . . . 0 ... ... 0 0 . . . .. . . . 0 . . . σ2 . Andrzej Torój = (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Heteroskedasticity var (ε1 ) cov (ε1 , ε2 ) . . . cov (ε1 , εT ) cov (ε1 , ε2 ) var (ε2 ) . . . cov (ε2 , εT ) ··· ··· .. . 0 cov (ε1 , εT ) ω1 0 cov (ε2 , εT ) 2 =σ . . . ω2 . . . 0 var (εT ) 0 6 4 2 0 -2 6 -4 4 -6 2 0 -2 -4 -6 2000 2001 2002 Residual Andrzej Torój 2003 2004 Actual 2005 2006 Fitted (3) Heteroskedasticity ··· ··· .. 0 0 . ωT What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Non-spherical disturbances variance-covariance serial correlation matrix absent skedasticity absent hetero- present of the error term σ2 σ2 0 0 σ2 . . . 0 . . . 0 ω1 0 ω2 . . . 0 . . . 0 Andrzej Torój 0 0 ··· ··· . 0 present . . σ2 ··· ··· . . 0 0 . 1 ω12 σ2 . . . ω1 T ω12 1 . . . ω2T ωT (3) Heteroskedasticity Ω (???) ··· ··· . . ω1 T ω2 T . 1 What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Consequences of heteroskedasticity Common features of non-spherical disturbances (see serial correlation): no bias, no inconsistency... ...but ineciency ! of OLS estimates. Unlike serial correlation... heteroskedasticity can occur both in time series data cross-section data (e.g. high- and low-volatility periods in nancial markets) (e.g. variance of disturbances depends on unit size or some key explanatory variables) Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Exercise (1) Estimate (and keep on the screen) the model... ...that explains the credit-card-settled expenditures with: age income squared income house ownership dummy Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity White Goldfeld-Quandt Breusch-Pagan Outline 1 What is heteroskedasticity? 2 Testing for heteroskedasticity 3 Dealing with heteroskedasticity Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity White Goldfeld-Quandt Breusch-Pagan White test Step 1: OLS regression −1 T yt = xt β + εt β̂ = XT X X y Step 2: auxiliary regression equation P ε̂2t = xi,t xj,t βi,j + vt ε̂t = yt − xt β̂ i,j E.g. in a model with a constant and 3 regressors x1t , x2t , x3t , the auxiliary model contains the following explanatory variables: constant, x1t , x2t , x3t , x12t , x22t , x32t , x1t · x2t , x2t · x3t , x1t · x3t . {z } | cross terms IDEA: Without heteroskedasticity, the R 2 of the auxiliary equation should be low. White test H0 : heteroskedasticity absent H1 : heteroskedasticity present W = TR 2 ∼ χ2 (k ∗ ) k ∗ number of explanatory variables in the auxiliary regresson (excluding constant) CAUTION! It's a weak test (i.e. low power to reject the null) Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity White Goldfeld-Quandt Breusch-Pagan Goldfeld-Quandt test split the sample (T observations) into 2 subsamples (T = T1 + T2 ) test for equality of error term variance in both subsamples Goldfeld-Quandt test H0 : σ12 = σ22 equal variance in both subsamples (homoskedasticity) H1 : σ12 > σ22 higher variance in the subsample indexed as 1 T 1 P F (n1 − k, n2 − k) = t=1 T P ε̂2 t /(T1 −k) t=T1 +1 ε̂2 t /(T2 −k) CAUTION! This makes sense only when we index the subsample with higher variance as 1. Otherwise we never reject H0 . Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity White Goldfeld-Quandt Breusch-Pagan Breusch-Pagan test variance of the disturbances can be explained with a variable set contained in matrix the matrix X ) Z (like explanatory variables for y Breusch-Pagan test H0 : H1 : homoskedasticity heteroskedasticity BP = εˆ2 −σ̂ 2 1 T −1 Z (Z T Z ) T P t=T1 +1 where χ 2 Z T εˆ2 −σ̂ 2 1 ε̂2t /(T2 −k) T εˆ2 = ε21 ε22 . . . ε2T . The test statistic is -distributed with degrees of freedom equal to the number of regressors in the matrix Z . Andrzej Torój (3) Heteroskedasticity in What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity White Goldfeld-Quandt Breusch-Pagan Exercise (2) Consider our model of credit card expenditure: Does the White test detect heteroskedasticity? Split the sample into two equal subsamples: high-income and low-income. Check if the variance diers between the two sub-samples. (You need to sort the data and restrict the sample to a sub-sample twice, each time calculating the appropriate statistics.) Perform the Breusch-Pagan test, assuming that the variance depends on the income and squared income (and a constant). Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator Outline 1 What is heteroskedasticity? 2 Testing for heteroskedasticity 3 Dealing with heteroskedasticity Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator White robust SE unlike Newey-West robust SE (robust to both serial correlation and heteroskedasticity), heteroskedasticity White 's SE robust only to (the former were proposed later and generalized White's work) White (1980): T − 1 P T Var β̂ = X X ε̂2t t=1 xx T t t XTX − 1 they share the same features as Newey-West SE (see: serial correlation), i.e. correct statistical inference without improving estimation eciency of the parameters themselves Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator White robust SE unlike Newey-West robust SE (robust to both serial correlation and heteroskedasticity), heteroskedasticity White 's SE robust only to (the former were proposed later and generalized White's work) White (1980): T − 1 P T Var β̂ = X X ε̂2t t=1 xx T t t XTX − 1 they share the same features as Newey-West SE (see: serial correlation), i.e. correct statistical inference without improving estimation eciency of the parameters themselves Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator White robust SE unlike Newey-West robust SE (robust to both serial correlation and heteroskedasticity), heteroskedasticity White 's SE robust only to (the former were proposed later and generalized White's work) White (1980): T − 1 P T Var β̂ = X X ε̂2t t=1 xx T t t XTX − 1 they share the same features as Newey-West SE (see: serial correlation), i.e. correct statistical inference without improving estimation eciency of the parameters themselves Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator Weighted Least Squares estimator y = Xβ + ε ε ∼ E [ε] = 0, E εεT = Ω Recall the GLS estimator. Under heteroskedasticity, we know that the variance-covariance matrix implies Ω −1 = ω1 0 0 ω2 Ω= . . . 0 1 ω1 0 0 1 . . . ω2 . . . 0 0 1 ... ... 0 .. . . . . ... 1 0 1 ... ... 0 . . . .. . . . 0 ... . 0 , which ωT . ωT 1 . . . ωT we can immediately ω1 ω2 apply GLS. This vector can be interpreted as a vector of weights, Knowing the vector associated with individual observations in the estimation (hence: weighted least squares). The GLS formula collapses: Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator Weighted Least Squares estimator y = Xβ + ε ε ∼ E [ε] = 0, E εεT = Ω Recall the GLS estimator. Under heteroskedasticity, we know that the variance-covariance matrix implies Ω −1 = ω1 0 0 ω2 Ω= . . . 0 1 ω1 0 0 1 . . . ω2 . . . 0 0 1 ... ... 0 .. . . . . ... 1 0 1 ... ... 0 . . . .. . . . 0 ... . 0 , which ωT . ωT 1 . . . ωT we can immediately ω1 ω2 apply GLS. This vector can be interpreted as a vector of weights, Knowing the vector associated with individual observations in the estimation (hence: weighted least squares). The GLS formula collapses: Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator Weighted Least Squares estimator y = Xβ + ε ε ∼ E [ε] = 0, E εεT = Ω Recall the GLS estimator. Under heteroskedasticity, we know that the variance-covariance matrix implies Ω −1 = ω1 0 0 ω2 Ω= . . . 0 1 ω1 0 0 1 . . . ω2 . . . 0 0 1 ... ... 0 .. . . . . ... 1 0 1 ... ... 0 . . . .. . . . 0 ... . 0 , which ωT . ωT 1 . . . ωT we can immediately ω1 ω2 apply GLS. This vector can be interpreted as a vector of weights, Knowing the vector associated with individual observations in the estimation (hence: weighted least squares). The GLS formula collapses: Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity β̂ WLS = T P t=1 1 ωt xx T t t Robust standard errors Weighted Least Squares estimator −1 T P t=1 1 x ωt t yt The WLS estimation is equivalent to OLS estimation using data transformed in the following way: √ y1 / ω1 y2 /√ω2 = . . . √ y T / ωT y∗ X∗ = x1/√√ω x2/ ω . . . 1 2 xT/√ωT (compare the analogous GLS interpretation under AR(1) disturbances) Conclusion Weights for individual observations are the inverse of the disturbance variance in individual periods. Under OLS, these weights are a unit vector. Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity β̂ WLS = T P t=1 1 ωt xx T t t Robust standard errors Weighted Least Squares estimator −1 T P t=1 1 x ωt t yt The WLS estimation is equivalent to OLS estimation using data transformed in the following way: √ y1 / ω1 y2 /√ω2 = . . . √ y T / ωT y∗ X∗ = x1/√√ω x2/ ω . . . 1 2 xT/√ωT (compare the analogous GLS interpretation under AR(1) disturbances) Conclusion Weights for individual observations are the inverse of the disturbance variance in individual periods. Under OLS, these weights are a unit vector. Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator How to nd ω1 , ω2 , ..., ωT ? Unknown and, with T observations, cannot be estimated. The most popular solutions include: Way 1: Split the sample into subsamples. Estimate the model in each subsample via OLS to obtain the vector ε. In every subsample Assign the weight i 1 σ̂i2 estimate the variance of error terms σ̂i2 . to all the observations in the subsample i . Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator How to nd ω1 , ω2 , ..., ωT ? Unknown and, with T observations, cannot be estimated. The most popular solutions include: Way 1: Split the sample into subsamples. Estimate the model in each subsample via OLS to obtain the vector ε. In every subsample Assign the weight i 1 σ̂i2 estimate the variance of error terms σ̂i2 . to all the observations in the subsample i . Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator How to nd ω1 , ω2 , ..., ωT ? Unknown and, with T observations, cannot be estimated. The most popular solutions include: Way 1: Split the sample into subsamples. Estimate the model in each subsample via OLS to obtain the vector ε. In every subsample Assign the weight i 1 σ̂i2 estimate the variance of error terms σ̂i2 . to all the observations in the subsample i . Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator How to nd ω1 , ω2 , ..., ωT ? Unknown and, with T observations, cannot be estimated. The most popular solutions include: Way 1: Split the sample into subsamples. Estimate the model in each subsample via OLS to obtain the vector ε. In every subsample Assign the weight i 1 σ̂i2 estimate the variance of error terms σ̂i2 . to all the observations in the subsample i . Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator How to nd ω1 , ω2 , ..., ωT ? Unknown and, with T observations, cannot be estimated. The most popular solutions include: Way 1: Split the sample into subsamples. Estimate the model in each subsample via OLS to obtain the vector ε. In every subsample Assign the weight i 1 σ̂i2 estimate the variance of error terms σ̂i2 . to all the observations in the subsample i . Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator Way 2: Estimate the model via OLS to obtain the vector Treat ε2t Regress ε. as a proxy for the variance of the error term at ε2t t. against a set of potential explanatory variables (when done automatically, usually all the regressors from the base equation plus possibly their squares). Take theoretical value proxy! Use 1 εˆ2t εˆ2t 2 from this regression (εt was just a averages out random deviations). as weights for individual observations (εˆ2t ) 2 ln εt εˆ2t = exp ln ˆε2t t. ε2t . In practice, it is common to regress rather than this way we compute which blocks negative values of error terms' variance. Andrzej Torój (3) Heteroskedasticity In What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator Way 2: Estimate the model via OLS to obtain the vector Treat ε2t Regress ε. as a proxy for the variance of the error term at ε2t t. against a set of potential explanatory variables (when done automatically, usually all the regressors from the base equation plus possibly their squares). Take theoretical value proxy! Use 1 εˆ2t εˆ2t 2 from this regression (εt was just a averages out random deviations). as weights for individual observations (εˆ2t ) 2 ln εt εˆ2t = exp ln ˆε2t t. ε2t . In practice, it is common to regress rather than this way we compute which blocks negative values of error terms' variance. Andrzej Torój (3) Heteroskedasticity In What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator Way 2: Estimate the model via OLS to obtain the vector Treat ε2t Regress ε. as a proxy for the variance of the error term at ε2t t. against a set of potential explanatory variables (when done automatically, usually all the regressors from the base equation plus possibly their squares). Take theoretical value proxy! Use 1 εˆ2t εˆ2t 2 from this regression (εt was just a averages out random deviations). as weights for individual observations (εˆ2t ) 2 ln εt εˆ2t = exp ln ˆε2t t. ε2t . In practice, it is common to regress rather than this way we compute which blocks negative values of error terms' variance. Andrzej Torój (3) Heteroskedasticity In What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator Way 2: Estimate the model via OLS to obtain the vector Treat ε2t Regress ε. as a proxy for the variance of the error term at ε2t t. against a set of potential explanatory variables (when done automatically, usually all the regressors from the base equation plus possibly their squares). Take theoretical value proxy! Use 1 εˆ2t εˆ2t 2 from this regression (εt was just a averages out random deviations). as weights for individual observations (εˆ2t ) 2 ln εt εˆ2t = exp ln ˆε2t t. ε2t . In practice, it is common to regress rather than this way we compute which blocks negative values of error terms' variance. Andrzej Torój (3) Heteroskedasticity In What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator Way 2: Estimate the model via OLS to obtain the vector Treat ε2t Regress ε. as a proxy for the variance of the error term at ε2t t. against a set of potential explanatory variables (when done automatically, usually all the regressors from the base equation plus possibly their squares). Take theoretical value proxy! Use 1 εˆ2t εˆ2t 2 from this regression (εt was just a averages out random deviations). as weights for individual observations (εˆ2t ) 2 ln εt εˆ2t = exp ln ˆε2t t. ε2t . In practice, it is common to regress rather than this way we compute which blocks negative values of error terms' variance. Andrzej Torój (3) Heteroskedasticity In What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator Way 2: Estimate the model via OLS to obtain the vector Treat ε2t Regress ε. as a proxy for the variance of the error term at ε2t t. against a set of potential explanatory variables (when done automatically, usually all the regressors from the base equation plus possibly their squares). Take theoretical value proxy! Use 1 εˆ2t εˆ2t 2 from this regression (εt was just a averages out random deviations). as weights for individual observations (εˆ2t ) 2 ln εt εˆ2t = exp ln ˆε2t t. ε2t . In practice, it is common to regress rather than this way we compute which blocks negative values of error terms' variance. Andrzej Torój (3) Heteroskedasticity In What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator Exercise (3) Revisit our model: split the sample into two equal subsamples and use WLS; use Gretl's automated correction for heteroskedasticity (while explaining what has actually been done use Gretl's help); compare the parameter values between OLS and the two variants of WLS; compare variable signicance between OLS, OLS with White's robust standard errors and the two variants of WLS. Andrzej Torój (3) Heteroskedasticity What is heteroskedasticity? Testing for heteroskedasticity Dealing with heteroskedasticity Robust standard errors Weighted Least Squares estimator Readings Greene: chapter Generalized Regression Model and Heteroscedasticity Andrzej Torój (3) Heteroskedasticity