Econometrics c Michael Creel Version 0.80, February, 2006 DEPT.OF ECONOMICS AND ECONOMIC HISTORY, UNIVERSITAT AUTÒNOMA DE BARCELONA,
[email protected],HTTP://PARETO.UAB.E S/M C R E E L
Contents List of Figures 14 List of Tables 17 Chapter 1. About this document 18 1.1. License 19 1.2. Obtaining the materials 19 1.3. An easy way to use L YX and Octave today 20 1.4. Known Bugs 22 Chapter 2. Introduction: Economic and econometric models 23 Chapter 3. Ordinary Least Squares 26 3.1. The Linear Model 26 3.2. Estimation by least squares 27 3.3. Geometric interpretation of least squares estimation 30 3.3.1. In X,YSpace 30 3.3.2. In Observation Space 30 3.3.3. Projection Matrices 32 3.4. Influential observations and outliers 33 3.5. Goodness of fit 35 3.6. The classical linear regression model 38 3.7. Small sample statistical properties of the least squares estimator 40 3.7.1. Unbiasedness 40 3
CONTENTS 4 3.7.2. Normality 41 3.7.3. The variance of the OLS estimator and the Gauss-Markov theorem 42 3.8. Example: The Nerlove model 47 3.8.1. Theoretical background 47 3.8.2. Cobb-Douglas functional form 48 3.8.3. The Nerlove data and OLS 49 Exercises 53 Chapter 4. Maximum likelihood estimation 54 4.1. The likelihood function 54 4.1.1. Example: Bernoulli trial 56 4.2. Consistency of MLE 58 4.3. The score function 60 4.4. Asymptotic normality of MLE 62 4.6. The information matrix equality 66 4.7. The Cramér-Rao lower bound 68 Exercises 71 Chapter 5. Asymptotic properties of the least squares estimator 73 5.1. Consistency 73 5.2. Asymptotic normality 74 5.3. Asymptotic efficiency 75 Chapter 6. Restrictions and hypothesis tests 77 6.1. Exact linear restrictions 77 6.1.1. Imposition 78 6.1.2. Properties of the restricted estimator 82 6.2. Testing 83
CONTENTS 5 6.2.1. t-test 83 6.2.2. Ftest 86 6.2.3. Wald-type tests 87 6.2.4. Score-type tests (Rao tests, Lagrange multiplier tests) 88 6.2.5. Likelihood ratio-type tests 90 6.3. The asymptotic equivalence of the LR, Wald and score tests 92 6.4. Interpretation of test statistics 96 6.5. Confidence intervals 96 6.6. Bootstrapping 97 6.7. Testing nonlinear restrictions, and the Delta Method 100 6.8. Example: the Nerlove data 104 Chapter 7. Generalized least squares 111 7.1. Effects of nonspherical disturbances on the OLS estimator 112 7.2. The GLS estimator 113 7.3. Feasible GLS 116 7.4. Heteroscedasticity 118 7.4.1. OLS with heteroscedastic consistent varcov estimation 119 7.4.2. Detection 119 7.4.3. Correction 122 7.4.4. Example: the Nerlove model (again!) 125 7.5. Autocorrelation 130 7.5.1. Causes 130 7.5.2. Effects on the OLS estimator 132 7.5.3. AR(1) 132 7.5.4. MA(1) 136 7.5.5. Asymptotically valid inferences with autocorrelation of unknown form 138
CONTENTS 6 7.5.6. Testing for autocorrelation 142 7.5.7. Lagged dependent variables and autocorrelation 144 7.5.8. Examples 145 Exercises 150 Exercises 152 Chapter 8. Stochastic regressors 153 8.1. Case 1 154 8.2. Case 2 155 8.3. Case 3 157 8.4. When are the assumptions reasonable? 157 Exercises 160 Chapter 9. Data problems 161 9.1. Collinearity 161 9.1.1. A brief aside on dummy variables 162 9.1.2. Back to collinearity 163 9.1.3. Detection of collinearity 166 9.1.4. Dealing with collinearity 166 9.2. Measurement error 170 9.2.1. Error of measurement of the dependent variable 170 9.2.2. Error of measurement of the regressors 171 9.3. Missing observations 173 9.3.1. Missing observations on the dependent variable 173 9.3.2. The sample selection problem 176 9.3.3. Missing observations on the regressors 177 Exercises 179
CONTENTS 7 Exercises 179 Exercises 179 Chapter 10. Functional form and nonnested tests 180 10.1. Flexible functional forms 181 10.1.1. The translog form 183 10.1.2. FGLS estimation of a translog model 188 10.2. Testing nonnested hypotheses 192 Chapter 11. Exogeneity and simultaneity 196 11.1. Simultaneous equations 196 11.2. Exogeneity 199 11.3. Reduced form 202 11.4. IV estimation 204 11.5. Identification by exclusion restrictions 210 11.5.1. Necessary conditions 210 11.5.2. Sufficient conditions 213 11.5.3. Example: Klein’s Model 1 219 11.6. 2SLS 222 11.7. Testing the overidentifying restrictions 225 11.8. System methods of estimation 230 11.8.1. 3SLS 232 11.8.2. FIML 237 11.9. Example: 2SLS and Klein’s Model 1 239 Chapter 12. Introduction to the second half 242 Chapter 13. Numeric optimization methods 251
CONTENTS 8 13.1. Search 252 13.2. Derivative-based methods 252 13.2.1. Introduction 252 13.2.2. Steepest descent 254 13.2.3. Newton-Raphson 255 13.3. Simulated Annealing 261 13.4. Examples 261 13.4.1. Discrete Choice: The logit model 261 13.4.2. Count Data: The Poisson model 263 13.4.3. Duration data and the Weibull model 266 13.5. Numeric optimization: pitfalls 270 13.5.1. Poor scaling of the data 270 13.5.2. Multiple optima 271 Exercises 275 Chapter 14. Asymptotic properties of extremum estimators 276 14.1. Extremum estimators 276 14.2. Consistency 277 14.3. Example: Consistency of Least Squares 282 14.4. Asymptotic Normality 283 14.5. Examples 286 14.5.1. Binary response models 286 14.5.2. Example: Linearization of a nonlinear model 290 Chapter 15. Generalized method of moments (GMM) 295 15.1. Definition 295 15.2. Consistency 298
CONTENTS 9 15.3. Asymptotic normality 299 15.4. Choosing the weighting matrix 301 15.5. Estimation of the variance-covariance matrix 304 15.5.1. Newey-West covariance estimator 306 15.6. Estimation using conditional moments 307 15.7. Estimation using dynamic moment conditions 312 15.8. A specification test 312 15.9. Other estimators interpreted as GMM estimators 315 15.9.1. OLS with heteroscedasticity of unknown form 315 15.9.2. Weighted Least Squares 317 15.9.3. 2SLS 318 15.9.4. Nonlinear simultaneous equations 319 15.9.5. Maximum likelihood 320 15.10. Example: The Hausman Test 323 15.11. Application: Nonlinear rational expectations 330 15.12. Empirical example: a portfolio model 335 Chapter 16. Quasi-ML 338 16.1. Consistent Estimation of Variance Components 340 16.2. Example: the MEPS Data 342 16.2.1. Infinite mixture models: the negative binomial model 343 16.2.2. Finite mixture models: the mixed negative binomial model 348 16.2.3. Information criteria 350 Exercises 353 Chapter 17. Nonlinear least squares (NLS) 355 17.1. Introduction and definition 355
LIST OF FIGURES 16 22.2.1 Running an Octave program 443
List of Tables 1 Marginal Variances, Sample and Estimated (Poisson) 342 2 Marginal Variances, Sample and Estimated (NB-II) 348 3 Information Criteria, OBDV 351 1 Actual and Poisson fitted frequencies 464 2 Actual and Hurdle Poisson fitted frequencies 469 17
CHAPTER 1 About this document This document integrates lecture notes for a one year graduate level course with computer programs that illustrate and apply the methods that are studied. The immediate availability of executable (and modifiable) example programs when using the PDF1version of the document is one of the advantages of the system that has been used. On the other hand, when viewed in printed form, the document is a somewhat terse approximation to a textbook. These notes are not intended to be a perfect substitute for a printed textbook. If you are a student of mine, please note that last sentence carefully. There are many good textbooks available. A few of my favorites are listed in the bibliography. With respect to contents, the emphasis is on estimation and inference within the world of stationary data, with a bias toward microeconometrics. The second half is somewhat more polished than the first half, since I have taught that course more often. If you take a moment to read the licensing information in the next section, you’ll see that you are free to copy and modify the document. If anyone would like to contribute material that expands the contents, it would be very welcome. Error corrections and other additions are also welcome. As an example of a project that has made use of these notes, see these very nice lecture slides. 1It is possible to have the program links open up in an editor, ready to run using keyboard macros. To do this with the PDF version you need to do some setup work. See the bootable CD described below. 18
1.2. OBTAINING THE MATERIALS 19 1.1. License All materials are copyrighted by Michael Creel with the date that appears above. They are provided under the terms of the GNU General Public License, which forms Section 24 of the notes. The main thing you need to know is that you are free to modify and distribute these materials in any way you like, as long as you do so under the terms of the GPL. In particular, you must make available the source files, in editable form, for your modified version of the materials. 1.2. Obtaining the materials The materials are available on my web page, in a variety of forms including PDF and the editable sources, at pareto.uab.es/mcreel/Econometrics/. In addition to the final product, which you’re looking at in some form now, you can obtain the editable sources, which will allow you to create your own version, if you like, or send error corrections and contributions. The main document was prepared using LYX (www.lyx.org) and Octave (www.octave.org). L YX is a free2“what you see is what you mean” word processor, basically working as a graphical frontend to L A T EX. It (with help from other applications) can export your work in L A T EX, HTML, PDF and several other forms. It will run on Linux, Windows, and MacOS systems. Figure 1.2.1 shows L YX editing this document. GNU Octave has been used for the example programs, which are scattered though the document. This choice is motivated by two factors. The first is the high quality of the Octave environment for doing applied econometrics. The fundamental tools exist and are implemented in a way that make extending them fairly easy. The example programs included here may convince you of this point. Secondly, Octave’s licensing philosophy fits in with the goals of this project. Thirdly, it runs on Linux, Windows 2”Free” is used in the sense of ”freedom”, but L YX is also free of charge.
1.3. AN EASY WAY TO USE LYX AND OCTAVE TODAY 20 FIGURE 1.2.1. L YX and MacOS. Figure 1.2.2 shows an Octave program being edited by NEdit, and the result of running the program in a shell window. 1.3. An easy way to use L YX and Octave today The example programs are available as links to files on my web page in the PDF version, and here. Support files needed to run these are available here. The files won’t run properly from your browser, since there are dependencies between files - they are only illustrative when browsing. To see how to use these files (edit and run them), you should go to the home page of this document, since you will probably want to download the pdf version together with all the support files and examples. Then set
1.3. AN EASY WAY TO USE LYX AND OCTAVE TODAY 21 FIGURE 1.2.2. Octave the base URL of the PDF file to point to wherever the Octave files are installed. All of this may sound a bit complicated, because it is. An easier solution is available: The file pareto.uab.es/mcreel/Econometrics/econometrics.iso distribution of Linux is an ISO image file that may be burnt to CDROM. It contains a bootable-from-CD Gnu/Linux system that has all of the tools needed to edit this document, run the Octave example programs, etcetera. In particular, it will allow you to cut out small portions of the notes and edit them, and send them to me as L YX (or T EX) files for inclusion in future versions. Think error corrections, additions, etc.! The CD automatically detects the hardware of your computer, and will not touch your hard disk unless you explicitly tell it to do so. It is based upon the ParallelKnoppix GNU/Linux distribution. The
1.4. KNOWN BUGS 22 reason why these notes are integrated into a Linux distribution for parallel computing will be apparent if you get to Chapter 20. 1.4. Known Bugs This section is a reminder to myself to try to fix a few things. •The PDF version has hyperlinks to figures that jump to the wrong figure. The numbers are correct, but the links are not. ps2pdf bugs?
CHAPTER 2 Introduction: Economic and econometric models Economic theory tells us that the demand function for a good is something like: x=x(p,m,z) •xis the quantity demanded •pis G×1 vector of prices of the good and its substitutes and complements •mis income •zis a vector of other variables such as individual characteristics that affect preferences Suppose we have a sample consisting of one observation on nindividuals’ demands at time period t(this is a cross section, where i=1,2,...,nindexes the individuals in the sample). The individual demand functions are xi=xi(pi,mi,zi) The model is not estimable as it stands, since: •The form of the demand function is different for all i. •Some components of zimay not be observable to an outside modeler. For example, people don’t eat the same lunch every day, and you can’t tell what they will order just by looking at them. Suppose we can break ziinto the observable components wiand a single unobservable component εi. 23
2. INTRODUCTION: ECONOMIC AND ECONOMETRIC MODELS 24 A step toward an estimable econometric model is to suppose that the model may be written as xi=β1+p0 iβp+miβm+w0 iβw+εi We have imposed a number of restrictions on the theoretical model: •The functions xi(·)which in principle may differ for all ihave been restricted to all belong to the same parametric family. •Of all parametric families of functions, we have restricted the model to the class of linear in the variables functions. •The parameters are constant across individuals. •There is a single unobservable component, and we assume it is additive. If we assume nothing about the error term ε, we can always write the last equation. But in order for the βcoefficients to have an economic meaning, and in order to be able to estimate them from sample data, we need to make additional assumptions. These additional assumptions have no theoretical basis, they are assumptions on top of those needed to prove the existence of a demand function. The validity of any results we obtain using this model will be contingent on these additional restrictions being at least approximately correct. For this reason, specification testing will be needed, to check that the model seems to be reasonable. Only when we are convinced that the model is at least approximately correct should we use it for economic analysis. When testing a hypothesis using an econometric model, three factors can cause a statistical test to reject the null hypothesis: (1) the hypothesis is false (2) a type I error has occured (3) the econometric model is not correctly specified so the test does not have the assumed distribution
2. INTRODUCTION: ECONOMIC AND ECONOMETRIC MODELS 25 We would like to ensure that the third reason is not contributing to rejections, so that rejection will be due to either the first or second reasons. Hopefully the above example makes it clear that there are many possible sources of misspecification of econometric models. In the next few sections we will obtain results supposing that the econometric model is entirely correctly specified. Later we will examine the consequences of misspecification and see some methods for determining if a model is correctly specified. Later on, econometric methods that seek to minimize maintained assumptions are introduced.
3.3. GEOMETRIC INTERPRETATION OF LEAST SQUARES ESTIMATION 32 3.3.3. Projection Matrices. Xˆ βis the projection of yonto the span of X,or Xˆ β=XX0X−1X0y Therefore, the matrix that projects yonto the span of Xis PX=X(X0X)−1X0 since Xˆ β=PXy. ˆ εis the projection of yonto the N−Kdimensional space that is orthogonal to the span of X. We have that ˆ ε=y−Xˆ β =y−X(X0X)−1X0y =In−X(X0X)−1X0y. So the matrix that projects yonto the space orthogonal to the span of Xis MX=In−X(X0X)−1X0 =In−PX. We have ˆ ε=MXy. Therefore y=PXy+MXy =Xˆ β+ˆ ε.
3.4. INFLUENTIAL OBSERVATIONS AND OUTLIERS 33 These two projection matrices decompose the ndimensional vector yinto two orthogonal components - the portion that lies in the Kdimensional space defined by X,and the portion that lies in the orthogonal n−Kdimensional space. •Note that both PXand MXare symmetric and idempotent. –A symmetric matrix Ais one such that A=A0. –An idempotent matrix Ais one such that A=AA. –The only nonsingular idempotent matrix is the identity matrix. 3.4. Influential observations and outliers The OLS estimator of the ith element of the vector β0is simply ˆ βi=(X0X)−1X0i·y =c0 iy This is how we define a linear estimator - it’s a linear function of the dependent variable. Since it’s a linear combination of the observations on the dependent variable, where the weights are detemined by the observations on the regressors, some observations may have more influence than others. Define ht= (PX)tt =e0 tPXet =kPXetk2 ≤ ketk2=1
3.4. INFLUENTIAL OBSERVATIONS AND OUTLIERS 34 htis the tth element on the main diagonal of PX(etis a nvector of zeros with a 1 in the tth position). So 0 <ht<1,and TrPX=K⇒h=K/n. So, on average, the weight on the yt’s is K/n. If the weight is much higher, then the observation has the potential to affect the fit importantly. The weight, htis referred to as the leverage of the observation. However, an observation may also be influential due to the value of yt, rather than the weight it is multiplied by, which only depends on the xt’s. To account for this, consider estimation of βwithout using the tth observation (designate this estimator as ˆ β(t)).One can show (see Davidson and MacKinnon, pp. 32-5 for proof) that ˆ β(t)=ˆ β−1 1−ht(X0X)−1X0 tˆ εt so the change in the tth observations fitted value is Xtˆ β−Xtˆ β(t)=ht 1−htˆ εt While an observation may be influential if it doesn’t affect its own fitted value, it certainly is influential if it does. A fast means of identifying influential observations is to plot ht 1−htˆ εt(which I will refer to as the own influence of the observation) as a function of t. Figure 3.4.1 gives an example plot of data, fit, leverage and influence. The Octave program is InfluentialObservation.m . If you re-run the program you will see that the leverage of the last observation (an outlying value of x) is always high, and the influence is sometimes high. After influential observations are detected, one needs to determine why they are influential. Possible causes include:
3.5. GOODNESS OF FIT 35 FIGURE 3.4.1. Detection of influential observations -2 0 2 4 6 8 10 12 14 0 0.5 1 1.5 2 2.5 3 X Data points fitted Leverage Influence •data entry error, which can easily be corrected once detected. Data entry errors are very common. •special economic factors that affect some observations. These would need to be identified and incorporated in the model. This is the idea behind structural change: the parameters may not be constant across all observations. •pure randomness may have caused us to sample a low-probability observation. There exist robust estimation methods that downweight outliers. 3.5. Goodness of fit The fitted model is y=Xˆ β+ˆ ε
3.5. GOODNESS OF FIT 36 Take the inner product: y0y=ˆ β0X0Xˆ β+2ˆ β0X0ˆ ε+ˆ ε0ˆ ε But the middle term of the RHS is zero since X0ˆ ε=0, so (3.5.1) y0y=ˆ β0X0Xˆ β+ˆ ε0ˆ ε The uncentered R2 uis defined as R2 u=1−ˆ ε0ˆ ε y0y = ˆ β0X0Xˆ β y0y =kPXyk2 kyk2 =cos2(φ), where φis the angle between yand the span of X. •The uncentered R2changes if we add a constant to y,since this changes φ (see Figure 3.5.1, the yellow vector is a constant, since it’s on the 45 degree line in observation space). Another, more common definition measures the contribution of the variables, other than the constant term, to explaining the variation in y.Thus it measures the ability of the model to explain the variation of yabout its unconditional sample mean. Let ι= (1,1,...,1)0,an-vector. So Mι=In−ι(ι0ι)−1ι0 =In−ιι0/n
3.5. GOODNESS OF FIT 37 FIGURE 3.5.1. Uncentered R2 Mιyjust returns the vector of deviations from the mean. In terms of deviations from the mean, equation 3.5.1 becomes y0Mιy=ˆ β0X0MιXˆ β+ˆ ε0Mιˆ ε The centered R2 cis defined as R2 c=1−ˆ ε0ˆ ε y0Mιy=1−ESS T SS where ESS =ˆ ε0ˆ εand TSS =y0Mιy=∑n t=1(yt−¯y)2. Supposing that Xcontains a column of ones (i.e., there is a constant term), X0ˆ ε=0⇒∑ t ˆ εt=0
3.6. THE CLASSICAL LINEAR REGRESSION MODEL 38 so Mιˆ ε=ˆ ε.In this case y0Mιy=ˆ β0X0MιXˆ β+ˆ ε0ˆ ε So R2 c=RSS TSS where RSS =ˆ β0X0MιXˆ β •Supposing that a column of ones is in the space spanned by X(PXι=ι),then one can show that 0 ≤R2 c≤1. 3.6. The classical linear regression model Up to this point the model is empty of content beyond the definition of a best linear approximation to yand some geometrical properties. There is no economic content to the model, and the regression parameters have no economic interpretation. For example, what is the partial derivative of ywith respect to xj? The linear approximation is y=β1x1+β2x2+...+βkxk+ε The partial derivative is ∂y ∂xj =βj+∂ε ∂xj Up to now, there’s no guarantee that ∂ε ∂xj=0. For the βto have an economic meaning, we need to make additional assumptions. The assumptions that are appropriate to make depend on the data under consideration. We’ll start with the classical linear regression model, which incorporates some assumptions that are clearly not realistic for economic data. This is to be able to explain some concepts with a minimum of confusion and notational clutter. Later we’ll adapt the results to what we can get with more realistic assumptions.
3.6. THE CLASSICAL LINEAR REGRESSION MODEL 39 Linearity: the model is a linear function of the parameter vector β0: y=β0 1x1+β0 2x2+...+β0 kxk+ε(3.6.1) or, using vector notation: y=x0β0+ε Nonstochastic linearly independent regressors:Xis a fixed matrix of constants, it has rank K, its number of columns, and 3.6.2 lim 1 nX0X=QX (3.6.2) where QXis a finite positive definite matrix. This is needed to be able to identify the individual effects of the explanatory variables. Independently and identically distributed errors: (3.6.3) ε∼IID(0,σ2In) εis jointly distributed IIN. This implies the following two properties: Homoscedastic errors: (3.6.4) V(εt) = σ2 0,∀t Nonautocorrelated errors: (3.6.5) E(εtεs) = 0,∀t6=s Optionally, we will sometimes assume that the errors are normally distributed.
3.7. SMALL SAMPLE STATISTICAL PROPERTIES OF THE LEAST SQUARES ESTIMATOR 40 Normally distributed errors: (3.6.6) ε∼N(0,σ2In) 3.7. Small sample statistical properties of the least squares estimator Up to now, we have only examined numeric properties of the OLS estimator, that always hold. Now we will examine statistical properties. The statistical properties depend upon the assumptions we can make. 3.7.1. Unbiasedness. We have ˆ β= (X0X)−1X0y. By linearity, ˆ β= (X0X)−1X0(Xβ+ε) =β+(X0X)−1X0ε By 3.6.2 and 3.6.3 E(X0X)−1X0ε=E(X0X)−1X0ε = (X0X)−1X0Eε =0 so the OLS estimator is unbiased under the assumptions of the classical model. Figure 3.7.1 shows the results of a small Monte Carlo experiment where the OLS estimator was calculated for 10000 samples from the classical model with y=1+2x+ ε, where n=20, σ2 ε=9, and xis fixed across samples. We can see that the β2appears to be estimated without bias. The program that generates the plot is Unbiased.m , if you would like to experiment with this. With time series data, the OLS estimator will often be biased. Figure 3.7.2 shows the results of a small Monte Carlo experiment where the OLS estimator was calculated
3.7. SMALL SAMPLE STATISTICAL PROPERTIES OF THE LEAST SQUARES ESTIMATOR 41 FIGURE 3.7.1. Unbiasedness of OLS under classical assumptions 0 0.02 0.04 0.06 0.08 0.1 0.12 -3 -2 -1 0 1 2 3 Beta hat - Beta true for 1000 samples from the AR(1) model with yt=0+0.9yt−1+εt, where n=20 and σ2 ε=1. In this case, assumption 3.6.2 does not hold: the regressors are stochastic. We can see that the bias in the estimation of β2is about -0.2. The program that generates the plot is Biased.m , if you would like to experiment with this. 3.7.2. Normality. With the linearity assumption, we have ˆ β=β+ (X0X)−1X0ε. This is a linear function of ε. Adding the assumption of normality (3.6.6, which implies strong exogeneity), then ˆ β∼Nβ,(X0X)−1σ2 0 since a linear function of a normal random vector is also normally distributed. In Figure 3.7.1 you can see that the estimator appears to be normally distributed. It in fact is normally distributed, since the DGP (see the Octave program) has normal errors.
3.8. EXAMPLE: THE NERLOVE MODEL 48 demands are homogeneous of degree zero in factor prices - they only depend upon relative prices. •Returns to scale The returns to scale parameter γis defined as the inverse of the elasticity of cost with respect to output: γ=∂C(w,q) ∂q q C(w,q)−1 Constant returns to scale is the case where increasing production qimplies that cost increases in the proportion 1:1. If this is the case, then γ=1. 3.8.2. Cobb-Douglas functional form. The Cobb-Douglas functional form is linear in the logarithms of the regressors and the dependent variable. For a cost function, if there are gfactors, the Cobb-Douglas cost function has the form C=Awβ1 1...wβg gqβqeε What is the elasticity of Cwith respect to wj? eC wj=∂C ∂WJwj C =βjAwβ1 1.wβj−1 j..wβg gqβqeεwj Awβ1 1...wβg gqβqeε =βj This is one of the reasons the Cobb-Douglas form is popular - the coefficients are easy to interpret, since they are the elasticities of the dependent variable with respect to the
3.8. EXAMPLE: THE NERLOVE MODEL 49 explanatory variable. Not that in this case, eC wj=∂C ∂WJwj C =xj(w,q)wj C ≡sj(w,q) the cost share of the jth input. So with a Cobb-Douglas cost function, βj=sj(w,q). The cost shares are constants. Note that after a logarithmic transformation we obtain lnC=α+β1lnw1+...+βglnwg+βqlnq+ε where α=lnA. So we see that the transformed model is linear in the logs of the data. One can verify that the property of HOD1 implies that g ∑ i=1 βg=1 In other words, the cost shares add up to 1. The hypothesis that the technology exhibits CRTS implies that γ=1 βq =1 so βq=1.Likewise, monotonicity implies that the coefficients βi≥0,i=1,...,g. 3.8.3. The Nerlove data and OLS. The file nerlove.data contains data on 145 electric utility companies’ cost of production, output and input prices. The data are for the U.S., and were collected by M. Nerlove. The observations are by row, and the columns are COMPANY, COST (C), OUTPUT (Q),PRICE OF LABOR (PL),
3.8. EXAMPLE: THE NERLOVE MODEL 50 PRICE OF FUEL (PF)and PRICE OF CAPITAL (PK).Note that the data are sorted by output level (the third column). We will estimate the Cobb-Douglas model (3.8.1) lnC=β1+β2lnQ+β3lnPL+β4lnPF+β5lnPK+ε using OLS. To do this yourself, you need the data file mentioned above, as well as Nerlove.m (the estimation program) , and the library of Octave functions mentioned in the introduction to Octave that forms section 22 of this document.3 The results are ********************************************************* OLS estimation results Observations 145 R-squared 0.925955 Sigma-squared 0.153943 Results (Ordinary var-cov estimator) estimate st.err. t-stat. p-value constant -3.527 1.774 -1.987 0.049 output 0.720 0.017 41.244 0.000 labor 0.436 0.291 1.499 0.136 fuel 0.427 0.100 4.249 0.000 capital -0.220 0.339 -0.648 0.518 ********************************************************* •Do the theoretical restrictions hold? •Does the model fit well? •What do you think about RTS? While we will use Octave programs as examples in this document, since following the programming statements is a useful way of learning how theory is put into practice, 3If you are running the bootable CD, you have all of this installed and ready to run.
3.8. EXAMPLE: THE NERLOVE MODEL 51 you may be interested in a more ”user-friendly” environment for doing econometrics. I heartily recommend Gretl, the Gnu Regression, Econometrics, and Time-Series Library. This is an easy to use program, available in English, French, and Spanish, and it comes with a lot of data ready to use. It even has an option to save output as L A T EX fragments, so that I can just include the results into this document, no muss, no fuss. Here the results of the Nerlove model from GRETL: Model 2: OLS estimates using the 145 observations 1–145 Dependent variable: l_cost Variable Coefficient Std. Error t-statistic p-value const −3.5265 1.77437 −1.9875 0.0488 l_output 0.720394 0.0174664 41.2445 0.0000 l_labor 0.436341 0.291048 1.4992 0.1361 l_fuel 0.426517 0.100369 4.2495 0.0000 l_capita −0.219888 0.339429 −0.6478 0.5182 Mean of dependent variable 1.72466 S.D. of dependent variable 1.42172 Sum of squared residuals 21.5520 Standard error of residuals ( ˆ σ) 0.392356 Unadjusted R20.925955 Adjusted ¯ R20.923840 F(4,140)437.686 Akaike information criterion 145.084 Schwarz Bayesian criterion 159.967
3.8. EXAMPLE: THE NERLOVE MODEL 52 Fortunately, Gretl and my OLS program agree upon the results. Gretl is included in the bootable CD mentioned in the introduction. I recommend using GRETL to repeat the examples that are done using Octave. The previous properties hold for finite sample sizes. Before considering the asymptotic properties of the OLS estimator it is useful to review the MLE estimator, since under the assumption of normal errors the two estimators coincide.
EXERCISES 53 Exercises (1) Prove that the split sample estimator used to generate figure 3.7.4 is unbiased. (2) Calculate the OLS estimates of the Nerlove model using Octave and GRETL, and provide printouts of the results. Interpret the results. (3) Do an analysis of whether or not there are influential observations for OLS estimation of the Nerlove model. Discuss. (4) Using GRETL, examine the residuals after OLS estimation and tell me whether or not you believe that the assumption of independent identically distributed normal errors is warranted. No need to do formal tests, just look at the plots. Print out any that you think are relevant, and interpret them. (5) For a random vector X∼N(µx,Σ),what is the distribution of AX +b, where Aand bare conformable matrices of contants? (6) Using Octave, write a little program that verifies that Tr(AB) = Tr(BA)for Aand B4x4 matrices of random numbers. Note: there is an Octave function trace. (7) For the model with a constant and a single regressor, yt=β1+β2xt+εt, which satisfies the classical assumptions, prove that the variance of the OLS estimator declines to zero as the sample size increases.
CHAPTER 4 Maximum likelihood estimation The maximum likelihood estimator is important since it is asymptotically efficient, as is shown below. For the classical linear model with normal errors, the ML and OLS estimators of βare the same, so the following theory is presented without examples. In the second half of the course, nonlinear models with nonnormal errors are introduced, and examples may be found there. 4.1. The likelihood function Suppose we have a sample of size nof the random vectors yand z. Suppose the joint density of Y=y1... ynand Z=z1... znis characterized by a parameter vector ψ0: fYZ(Y,Z,ψ0). This is the joint density of the sample. This density can be factored as fYZ(Y,Z,ψ0) = fY|Z(Y|Z,θ0)fZ(Z,ρ0) The likelihood function is just this density evaluated at other values ψ L(Y,Z,ψ) = f(Y,Z,ψ),ψ∈Ψ, where Ψis a parameter space. The maximum likelihood estimator of ψ0is the value of ψthat maximizes the likelihood function. 54
4.1. THE LIKELIHOOD FUNCTION 55 Note that if θ0and ρ0share no elements, then the maximizer of the conditional likelihood function fY|Z(Y|Z,θ)with respect to θis the same as the maximizer of the overall likelihood function fY Z(Y,Z,ψ) = fY|Z(Y|Z,θ)fZ(Z,ρ), for the elements of ψthat correspond to θ. In this case, the variables Zare said to be exogenous for estimation of θ, and we may more conveniently work with the conditional likelihood function fY|Z(Y|Z,θ)for the purposes of estimating θ0. DEFINITION 4.1.1. The maximum likelihood estimator of θ0=argmax fY|Z(Y|Z,θ) •If the nobservations are independent, the likelihood function can be written as L(Y|Z,θ) = n ∏ t=1 f(yt|zt,θ) where the ftare possibly of different form. •If this is not possible, we can always factor the likelihood into contributions of observations, by using the fact that a joint density can be factored into the product of a marginal and conditional (doing this iteratively) L(Y,θ) = f(y1|z1,θ)f(y2|y1,z2,θ)f(y3|y1,y2,z3,θ)···f(yn|y1,y2,...yt−n,zn,θ) To simplify notation, define xt={y1,y2,...,yt−1,zt} so x1=z1,x2={y1,z2},etc. - it contains exogenous and predetermined endogeous variables. Now the likelihood function can be written as L(Y,θ) = n ∏ t=1 f(yt|xt,θ)
4.1. THE LIKELIHOOD FUNCTION 56 The criterion function can be defined as the average log-likelihood function: sn(θ) = 1 nlnL(Y,θ) = 1 n n ∑ t=1 ln f(yt|xt,θ) The maximum likelihood estimator may thus be defined equivalently as ˆ θ=argmaxsn(θ), where the set maximized over is defined below. Since ln(·)is a monotonic increasing function, lnLand Lmaximize at the same value of θ.Dividing by nhas no effect on ˆ θ. 4.1.1. Example: Bernoulli trial. Suppose that we are flipping a coin that may be biased, so that the probability of a heads may not be 0.5. Maybe we’re interested in estimating the probability of a heads. Let y=1(heads)be a binary variable that indicates whether or not a heads is observed. The outcome of a toss is a Bernoulli random variable: fY(y,p0) = py 0(1−p0)1−y,y∈{0,1} =0,y/∈{0,1} So a representative term that enters the likelihood function is fY(y,p) = py(1−p)1−y and ln fY(y,p) = yln p+ (1−y)ln(1−p)
4.1. THE LIKELIHOOD FUNCTION 57 The derivative of this is ∂ln fY(y,p) ∂p=y p−(1−y) (1−p) =y−p p(1−p) Averaging this over a sample of size ngives ∂sn(p) ∂p=1 n n ∑ i=1 yi−p p(1−p) Setting to zero and solving gives ˆp=¯y So it’s easy to calculate the MLE of p0in this case. Now imagine that we had a bag full of bent coins, each bent around a sphere of a different radius (with the head pointing to the outside of the sphere). We might suspect that the probability of a heads could depend upon the radius. Suppose that pi≡p(xi,β) = (1+exp(−x0 iβ))−1where xi=h1rii0, so that βis a 2×1 vector. Now ∂pi(β) ∂β =pi(1−pi)xi so ∂ln fY(y,β) ∂β =y−pi pi(1−pi)pi(1−pi)xi = (yi−p(xi,β))xi
4.4. ASYMPTOTIC NORMALITY OF MLE 64 Now consider √ng(θ0).This is √ngn(θ0) = √nDθsn(θ) =√n n n ∑ t=1 Dθln ft(yt|xt,θ0) =1 √n n ∑ t=1 gt(θ0) We’ve already seen that Eθ[gt(θ)] = 0.As such, it is reasonable to assume that a CLT applies. Note that gn(θ0)a.s. →0,by consistency. To avoid this collapse to a degenerate r.v. (a constant vector) we need to scale by √n.A generic CLT states that, for Xna random vector that satisfies certain conditions, Xn−E(Xn)d →N(0,limV(Xn)) The “certain conditions” that Xnmust satisfy depend on the case at hand. Usually, Xn will be of the form of an average, scaled by √n: Xn=√n∑n t=1Xt n This is the case for √ng(θ0)for example. Then the properties of Xndepend on the properties of the Xt.For example, if the Xthave finite variances and are not too strongly dependent, then a CLT for dependent processes will apply. Supposing that a CLT applies, and noting that E(√ngn(θ0) = 0,we get I∞(θ0)−1/2√ngn(θ0)d →N[0,IK]
4.4. ASYMPTOTIC NORMALITY OF MLE 65 where I∞(θ0) = lim n→∞Eθ0n[gn(θ0)][gn(θ0)]0 =lim n→∞Vθ0√ngn(θ0) This can also be written as (4.4.2) √ngn(θ0)d →N[0,I∞(θ0)] •I∞(θ0)is known as the information matrix. •Combining [4.4.1] and [4.4.2], we get √nˆ θ−θ0a ∼N0,H∞(θ0)−1I∞(θ0)H∞(θ0)−1. The MLE estimator is asymptotically normally distributed. DEFINITION 1 (CAN). An estimator ˆ θof a parameter θ0is √n-consistent and asymptotically normally distributed if (4.4.3) √nˆ θ−θ0d →N(0,V∞) where V∞is a finite positive definite matrix. There do exist, in special cases, estimators that are consistent such that √nˆ θ−θ0p → 0.These are known as superconsistent estimators, since normally, √nis the highest factor that we can multiply by an still get convergence to a stable limiting distribution. DEFINITION 2 (Asymptotic unbiasedness). An estimator ˆ θof a parameter θ0is asymptotically unbiased if (4.4.4) lim n→∞Eθ(ˆ θ) = θ.
4.6. THE INFORMATION MATRIX EQUALITY 66 Estimators that are CAN are asymptotically unbiased, though not all consistent estimators are asymptotically unbiased. Such cases are unusual, though. An example is EXERCISE 4.5. Consider an estimator ˆ θwith density f(ˆ θ) = 1−1 n,ˆ θ=θ0 1 n,ˆ θ=n Show that this estimator is consistent but asymptotically biased. Also ask yourself how you could define an estimator that would have this density. 4.6. The information matrix equality We will show that H∞(θ) = −I∞(θ).Let ft(θ)be short for f(yt|xt,θ) 1=Zft(θ)dy,so 0=ZDθft(θ)dy =Z(Dθln ft(θ)) ft(θ)dy Now differentiate again: 0=ZD2 θln ft(θ)ft(θ)dy +Z[Dθln ft(θ)]Dθ0ft(θ)dy =EθD2 θln ft(θ)+Z[Dθln ft(θ)][Dθ0ln ft(θ)] ft(θ)dy =EθD2 θln ft(θ)+Eθ[Dθln ft(θ)][Dθ0ln ft(θ)] =Eθ[Ht(θ)]+Eθ[gt(θ)][gt(θ)]0 (4.6.1)
4.6. THE INFORMATION MATRIX EQUALITY 67 Now sum over nand multiply by 1 n Eθ 1 n n ∑ t=1 [Ht(θ)] = −Eθ"1 n n ∑ t=1 [gt(θ)][gt(θ)]0# The scores gtand gsare uncorrelated for t6=s,since for t>s,ft(yt|y1,...,yt−1,θ)has conditioned on prior information, so what was random in sis fixed in t. (This forms the basis for a specification test proposed by White: if the scores appear to be correlated one may question the specification of the model). This allows us to write Eθ[H(θ)] = −Eθn[g(θ)][g(θ)]0 since all cross products between different periods expect to zero. Finally take limits, we get (4.6.2) H∞(θ) = −I∞(θ). This holds for all θ,in particular, for θ0.Using this, √nˆ θ−θ0a.s. →N0,H∞(θ0)−1I∞(θ0)H∞(θ0)−1 simplifies to (4.6.3) √nˆ θ−θ0a.s. →N0,I∞(θ0)−1 To estimate the asymptotic variance, we need estimators of H∞(θ0)and I∞(θ0). We can use \ I∞(θ0) = n n ∑ t=1 gt(ˆ θ)gt(ˆ θ)0 \ H∞(θ0) = H(ˆ θ).
4.7. THE CRAMÉR-RAO LOWER BOUND 68 Note, one can’t use \ I∞(θ0) = ngn(ˆ θ)gn(ˆ θ)0 to estimate the information matrix. Why not? From this we see that there are alternative ways to estimate V∞(θ0)that are all valid. These include \ V∞(θ0) = − \ H∞(θ0)−1 \ V∞(θ0) = \ I∞(θ0)−1 \ V∞(θ0) = \ H∞(θ0)−1\ I∞(θ0) \ H∞(θ0)−1 These are known as the inverse Hessian, outer product of the gradient (OPG) and sandwich estimators, respectively. The sandwich form is the most robust, since it coincides with the covariance estimator of the quasi-ML estimator. 4.7. The Cramér-Rao lower bound THEOREM 3. [Cramer-Rao Lower Bound] The limiting variance of a CAN estimator of θ0, say ˜ θ, minus the inverse of the information matrix is a positive semidefinite matrix. Proof: Since the estimator is CAN, it is asymptotically unbiased, so lim n→∞Eθ(˜ θ−θ) = 0 Differentiate wrt θ0: Dθ0lim n→∞Eθ(˜ θ−θ) = lim n→∞ZDθ0f(Y,θ)˜ θ−θdy =0(this is a K×Kmatrix of zeros).
4.7. THE CRAMÉR-RAO LOWER BOUND 69 Noting that Dθ0f(Y,θ) = f(θ)Dθ0ln f(θ),we can write lim n→∞Z˜ θ−θf(θ)Dθ0ln f(θ)dy +lim n→∞Zf(Y,θ)Dθ0˜ θ−θdy =0. Now note that Dθ0˜ θ−θ=−IK,and Rf(Y,θ)(−IK)dy =−IK.With this we have lim n→∞Z˜ θ−θf(θ)Dθ0ln f(θ)dy =IK. Playing with powers of nwe get lim n→∞Z√n˜ θ−θ√n1 n[Dθ0ln f(θ)] |{z } f(θ)dy =IK Note that the bracketed part is just the transpose of the score vector, g(θ),so we can write lim n→∞Eθ√n˜ θ−θ√ng(θ)0=IK This means that the covariance of the score function with √n˜ θ−θ,for ˜ θany CAN estimator, is an identity matrix. Using this, suppose the variance of √n˜ θ−θtends to V∞(˜ θ).Therefore, (4.7.1) V∞ √n˜ θ−θ √ng(θ) = V∞(˜ θ)IK IKI∞(θ) . Since this is a covariance matrix, it is positive semi-definite. Therefore, for any K -vector α, hα0−α0I−1 ∞(θ)i V∞(˜ θ)IK IKI∞(θ) α −I∞(θ)−1α ≥0. This simplifies to α0V∞(˜ θ)−I−1 ∞(θ)α≥0.
4.7. THE CRAMÉR-RAO LOWER BOUND 70 Since αis arbitrary, V∞(˜ θ)−I∞(θ)is positive semidefinite. This conludes the proof. This means that I−1 ∞(θ)is a lower bound for the asymptotic variance of a CAN estimator. DEFINITION 4.7.1. (Asymptotic efficiency) Given two CAN estimators of a parameter θ0, say ˜ θand ˆ θ,ˆ θis asymptotically efficient with respect to ˜ θif V∞(˜ θ)−V∞(ˆ θ)is a positive semidefinite matrix. A direct proof of asymptotic efficiency of an estimator is infeasible, but if one can show that the asymptotic variance is equal to the inverse of the information matrix, then the estimator is asymptotically efficient. In particular, the MLE is asymptotically efficient. Summary of MLE •Consistent •Asymptotically normal (CAN) •Asymptotically efficient •Asymptotically unbiased •This is for general MLE: we haven’t specified the distribution or the linearity/nonlinearity of the estimator
EXERCISES 71 Exercises (1) Consider coin tossing with a single possibly biased coin. The density function for the random variable y=1(heads)is fY(y,p0) = py 0(1−p0)1−y,y∈{0,1} =0,y/∈{0,1} Suppose that we have a sample of size n. We know from above that the ML estimator is bp0=¯y. We also know from the theory above that √n(¯y−p0)a ∼N0,H∞(p0)−1I∞(p0)H∞(p0)−1 a) find the analytical expressions for H∞(p0)and I∞(p0)for this problem b) Write an Octave program that does a Monte Carlo study that shows that √n(¯y−p0) is approximately normally distributed when nis large. Please give me histograms that show the sampling frequency of √n(¯y−p0)for several values of n. (2) Consider the model yt=x0 tβ+αεtwhere the errors follow the Cauchy (Student-t with 1 degree of freedom) density. So f(εt) = 1 π1+ε2 t,−∞<εt<∞ The Cauchy density has a shape similar to a normal density, but with much thicker tails. Thus, extremely small and large errors occur much more frequently with this density than would happen if the errors were normally distributed. Find the score function gn(θ)where θ=β0α0. (3) Consider the model classical linear regression model yt=x0 tβ+εtwhere εt∼ IIN(0,σ2). Find the score function gn(θ)where θ=β0σ0.
EXERCISES 72 (4) Compare the first order conditional that define the ML estimators of problems 2 and 3 and interpret the differences. Why are the first order conditions that define an efficient estimator different in the two cases?
CHAPTER 5 Asymptotic properties of the least squares estimator The OLS estimator under the classical assumptions is unbiased and BLUE, for all sample sizes. Now let’s see what happens when the sample size tends to infinity. 5.1. Consistency ˆ β= (X0X)−1X0y = (X0X)−1X0(Xβ+ε) =β0+(X0X)−1X0ε =β0+X0X n−1X0ε n Consider the last two terms. By assumption limn→∞X0X n=QX⇒limn→∞X0X n−1= Q−1 X,since the inverse of a nonsingular matrix is a continuous function of the elements of the matrix. Considering X0ε n, X0ε n=1 n n ∑ t=1 xtεt Each xtεthas expectation zero, so EX0ε n=0 73
6.1. EXACT LINEAR RESTRICTIONS 80 so (everyone should start paying attention again) ˆ βR ˆ λ = (X0X)−1−(X0X)−1R0P−1R(X0X)−1(X0X)−1R0P−1 P−1R(X0X)−1−P−1 X0y r = ˆ β−(X0X)−1R0P−1Rˆ β−r P−1Rˆ β−r = IK−(X0X)−1R0P−1R P−1R ˆ β+ (X0X)−1R0P−1r −P−1r The fact that ˆ βRand ˆ λare linear functions of ˆ βmakes it easy to determine their distributions, since the distribution of ˆ βis already known. Recall that for xa random vector, and for Aand ba matrix and vector of constants, respectively, Var (Ax +b) = AVar(x)A0. Though this is the obvious way to go about finding the restricted estimator, an easier way, if the number of restrictions is small, is to impose them by substitution. Write y=X1β1+X2β2+ε hR1R2i β1 β2 =r where R1is Q×Qnonsingular. Supposing the Qrestrictions are linearly independent, one can always make R1nonsingular by reorganizing the columns of X.Then β1=R−1 1r−R−1 1R2β2.
6.1. EXACT LINEAR RESTRICTIONS 81 Substitute this into the model y=X1R−1 1r−X1R−1 1R2β2+X2β2+ε y−X1R−1 1r=hX2−X1R−1 1R2iβ2+ε or with the appropriate definitions, yR=XRβ2+ε. This model satisfies the classical assumptions, supposing the restriction is true. One can estimate by OLS. The variance of ˆ β2is as before V(ˆ β2) = X0 RXR−1σ2 0 and the estimator is ˆ V(ˆ β2) = X0 RXR−1ˆ σ2 where one estimates σ2 0in the normal way, using the restricted model, i.e., c σ2 0=yR−XRb β20yR−XRb β2 n−(K−Q) To recover ˆ β1,use the restriction. To find the variance of ˆ β1,use the fact that it is a linear function of ˆ β2,so V(ˆ β1) = R−1 1R2V(ˆ β2)R0 2R−1 10 =R−1 1R2X0 2X2−1R0 2R−1 10σ2 0
6.1. EXACT LINEAR RESTRICTIONS 82 6.1.2. Properties of the restricted estimator. We have that ˆ βR=ˆ β−(X0X)−1R0P−1Rˆ β−r =ˆ β+(X0X)−1R0P−1r−(X0X)−1R0P−1R(X0X)−1X0y =β+(X0X)−1X0ε+(X0X)−1R0P−1[r−Rβ]−(X0X)−1R0P−1R(X0X)−1X0ε ˆ βR−β= (X0X)−1X0ε + (X0X)−1R0P−1[r−Rβ] −(X0X)−1R0P−1R(X0X)−1X0ε Mean squared error is MSE(ˆ βR) = E(ˆ βR−β)(ˆ βR−β)0 Noting that the crosses between the second term and the other terms expect to zero, and that the cross of the first and third has a cancellation with the square of the third, we obtain MSE(ˆ βR) = (X0X)−1σ2 + (X0X)−1R0P−1[r−Rβ][r−Rβ]0P−1R(X0X)−1 −(X0X)−1R0P−1R(X0X)−1σ2 So, the first term is the OLS covariance. The second term is PSD, and the third term is NSD. •If the restriction is true, the second term is 0, so we are better off. True restrictions improve efficiency of estimation. •If the restriction is false, we may be better or worse off, in terms of MSE, depending on the magnitudes of r−Rβand σ2.
6.2. TESTING 83 6.2. Testing In many cases, one wishes to test economic theories. If theory suggests parameter restrictions, as in the above homogeneity example, one can test theory by testing parameter restrictions. A number of tests are available. 6.2.1. t-test. Suppose one has the model y=Xβ+ε and one wishes to test the single restriction H0:Rβ=rvs. HA:Rβ6=r. Under H0, with normality of the errors, Rˆ β−r∼N0,R(X0X)−1R0σ2 0 so Rˆ β−r qR(X0X)−1R0σ2 0 =Rˆ β−r σ0pR(X0X)−1R0∼N(0,1). The problem is that σ2 0is unknown. One could use the consistent estimator c σ2 0in place of σ2 0,but the test would only be valid asymptotically in this case. PROPOSITION 4. (6.2.1) N(0,1) qχ2(q) q ∼t(q) as long as the N(0,1)and the χ2(q)are independent. We need a few results on the χ2distribution. PROPOSITION 5. If x∼N(µ,In)is a vector of nindependent r.v.’s., then (6.2.2) x0x∼χ2(n,λ)
6.2. TESTING 84 where λ=∑iµ2 i=µ0µis the noncentrality parameter. When a χ2r.v. has the noncentrality parameter equal to zero, it is referred to as a central χ2r.v., and it’s distribution is written as χ2(n),suppressing the noncentrality parameter. PROPOSITION 6. If the ndimensional random vector x∼N(0,V),then x0V−1x∼ χ2(n). We’ll prove this one as an indication of how the following unproven propositions could be proved. Proof: Factor V−1as PP0(this is the Cholesky factorization). Then consider y= P0x.We have y∼N(0,P0VP) but VPP0=In P0VPP0=P0 so PV P0=Inand thus y∼N(0,In). Thus y0y∼χ2(n)but y0y=x0PP0x=xV −1x and we get the result we wanted. A more general proposition which implies this result is PROPOSITION 7. If the ndimensional random vector x∼N(0,V),then (6.2.3) x0Bx ∼χ2(ρ(B)) if and only if BV is idempotent.
6.2. TESTING 85 An immediate consequence is PROPOSITION 8. If the random vector (of dimension n)x∼N(0,I),and Bis idempotent with rank r,then (6.2.4) x0Bx ∼χ2(r). Consider the random variable ˆ ε0ˆ ε σ2 0 =ε0MXε σ2 0 =ε σ00MXε σ0 ∼χ2(n−K) PROPOSITION 9. If the random vector (of dimension n)x∼N(0,I),then Ax and x0Bx are independent if AB =0. Now consider (remember that we have only one restriction in this case) Rˆ β−r σ0√R(X0X)−1R0 qˆ ε0ˆ ε (n−K)σ2 0 =Rˆ β−r c σ0pR(X0X)−1R0 This will have the t(n−K)distribution if ˆ βand ˆ ε0ˆ εare independent. But ˆ β=β+ (X0X)−1X0εand (X0X)−1X0MX=0, so Rˆ β−r c σ0pR(X0X)−1R0=Rˆ β−r ˆ σRˆ β∼t(n−K)
6.2. TESTING 86 In particular, for the commonly encountered test of significance of an individual coefficient, for which H0:βi=0 vs. H0:βi6=0 , the test statistic is ˆ βi ˆ σˆ βi∼t(n−K) •Note: the t−test is strictly valid only if the errors are actually normally distributed. If one has nonnormal errors, one could use the above asymptotic result to justify taking critical values from the N(0,1)distribution, since t(n− K)d →N(0,1)as n→∞.In practice, a conservative procedure is to take critical values from the tdistribution if nonnormality is suspected. This will reject H0less often since the tdistribution is fatter-tailed than is the normal. 6.2.2. Ftest. The Ftest allows testing multiple restrictions jointly. PROPOSITION 10. If x∼χ2(r)and y∼χ2(s),then (6.2.5) x/r y/s∼F(r,s) provided that xand yare independent. PROPOSITION 11. If the random vector (of dimension n)x∼N(0,I),then x0Ax and x0Bx are independent if AB =0. Using these results, and previous results on the χ2distribution, it is simple to show that the following statistic has the Fdistribution: F=Rˆ β−r0R(X0X)−1R0−1Rˆ β−r qˆ σ2∼F(q,n−K). A numerically equivalent expression is
6.2. TESTING 87 (ESSR−ESSU)/q ESSU/(n−K)∼F(q,n−K). •Note: The Ftest is strictly valid only if the errors are truly normally distributed. The following tests will be appropriate when one cannot assume normally distributed errors. 6.2.3. Wald-type tests. The Wald principle is based on the idea that if a restriction is true, the unrestricted model should “approximately” satisfy the restriction. Given that the least squares estimator is asymptotically normally distributed: √nˆ β−β0d →N0,σ2 0Q−1 X then under H0:Rβ0=r,we have √nRˆ β−rd →N0,σ2 0RQ−1 XR0 so by Proposition [6] nRˆ β−r0σ2 0RQ−1 XR0−1Rˆ β−rd →χ2(q) Note that Q−1 Xor σ2 0are not observable. The test statistic we use substitutes the consistent estimators. Use (X0X/n)−1as the consistent estimator of Q−1 X.With this, there is a cancellation of n0s,and the statistic to use is Rˆ β−r0c σ2 0R(X0X)−1R0−1Rˆ β−rd →χ2(q) •The Wald test is a simple way to test restrictions without having to estimate the restricted model. •Note that this formula is similar to one of the formulae provided for the F test.
6.2. TESTING 88 6.2.4. Score-type tests (Rao tests, Lagrange multiplier tests). In some cases, an unrestricted model may be nonlinear in the parameters, but the model is linear in the parameters under the null hypothesis. For example, the model y= (Xβ)γ+ε is nonlinear in βand γ,but is linear in βunder H0:γ=1.Estimation of nonlinear models is a bit more complicated, so one might prefer to have a test based upon the restricted, linear model. The score test is useful in this situation. •Score-type tests are based upon the general principle that the gradient vector of the unrestricted model, evaluated at the restricted estimate, should be asymptotically normally distributed with mean zero, if the restrictions are true. The original development was for ML estimation, but the principle is valid for a wide variety of estimation methods. We have seen that ˆ λ=R(X0X)−1R0−1Rˆ β−r =P−1Rˆ β−r Given that √nRˆ β−rd →N0,σ2 0RQ−1 XR0 under the null hypothesis, √nˆ λd →N0,σ2 0P−1RQ−1 XR0P−1 or √nˆ λd →N0,σ2 0limn(nP)−1RQ−1 XR0P−1
6.2. TESTING 89 since the n’s cancel and inserting the limit of a matrix of constants changes nothing. However, limnP =limnR(X0X)−1R0 =limRX0X n−1 R0 =RQ−1 XR0 So there is a cancellation and we get √nˆ λd →N0,σ2 0limnP−1 In this case, ˆ λ0R(X0X)−1R0 σ2 0ˆ λd →χ2(q) since the powers of ncancel. To get a usable test statistic substitute a consistent estimator of σ2 0. •This makes it clear why the test is sometimes referred to as a Lagrange multiplier test. It may seem that one needs the actual Lagrange multipliers to calculate this. If we impose the restrictions by substitution, these are not available. Note that the test can be written as R0ˆ λ0(X0X)−1R0ˆ λ σ2 0 d →χ2(q) However, we can use the fonc for the restricted estimator: −X0y+X0Xˆ βR+R0ˆ λ
6.5. CONFIDENCE INTERVALS 96 For this reason, the Wald test will always reject if the LR test rejects, and in turn the LR test rejects if the LM test rejects. This is a bit problematic: there is the possibility that by careful choice of the statistic used, one can manipulate reported results to favor or disfavor a hypothesis. A conservative/honest approach would be to report all three test statistics when they are available. In the case of linear models with normal errors the Ftest is to be preferred, since asymptotic approximations are not an issue. The small sample behavior of the tests can be quite different. The true size (probability of rejection of the null when the null is true) of the Wald test is often dramatically higher than the nominal size associated with the asymptotic distribution. Likewise, the true size of the score test is often smaller than the nominal size. 6.4. Interpretation of test statistics Now that we have a menu of test statistics, we need to know how to use them. 6.5. Confidence intervals Confidence intervals for single coefficients are generated in the normal manner. Given the tstatistic t(β) = ˆ β−β c σˆ β a 100(1−α)% confidence interval for β0is defined by the bounds of the set of βsuch that t(β)does not reject H0:β0=β,using a αsignificance level: C(α) = {β:−cα/2<ˆ β−β c σˆ β <cα/2} The set of such βis the interval ˆ β±c σˆ βcα/2
6.6. BOOTSTRAPPING 97 A confidence ellipse for two coefficients jointly would be, analogously, the set of {β1,β2}such that the F(or some other test statistic) doesn’t reject at the specified critical value. This generates an ellipse, if the estimators are correlated. •The region is an ellipse, since the CI for an individual coefficient defines a (infinitely long) rectangle with total prob. mass 1−α,since the other coefficient is marginalized (e.g., can take on any value). Since the ellipse is bounded in both dimensions but also contains mass 1 −α,it must extend beyond the bounds of the individual CI. •From the pictue we can see that: –Rejection of hypotheses individually does not imply that the joint test will reject. –Joint rejection does not imply individal tests will reject. 6.6. Bootstrapping When we rely on asymptotic theory to use the normal distribution-based tests and confidence intervals, we’re often at serious risk of making important errors. If the sample size is small and errors are highly nonnormal, the small sample distribution of √nˆ β−β0may be very different than its large sample distribution. Also, the distributions of test statistics may not resemble their limiting distributions at all. A means of trying to gain information on the small sample distribution of test statistics and estimators is the bootstrap. We’ll consider a simple example, just to get the main idea.
6.6. BOOTSTRAPPING 98 FIGURE 6.5.1. Joint and Individual Confidence Regions
6.6. BOOTSTRAPPING 99 Suppose that y=Xβ0+ε ε∼IID(0,σ2 0) Xis nonstochastic Given that the distribution of εis unknown, the distribution of ˆ βwill be unknown in small samples. However, since we have random sampling, we could generate artificial data. The steps are: (1) Draw nobservations from ˆ εwith replacement. Call this vector ˜ εj(it’s a n×1). (2) Then generate the data by ˜yj=Xˆ β+˜ εj (3) Now take this and estimate ˜ βj= (X0X)−1X0˜yj. (4) Save ˜ βj (5) Repeat steps 1-4, until we have a large number, J,of ˜ βj. With this, we can use the replications to calculate the empirical distribution of ˜ βj. One way to form a 100(1-α)% confidence interval for β0would be to order the ˜ βj from smallest to largest, and drop the first and last Jα/2 of the replications, and use the remaining endpoints as the limits of the CI. Note that this will not give the shortest CI if the empirical distribution is skewed. •Suppose one was interested in the distribution of some function of ˆ β,for example a test statistic. Simple: just calculate the transformation for each j, and work with the empirical distribution of the transformation.
6.7. TESTING NONLINEAR RESTRICTIONS, AND THE DELTA METHOD 100 •If the assumption of iid errors is too strong (for example if there is heteroscedasticity or autocorrelation, see below) one can work with a bootstrap defined by sampling from (y,x)with replacement. •How to choose J:Jshould be large enough that the results don’t change with repetition of the entire bootstrap. This is easy to check. If you find the results change a lot, increase Jand try again. •The bootstrap is based fundamentally on the idea that the empirical distribution of the sample data converges to the actual sampling distribution as n becomes large, so statistics based on sampling from the empirical distribution should converge in distribution to statistics based on sampling from the actual sampling distribution. •In finite samples, this doesn’t hold. At a minimum, the bootstrap is a good way to check if asymptotic theory results offer a decent approximation to the small sample distribution. 6.7. Testing nonlinear restrictions, and the Delta Method Testing nonlinear restrictions of a linear model is not much more difficult, at least when the model is linear. Since estimation subject to nonlinear restrictions requires nonlinear estimation methods, which are beyond the score of this course, we’ll just consider the Wald test for nonlinear restrictions on a linear model. Consider the qnonlinear restrictions r(β0) = 0. where r(·)is a q-vector valued function. Write the derivative of the restriction evaluated at βas Dβ0r(β)β=R(β)
6.7. TESTING NONLINEAR RESTRICTIONS, AND THE DELTA METHOD 101 We suppose that the restrictions are not redundant in a neighborhood of β0, so that ρ(R(β)) = q in a neighborhood of β0.Take a first order Taylor’s series expansion of r(ˆ β)about β0: r(ˆ β) = r(β0)+R(β∗)(ˆ β−β0) where β∗is a convex combination of ˆ βand β0.Under the null hypothesis we have r(ˆ β) = R(β∗)(ˆ β−β0) Due to consistency of ˆ βwe can replace β∗by β0, asymptotically, so √nr(ˆ β)a =√nR(β0)(ˆ β−β0) We’ve already seen the distribution of √n(ˆ β−β0).Using this we get √nr(ˆ β)d →N0,R(β0)Q−1 XR(β0)0σ2 0. Considering the quadratic form nr(ˆ β)0R(β0)Q−1 XR(β0)0−1 r(ˆ β) σ2 0 d →χ2(q) under the null hypothesis. Substituting consistent estimators for β0,QXand σ2 0,the resulting statistic is r(ˆ β)0R(ˆ β)(X0X)−1R(ˆ β)0−1 r(ˆ β) c σ2 d →χ2(q) under the null hypothesis.
6.7. TESTING NONLINEAR RESTRICTIONS, AND THE DELTA METHOD 102 •This is known in the literature as the Delta method, or as Klein’s approximation. •Since this is a Wald test, it will tend to over-reject in finite samples. The score and LR tests are also possibilities, but they require estimation methods for nonlinear models, which aren’t in the scope of this course. Note that this also gives a convenient way to estimate nonlinear functions and associated asymptotic confidence intervals. If the nonlinear function r(β0)is not hypothesized to be zero, we just have √nr(ˆ β)−r(β0)d →N0,R(β0)Q−1 XR(β0)0σ2 0 so an approximation to the distribution of the function of the estimator is r(ˆ β)≈N(r(β0),R(β0)(X0X)−1R(β0)0σ2 0) For example, the vector of elasticities of a function f(x)is η(x) = ∂f(x) ∂xx f(x) where means element-by-element multiplication. Suppose we estimate a linear function y=x0β+ε. The elasticities of yw.r.t. xare η(x) = β x0βx (note that this is the entire vector of elasticities). The estimated elasticities are b η(x) = ˆ β x0ˆ βx
6.7. TESTING NONLINEAR RESTRICTIONS, AND THE DELTA METHOD 103 To calculate the estimated standard errors of all five elasticites, use R(β) = ∂η(x) ∂β0 = x10··· 0 0x2. . . . . ....0 0··· 0xk x0β− β1x2 10··· 0 0β2x2 2 . . . . . ....0 0··· 0βkx2 k (x0β)2. To get a consistent estimator just substitute in ˆ β. Note that the elasticity and the standard error are functions of x.The program ExampleDeltaMethod.m shows how this can be done. In many cases, nonlinear restrictions can also involve the data, not just the parameters. For example, consider a model of expenditure shares. Let x(p,m)be a demand funcion, where pis prices and mis income. An expenditure share system for Ggoods is si(p,m) = pixi(p,m) m,i=1,2,...,G. Now demand must be positive, and we assume that expenditures sum to income, so we have the restrictions 0≤si(p,m)≤1,∀i G ∑ i=1 si(p,m) = 1 Suppose we postulate a linear model for the expenditure shares: si(p,m) = βi 1+p0βi p+mβi m+εi
6.8. EXAMPLE: THE NERLOVE DATA 104 It is fairly easy to write restrictions such that the shares sum to one, but the restriction that the shares lie in the [0,1]interval depends on both parameters and the values of p and m.It is impossible to impose the restriction that 0 ≤si(p,m)≤1 for all possible p and m.In such cases, one might consider whether or not a linear model is a reasonable specification. 6.8. Example: the Nerlove data Remember that we in a previous example (section 3.8.3) that the OLS results for the Nerlove model are ********************************************************* OLS estimation results Observations 145 R-squared 0.925955 Sigma-squared 0.153943 Results (Ordinary var-cov estimator) estimate st.err. t-stat. p-value constant -3.527 1.774 -1.987 0.049 output 0.720 0.017 41.244 0.000 labor 0.436 0.291 1.499 0.136 fuel 0.427 0.100 4.249 0.000 capital -0.220 0.339 -0.648 0.518 ********************************************************* Note that sK=βK<0, and that βL+βF+βK6=1. Remember that if we have constant returns to scale, then βQ=1,and if there is homogeneity of degree 1 thenβL+βF+βK=1. We can test these hypotheses either separately or jointly. NerloveRestrictions.m imposes and tests CRTS and then HOD1. From it we obtain the results that follow:
6.8. EXAMPLE: THE NERLOVE DATA 105 Imposing and testing HOD1 ******************************************************* Restricted LS estimation results Observations 145 R-squared 0.925652 Sigma-squared 0.155686 estimate st.err. t-stat. p-value constant -4.691 0.891 -5.263 0.000 output 0.721 0.018 41.040 0.000 labor 0.593 0.206 2.878 0.005 fuel 0.414 0.100 4.159 0.000 capital -0.007 0.192 -0.038 0.969 ******************************************************* Value p-value F 0.574 0.450 Wald 0.594 0.441 LR 0.593 0.441 Score 0.592 0.442 Imposing and testing CRTS *******************************************************
7.1. EFFECTS OF NONSPHERICAL DISTURBANCES ON THE OLS ESTIMATOR 112 •The general case combines heteroscedasticity and autocorrelation. This is known as “nonspherical” disturbances, though why this term is used, I have no idea. Perhaps it’s because under the classical assumptions, a joint confidence region for εwould be an n−dimensional hypersphere. 7.1. Effects of nonspherical disturbances on the OLS estimator The least square estimator is ˆ β= (X0X)−1X0y =β+(X0X)−1X0ε •We have unbiasedness, as before. •The variance of ˆ βis Eh(ˆ β−β)(ˆ β−β)0i=E(X0X)−1X0εε0X(X0X)−1 = (X0X)−1X0ΣX(X0X)−1 (7.1.1) Due to this, any test statistic that is based upon c σ2or the probability limit c σ2 of is invalid. In particular, the formulas for the t,F,χ2based tests given above do not lead to statistics with these distributions. •ˆ βis still consistent, following exactly the same argument given before. •If εis normally distributed, then ˆ β∼Nβ,(X0X)−1X0ΣX(X0X)−1 The problem is that Σis unknown in general, so this distribution won’t be useful for testing hypotheses.
7.2. THE GLS ESTIMATOR 113 •Without normality, and unconditional on Xwe still have √nˆ β−β=√n(X0X)−1X0ε =X0X n−1 n−1/2X0ε Define the limiting variance of n−1/2X0ε(supposing a CLT applies) as lim n→∞EX0εε0X n=Ω so we obtain √nˆ β−βd →N0,Q−1 XΩQ−1 X Summary: OLS with heteroscedasticity and/or autocorrelation is: •unbiased in the same circumstances in which the estimator is unbiased with iid errors •has a different variance than before, so the previous test statistics aren’t valid •is consistent •is asymptotically normally distributed, but with a different limiting covariance matrix. Previous test statistics aren’t valid in this case for this reason. •is inefficient, as is shown below. 7.2. The GLS estimator Suppose Σwere known. Then one could form the Cholesky decomposition P0P=Σ−1 Here, Pis an upper triangular matrix. We have P0PΣ=In
7.2. THE GLS ESTIMATOR 114 so P0PΣP0=P0, which implies that PΣP0=In Consider the model P0y=P0Xβ+P0ε, or, making the obvious definitions, y∗=X∗β+ε∗. This variance of ε∗=Pεis E(Pεε0P0) = PΣP0 =In Therefore, the model y∗=X∗β+ε∗ E(ε∗) = 0 V(ε∗) = In satisfies the classical assumptions. The GLS estimator is simply OLS applied to the transformed model: ˆ βGLS = (X∗0X∗)−1X∗0y∗ = (X0PP0X)−1X0PP0y = (X0Σ−1X)−1X0Σ−1y
7.2. THE GLS ESTIMATOR 115 The GLS estimator is unbiased in the same circumstances under which the OLS estimator is unbiased. For example, assuming Xis nonstochastic E(ˆ βGLS) = E(X0Σ−1X)−1X0Σ−1y =E(X0Σ−1X)−1X0Σ−1(Xβ+ε =β. The variance of the estimator, conditional on Xcan be calculated using ˆ βGLS = (X∗0X∗)−1X∗0y∗ = (X∗0X∗)−1X∗0(X∗β+ε∗) =β+(X∗0X∗)−1X∗0ε∗ so Eˆ βGLS −βˆ βGLS −β0=E(X∗0X∗)−1X∗0ε∗ε∗0X∗(X∗0X∗)−1 = (X∗0X∗)−1X∗0X∗(X∗0X∗)−1 = (X∗0X∗)−1 = (X0Σ−1X)−1 Either of these last formulas can be used. •All the previous results regarding the desirable properties of the least squares estimator hold, when dealing with the transformed model, since the transformed model satisfies the classical assumptions.. •Tests are valid, using the previous formulas, as long as we substitute X∗in place of X.Furthermore, any test that involves σ2can set it to 1.This is preferable to re-deriving the appropriate formulas.
7.3. FEASIBLE GLS 116 •The GLS estimator is more efficient than the OLS estimator. This is a consequence of the Gauss-Markov theorem, since the GLS estimator is based on a model that satisfies the classical assumptions but the OLS estimator is not. To see this directly, not that (the following needs to be completed) Var(ˆ β)−Var(ˆ βGLS) = (X0X)−1X0ΣX(X0X)−1−(X0Σ−1X)−1 =AΣA 0 where A=h(X0X)−1X0−(X0Σ−1X)−1X0Σ−1i.This may not seem obvious, but it is true, as you can verify for yourself. Then noting that AΣA0is a quadratic form in a positive definite matrix, we conclude that AΣA0is positive semi-definite, and that GLS is efficient relative to OLS. •As one can verify by calculating fonc, the GLS estimator is the solution to the minimization problem ˆ βGLS =argmin(y−Xβ)0Σ−1(y−Xβ) so the metric Σ−1is used to weight the residuals. 7.3. Feasible GLS The problem is that Σisn’t known usually, so this estimator isn’t available. •Consider the dimension of Σ: it’s an n×nmatrix with n2−n/2+n= n2+n/2 unique elements. •The number of parameters to estimate is larger than nand increases faster than n.There’s no way to devise an estimator that satisfies a LLN without adding restrictions.
7.3. FEASIBLE GLS 117 •The feasible GLS estimator is based upon making sufficient assumptions regarding the form of Σso that a consistent estimator can be devised. Suppose that we parameterize Σas a function of Xand θ, where θmay include βas well as other parameters, so that Σ=Σ(X,θ) where θis of fixed dimension. If we can consistently estimate θ,we can consistently estimate Σ,as long as Σ(X,θ)is a continuous function of θ(by the Slutsky theorem). In this case, b Σ=Σ(X,ˆ θ)p →Σ(X,θ) If we replace Σin the formulas for the GLS estimator with b Σ,we obtain the FGLS estimator. The FGLS estimator shares the same asymptotic properties as GLS. These are (1) Consistency (2) Asymptotic normality (3) Asymptotic efficiency if the errors are normally distributed. (Cramer-Rao). (4) Test procedures are asymptotically valid. In practice, the usual way to proceed is (1) Define a consistent estimator of θ.This is a case-by-case proposition, depending on the parameterization Σ(θ).We’ll see examples below. (2) Form b Σ=Σ(X,ˆ θ) (3) Calculate the Cholesky factorization b P=Chol(ˆ Σ−1). (4) Transform the model using ˆ P0y=ˆ P0Xβ+ˆ P0ε
7.4. HETEROSCEDASTICITY 118 (5) Estimate using OLS on the transformed model. 7.4. Heteroscedasticity Heteroscedasticity is the case where E(εε0) = Σ is a diagonal matrix, so that the errors are uncorrelated, but have different variances. Heteroscedasticity is usually thought of as associated with cross sectional data, though there is absolutely no reason why time series data cannot also be heteroscedastic. Actually, the popular ARCH (autoregressive conditionally heteroscedastic) models explicitly assume that a time series is heteroscedastic. Consider a supply function qi=β1+βpPi+βsSi+εi where Piis price and Siis some measure of size of the ith firm. One might suppose that unobservable factors (e.g., talent of managers, degree of coordination between production units, etc.) account for the error term εi.If there is more variability in these factors for large firms than for small firms, then εimay have a higher variance when Si is high than when it is low. Another example, individual demand. qi=β1+βpPi+βmMi+εi where Pis price and Mis income. In this case, εican reflect variations in preferences. There are more possibilities for expression of preferences when one is rich, so it is possible that the variance of εicould be higher when Mis high. Add example of group means.
7.4. HETEROSCEDASTICITY 119 7.4.1. OLS with heteroscedastic consistent varcov estimation. Eicker (1967) and White (1980) showed how to modify test statistics to account for heteroscedasticity of unknown form. The OLS estimator has asymptotic distribution √nˆ β−βd →N0,Q−1 XΩQ−1 X as we’ve already seen. Recall that we defined lim n→∞EX0εε0X n=Ω This matrix has dimension K×Kand can be consistently estimated, even if we can’t estimate Σconsistently. The consistent estimator, under heteroscedasticity but no autocorrelation is b Ω=1 n n ∑ t=1 x0 txtˆ ε2 t One can then modify the previous test statistics to obtain tests that are valid when there is heteroscedasticity of unknown form. For example, the Wald test for H0:Rβ−r=0 would be nRˆ β−r0 RX0X n−1 ˆ ΩX0X n−1 R0!−1Rˆ β−ra ∼χ2(q) 7.4.2. Detection. There exist many tests for the presence of heteroscedasticity. We’ll discuss three methods. Goldfeld-Quandt. The sample is divided in to three parts, with n1,n2and n3obser- vations, where n1+n2+n3=n. The model is estimated using the first and third parts of the sample, separately, so that ˆ β1and ˆ β3will be independent. Then we have ˆ ε10ˆ ε1 σ2=ε10M1ε1 σ2 d →χ2(n1−K) and
7.4. HETEROSCEDASTICITY 120 ˆ ε30ˆ ε3 σ2=ε30M3ε3 σ2 d →χ2(n3−K) so ˆ ε10ˆ ε1/(n1−K) ˆ ε30ˆ ε3/(n3−K) d →F(n1−K,n3−K). The distributional result is exact if the errors are normally distributed. This test is a two-tailed test. Alternatively, and probably more conventionally, if one has prior ideas about the possible magnitudes of the variances of the observations, one could order the observations accordingly, from largest to smallest. In this case, one would use a conventional one-tailed F-test. Draw picture. •Ordering the observations is an important step if the test is to have any power. •The motive for dropping the middle observations is to increase the difference between the average variance in the subsamples, supposing that there exists heteroscedasticity. This can increase the power of the test. On the other hand, dropping too many observations will substantially increase the variance of the statistics ˆ ε10ˆ ε1and ˆ ε30ˆ ε3.A rule of thumb, based on Monte Carlo experiments is to drop around 25% of the observations. •If one doesn’t have any ideas about the form of the het. the test will probably have low power since a sensible data ordering isn’t available. White’s test. When one has little idea if there exists heteroscedasticity, and no idea of its potential form, the White test is a possibility. The idea is that if there is homoscedasticity, then E(ε2 t|xt) = σ2,∀t so that xtor functions of xtshouldn’t help to explain E(ε2 t).The test works as follows: (1) Since εtisn’t available, use the consistent estimator ˆ εtinstead.
7.4. HETEROSCEDASTICITY 121 (2) Regress ˆ ε2 t=σ2+z0 tγ+vt where ztis a P-vector. ztmay include some or all of the variables in xt,as well as other variables. White’s original suggestion was to use xt, plus the set of all unique squares and cross products of variables in xt. (3) Test the hypothesis that γ=0.The qF statistic in this case is qF =P(ESSR−ESSU)/P ESSU/(n−P−1) Note that ESSR=T SSU,so dividing both numerator and denominator by this we get qF = (n−P−1)R2 1−R2 Note that this is the R2or the artificial regression used to test for heteroscedasticity, not the R2of the original model. An asymptotically equivalent statistic, under the null of no heteroscedasticity (so that R2should tend to zero), is nR2a ∼χ2(P). This doesn’t require normality of the errors, though it does assume that the fourth moment of εtis constant, under the null. Question: why is this necessary? •The White test has the disadvantage that it may not be very powerful unless the ztvector is chosen well, and this is hard to do without knowledge of the form of heteroscedasticity. •It also has the problem that specification errors other than heteroscedasticity may lead to rejection.
7.4. HETEROSCEDASTICITY 128 constant5 -5.308 1.586 -3.346 0.001 output1 0.391 0.090 4.363 0.000 output2 0.649 0.090 7.184 0.000 output3 0.897 0.134 6.688 0.000 output4 0.962 0.112 8.612 0.000 output5 1.101 0.090 12.237 0.000 labor 0.007 0.208 0.032 0.975 fuel 0.498 0.081 6.149 0.000 capital -0.460 0.253 -1.818 0.071 ********************************************************* ********************************************************* OLS estimation results Observations 145 R-squared 0.987429 Sigma-squared 1.092393 Results (Het. consistent var-cov estimator) estimate st.err. t-stat. p-value constant1 -1.580 0.917 -1.723 0.087 constant2 -2.497 0.988 -2.528 0.013 constant3 -4.108 1.327 -3.097 0.002 constant4 -4.494 1.180 -3.808 0.000 constant5 -5.765 1.274 -4.525 0.000
7.4. HETEROSCEDASTICITY 129 output1 0.392 0.090 4.346 0.000 output2 0.648 0.094 6.917 0.000 output3 0.892 0.138 6.474 0.000 output4 0.951 0.109 8.755 0.000 output5 1.093 0.086 12.684 0.000 labor 0.103 0.141 0.733 0.465 fuel 0.492 0.044 11.294 0.000 capital -0.366 0.165 -2.217 0.028 ********************************************************* Testing HOD1 Value p-value Wald test 9.312 0.002 The first panel of output are the OLS estimation results, which are used to consistently estimate the σ2 j. The second panel of results are the GLS estimation results. Some comments: •The R2measures are not comparable - the dependent variables are not the same. The measure for the GLS results uses the transformed dependent variable. One could calculate a comparable R2measure, but I have not done so. •The differences in estimated standard errors (smaller in general for GLS) can be interpreted as evidence of improved efficiency of GLS, since the OLS standard errors are calculated using the Huber-White estimator. They would not be comparable if the ordinary (inconsistent) estimator had been used.
7.5. AUTOCORRELATION 130 •Note that the previously noted pattern in the output coefficients persists. The nonconstant CRTS result is robust. •The coefficient on capital is now negative and significant at the 3% level. That seems to indicate some kind of problem with the model or the data, or economic theory. •Note that HOD1 is now rejected. Problem of Wald test over-rejecting? Specification error in model? 7.5. Autocorrelation Autocorrelation, which is the serial correlation of the error term, is a problem that is usually associated with time series data, but also can affect cross-sectional data. For example, a shock to oil prices will simultaneously affect all countries, so one could expect contemporaneous correlation of macroeconomic variables across countries. 7.5.1. Causes. Autocorrelation is the existence of correlation across the error term: E(εtεs)6=0,t6=s. Why might this occur? Plausible explanations include (1) Lags in adjustment to shocks. In a model such as yt=x0 tβ+εt, one could interpret x0 tβas the equilibrium value. Suppose xtis constant over a number of observations. One can interpret εtas a shock that moves the system away from equilibrium. If the time needed to return to equilibrium is long with respect to the observation frequency, one could expect εt+1to be positive, conditional on εtpositive, which induces a correlation.
7.5. AUTOCORRELATION 131 FIGURE 7.5.1. Autocorrelation induced by misspecification (2) Unobserved factors that are correlated over time. The error term is often assumed to correspond to unobservable factors. If these factors are correlated, there will be autocorrelation. (3) Misspecification of the model. Suppose that the DGP is yt=β0+β1xt+β2x2 t+εt but we estimate yt=β0+β1xt+εt The effects are illustrated in Figure 7.5.1.
7.5. AUTOCORRELATION 132 7.5.2. Effects on the OLS estimator. The variance of the OLS estimator is the same as in the case of heteroscedasticity - the standard formula does not apply. The correct formula is given in equation 7.1.1. Next we discuss two GLS corrections for OLS. These will potentially induce inconsistency when the regressors are nonstochastic (see Chapter8) and should either not be used in that case (which is usually the relevant case) or used with caution. The more recommended procedure is discussed in section 7.5.5. 7.5.3. AR(1). There are many types of autocorrelation. We’ll consider two examples. The first is the most commonly encountered case: autoregressive order 1 (AR(1) errors. The model is yt=x0 tβ+εt εt=ρεt−1+ut ut∼iid(0,σ2 u) E(εtus) = 0,t<s We assume that the model satisfies the other classical assumptions. •We need a stationarity assumption: |ρ|<1.Otherwise the variance of εtexplodes as tincreases, so standard asymptotics will not apply. •By recursive substitution we obtain εt=ρεt−1+ut =ρ(ρεt−2+ut−1)+ ut =ρ2εt−2+ρut−1+ut =ρ2(ρεt−3+ut−2)+ρut−1+ut
7.5. AUTOCORRELATION 133 In the limit the lagged εdrops out, since ρm→0 as m→∞,so we obtain εt= ∞ ∑ m=0 ρmut−m With this, the variance of εtis found as E(ε2 t) = σ2 u ∞ ∑ m=0 ρ2m =σ2 u 1−ρ2 •If we had directly assumed that εtwere covariance stationary, we could obtain this using V(εt) = ρ2E(ε2 t−1)+2ρE(εt−1ut)+E(u2 t) =ρ2V(εt)+σ2 u, so V(εt) = σ2 u 1−ρ2 •The variance is the 0th order autocovariance: γ0=V(εt) •Note that the variance does not depend on t Likewise, the first order autocovariance γ1is Cov(εt,εt−1) = γs=E((ρεt−1+ut)εt−1) =ρV(εt) =ρσ2 u 1−ρ2 •Using the same method, we find that for s<t Cov(εt,εt−s) = γs=ρsσ2 u 1−ρ2
7.5. AUTOCORRELATION 134 •The autocovariances don’t depend on t: the process {εt}is covariance stationary The correlation (in general, for r.v.’s xand y) is defined as corr(x,y) = cov(x,y) se(x)se(y) but in this case, the two standard errors are the same, so the s-order autocorrelation ρs is ρs=ρs •All this means that the overall matrix Σhas the form Σ=σ2 u 1−ρ2 |{z} this is the variance 1ρ ρ2··· ρn−1 ρ1ρ··· ρn−2 . . ..... . . ...ρ ρn−1··· 1 |{z } this is the correlation matrix So we have homoscedasticity, but elements off the main diagonal are not zero. All of this depends only on two parameters, ρand σ2 u.If we can estimate these consistently, we can apply FGLS. It turns out that it’s easy to estimate these consistently. The steps are (1) Estimate the model yt=x0 tβ+εtby OLS. (2) Take the residuals, and estimate the model ˆ εt=ρˆ εt−1+u∗ t
7.5. AUTOCORRELATION 135 Since ˆ εt p →εt,this regression is asymptotically equivalent to the regression εt=ρεt−1+ut which satisfies the classical assumptions. Therefore, ˆ ρobtained by applying OLS to ˆ εt=ρˆ εt−1+u∗ tis consistent. Also, since u∗ t p →ut, the estimator ˆ σ2 u=1 n n ∑ t=2 (ˆu∗ t)2p →σ2 u (3) With the consistent estimators ˆ σ2 uand ˆ ρ,form ˆ Σ=Σ(ˆ σ2 u,ˆ ρ)using the previous structure of Σ,and estimate by FGLS. Actually, one can omit the factor ˆ σ2 u/(1−ρ2),since it cancels out in the formula ˆ βFGLS =X0ˆ Σ−1X−1(X0ˆ Σ−1y). •One can iterate the process, by taking the first FGLS estimator of β,reestimating ρand σ2 u,etc. If one iterates to convergences it’s equivalent to MLE (supposing normal errors). •An asymptotically equivalent approach is to simply estimate the transformed model yt−ˆ ρyt−1= (xt−ˆ ρxt−1)0β+u∗ t using n−1 observations (since y0and x0aren’t available). This is the method of Cochrane and Orcutt. Dropping the first observation is asymptotically irrelevant, but it can be very important in small samples. One can recuperate the first observation by putting y∗ 1=y1q1−ˆ ρ2 x∗ 1=x1q1−ˆ ρ2
7.5. AUTOCORRELATION 136 This somewhat odd-looking result is related to the Cholesky factorization of Σ−1.See Davidson and MacKinnon, pg. 348-49 for more discussion. Note that the variance of y∗ 1is σ2 u,asymptotically, so we see that the transformed model will be homoscedastic (and nonautocorrelated, since the u0sare uncorrelated with the y0s,in different time periods. 7.5.4. MA(1). The linear regression model with moving average order 1 errors is yt=x0 tβ+εt εt=ut+φut−1 ut∼iid(0,σ2 u) E(εtus) = 0,t<s In this case, V(εt) = γ0=Eh(ut+φut−1)2i =σ2 u+φ2σ2 u =σ2 u(1+φ2) Similarly γ1=E[(ut+φut−1)(ut−1+φut−2)] =φσ2 u and γ2= [(ut+φut−1)(ut−2+φut−3)] =0
7.5. AUTOCORRELATION 137 so in this case Σ=σ2 u 1+φ2φ0··· 0 φ1+φ2φ 0φ.... . . . . ....φ 0··· φ1+φ2 Note that the first order autocorrelation is ρ1=φσ2 u σ2 u(1+φ2)=γ1 γ0 =φ (1+φ2) •This achieves a maximum at φ=1 and a minimum at φ=−1,and the maximal and minimal autocorrelations are 1/2 and -1/2. Therefore, series that are more strongly autocorrelated can’t be MA(1) processes. Again the covariance matrix has a simple structure that depends on only two parameters. The problem in this case is that one can’t estimate φusing OLS on ˆ εt=ut+φut−1 because the utare unobservable and they can’t be estimated consistently. However, there is a simple way to estimate the parameters. •Since the model is homoscedastic, we can estimate V(εt) = σ2 ε=σ2 u(1+φ2) using the typical estimator: c σ2 ε= \ σ2 u(1+φ2) = 1 n n ∑ t=1 ˆ ε2 t
7.5. AUTOCORRELATION 144 FIGURE 7.5.2. Durbin-Watson critical values •This test is valid even if the regressors are stochastic and contain lagged dependent variables, so it is considerably more useful than the DW test for typical time series data. •The alternative is not that the model is an AR(P), following the argument above. The alternative is simply that some or all of the first Pautocorrelations are different from zero. This is compatible with many specific forms of autocorrelation. 7.5.7. Lagged dependent variables and autocorrelation. We’ve seen that the OLS estimator is consistent under autocorrelation, as long as plimX0ε n=0.This will be the case when E(X0ε) = 0,following a LLN. An important exception is the case where Xcontains lagged y0sand the errors are autocorrelated. A simple example is the
7.5. AUTOCORRELATION 145 case of a single lag of the dependent variable with AR(1) errors. The model is yt=x0 tβ+yt−1γ+εt εt=ρεt−1+ut Now we can write E(yt−1εt) = E(x0 t−1β+yt−2γ+εt−1)(ρεt−1+ut) 6=0 since one of the terms is E(ρε2 t−1)which is clearly nonzero. In this case E(X0ε)6=0, and therefore plimX0ε n6=0.Since plimˆ β=β+plimX0ε n the OLS estimator is inconsistent in this case. One needs to estimate by instrumental variables (IV), which we’ll get to later. 7.5.8. Examples. Nerlove model, yet again. The Nerlove model uses cross-sectional data, so one may not think of performing tests for autocorrelation. However, specification error can induce autocorrelated errors. Consider the simple Nerlove model lnC=β1+β2lnQ+β3lnPL+β4lnPF+β5lnPK+ε and the extended Nerlove model lnC=βj 1+βj 2lnQ+β3lnPL+β4lnPF+β5lnPK+ε.
7.5. AUTOCORRELATION 146 FIGURE 7.6.1. Residuals of simple Nerlove model -1 -0.5 0 0.5 1 1.5 2 0 1 2 3 4 5 6 7 8 9 10 Residuals Quadratic fit to Residuals We have seen evidence that the extended model is preferred. So if it is in fact the proper model, the simple model is misspecified. Let’s check if this misspecification might induce autocorrelated errors. The Octave program GLS/NerloveAR.m estimates the simple Nerlove model, and plots the residuals as a function of lnQ, and it calculates a Breusch-Godfrey test statistic. The residual plot is in Figure 7.6.1 , and the test results are: Value p-value Breusch-Godfrey test 34.930 0.000 Clearly, there is a problem of autocorrelated residuals. EXERCISE 7.6. Repeat the autocorrelation tests using the extended Nerlove model (Equation ??) to see the problem is solved.
7.5. AUTOCORRELATION 147 Klein model. Klein’s Model I is a simple macroeconometric model. One of the equations in the model explains consumption (C) as a function of profits (P), both current and lagged, as well as the sum of wages in the private sector (Wp) and wages in the government sector (Wg). Have a look at the README file for this data set. This gives the variable names and other information. Consider the model Ct=α0+α1Pt+α2Pt−1+α3(Wp t+Wg t)+ε1t The Octave program GLS/Klein.m estimates this model by OLS, plots the residuals, and performs the Breusch-Godfrey test, using 1 lag of the residuals. The estimation and test results are: ********************************************************* OLS estimation results Observations 21 R-squared 0.981008 Sigma-squared 1.051732 Results (Ordinary var-cov estimator) estimate st.err. t-stat. p-value Constant 16.237 1.303 12.464 0.000 Profits 0.193 0.091 2.115 0.049 Lagged Profits 0.090 0.091 0.992 0.335 Wages 0.796 0.040 19.933 0.000
7.5. AUTOCORRELATION 148 FIGURE 7.6.2. OLS residuals, Klein consumption equation -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 0 5 10 15 20 25 Regression residuals Residuals ********************************************************* Value p-value Breusch-Godfrey test 1.539 0.215 and the residual plot is in Figure 7.6.2. The test does not reject the null of nonautocorrelatetd errors, but we should remember that we have only 21 observations, so power is likely to be fairly low. The residual plot leads me to suspect that there may be autocorrelation - there are some significant runs below and above the x-axis. Your opinion may differ. Since it seems that there may be autocorrelation, lets’s try an AR(1) correction. The Octave program GLS/KleinAR1.m estimates the Klein consumption equation assuming that the errors follow the AR(1) pattern. The results, with the Breusch-Godfrey test for remaining autocorrelation are:
7.5. AUTOCORRELATION 149 ********************************************************* OLS estimation results Observations 21 R-squared 0.967090 Sigma-squared 0.983171 Results (Ordinary var-cov estimator) estimate st.err. t-stat. p-value Constant 16.992 1.492 11.388 0.000 Profits 0.215 0.096 2.232 0.039 Lagged Profits 0.076 0.094 0.806 0.431 Wages 0.774 0.048 16.234 0.000 ********************************************************* Value p-value Breusch-Godfrey test 2.129 0.345 •The test is farther away from the rejection region than before, and the residual plot is a bit more favorable for the hypothesis of nonautocorrelated residuals, IMHO. For this reason, it seems that the AR(1) correction might have improved the estimation. •Nevertheless, there has not been much of an effect on the estimated coefficients nor on their estimated standard errors. This is probably because the estimated AR(1) coefficient is not very large (around 0.2)
EXERCISES 150 •The existence or not of autocorrelation in this model will be important later, in the section on simultaneous equations. Exercises
EXERCISES 151 (1) Comparing the variances of the OLS and GLS estimators, I claimed that the following holds: (2) Var(ˆ β)−Var(ˆ βGLS) = AΣA 0 Verify that this is true. (3) Show that the GLS estimator can be defined as ˆ βGLS =argmin(y−Xβ)0Σ−1(y−Xβ) (4) The limiting distribution of the OLS estimator with heteroscedasticity of unknown form is √nˆ β−βd →N0,Q−1 XΩQ−1 X, where lim n→∞EX0εε0X n=Ω Explain why b Ω=1 n n ∑ t=1 x0 txtˆ ε2 t is a consistent estimator of this matrix. (5) Define the v−th autocovariance of a covariance stationary process mt, where E(mt=0)as Γv=E(mtm0 t−v). Show that E(mtm0 t+v) = Γ0 v. (6) For the Nerlove model lnC=βj 1+βj 2lnQ+β3lnPL+β4lnPF+β5lnPK+ε
EXERCISES 152 assume that V(εt|xt) = α+αQlnQ. Exercises (a) Calculate the FGLS estimator and interpret the estimation results. (b) Test the transformed model to check whether it appears to satisfy homoscedasticity.
CHAPTER 8 Stochastic regressors Up to now we have treated the regressors as fixed, which is clearly unrealistic. Now we will assume they are random. There are several ways to think of the problem. First, if we are interested in an analysis conditional on the explanatory variables, then it is irrelevant if they are stochastic or not, since conditional on the values of they regressors take on, they are nonstochastic, which is the case already considered. •In cross-sectional analysis it is usually reasonable to make the analysis conditional on the regressors. •In dynamic models, where ytmay depend on yt−1,a conditional analysis is not sufficiently general, since we may want to predict into the future many periods out, so we need to consider the behavior of ˆ βand the relevant test statistics unconditional on X. The model we’ll deal will involve a combination of the following assumptions Linearity: the model is a linear function of the parameter vector β0: yt=x0 tβ0+εt, or in matrix form, y=Xβ0+ε, where yis n×1,X=x1x2··· xn0,where xtis K×1,and β0and εare conformable. Stochastic, linearly independent regressors 153
13.2. DERIVATIVE-BASED METHODS 256 To attempt to maximize sn(θ),we can maximize the portion of the right-hand side that depends on θ,i.e., we can maximize ˜s(θ) = g(θk)0θ+1/2θ−θk0H(θk)θ−θk with respect to θ.This is a much easier problem, since it is a quadratic function in θ, so it has linear first order conditions. These are Dθ˜s(θ) = g(θk)+ H(θk)θ−θk So the solution for the next round estimate is θk+1=θk−H(θk)−1g(θk) This is illustrated in Figure 13.2.2. However, it’s good to include a stepsize, since the approximation to sn(θ)may be bad far away from the maximizer ˆ θ,so the actual iteration formula is θk+1=θk−akH(θk)−1g(θk) •A potential problem is that the Hessian may not be negative definite when we’re far from the maximizing point. So −H(θk)−1may not be positive definite, and −H(θk)−1g(θk)may not define an increasing direction of search. This can happen when the objective function has flat regions, in which case the Hessian matrix is very ill-conditioned (e.g., is nearly singular), or when we’re in the vicinity of a local minimum, H(θk)is positive definite, and our direction is a decreasing direction of search. Matrix inverses by computers are subject to large errors when the matrix is ill-conditioned. Also, we
13.2. DERIVATIVE-BASED METHODS 257 FIGURE 13.2.2. Newton-Raphson method certainly don’t want to go in the direction of a minimum when we’re maximizing. To solve this problem, Quasi-Newton methods simply add a positive definite component to H(θ)to ensure that the resulting matrix is positive definite, e.g., Q =−H(θ) + bI,where bis chosen large enough so that Qis well-conditioned and positive definite. This has the benefit that improvement in the objective function is guaranteed. •Another variation of quasi-Newton methods is to approximate the Hessian by using successive gradient evaluations. This avoids actual calculation of the Hessian, which is an order of magnitude (in the dimension of the parameter vector) more costly than calculation of the gradient. They can be done to
13.2. DERIVATIVE-BASED METHODS 258 ensure that the approximation is p.d. DFP and BFGS are two well-known examples. Stopping criteria The last thing we need is to decide when to stop. A digital computer is subject to limited machine precision and round-off errors. For these reasons, it is unreasonable to hope that a program can exactly find the point that maximizes a function. We need to define acceptable tolerances. Some stopping criteria are: •Negligable change in parameters: |θk j−θk−1 j|<ε1,∀j •Negligable relative change: |θk j−θk−1 j θk−1 j|<ε2,∀j •Negligable change of function: |s(θk)−s(θk−1)|<ε3 •Gradient negligibly different from zero: |gj(θk)|<ε4,∀j •Or, even better, check all of these. •Also, if we’re maximizing, it’s good to check that the last round (real, not approximate) Hessian is negative definite. Starting values The Newton-Raphson and related algorithms work well if the objective function is concave (when maximizing), but not so well if there are convex regions and local
13.2. DERIVATIVE-BASED METHODS 259 minima or multiple local maxima. The algorithm may converge to a local minimum or to a local maximum that is not optimal. The algorithm may also have difficulties converging at all. •The usual way to “ensure” that a global maximum has been found is to use many different starting values, and choose the solution that returns the highest objective function value. THIS IS IMPORTANT in practice. More on this later. Calculating derivatives The Newton-Raphson algorithm requires first and second derivatives. It is often difficult to calculate derivatives (especially the Hessian) analytically if the function sn(·)is complicated. Possible solutions are to calculate derivatives numerically, or to use programs such as MuPAD or Mathematica to calculate analytic derivatives. For example, Figure 13.2.3 shows MuPAD1calculating a derivative that I didn’t know off the top of my head, and one that I did know. •Numeric derivatives are less accurate than analytic derivatives, and are usually more costly to evaluate. Both factors usually cause optimization programs to be less successful when numeric derivatives are used. •One advantage of numeric derivatives is that you don’t have to worry about having made an error in calculating the analytic derivative. When programming analytic derivatives it’s a good idea to check that they are correct by using numeric derivatives. This is a lesson I learned the hard way when writing my thesis. 1MuPAD is not a freely distributable program, so it’s not on the CD. You can download it from http://www.mupad.de/download.shtml
13.2. DERIVATIVE-BASED METHODS 260 FIGURE 13.2.3. Using MuPAD to get analytic derivatives •Numeric second derivatives are much more accurate if the data are scaled so that the elements of the gradient are of the same order of magnitude. Example: if the model is yt=h(αxt+βzt)+εt,and estimation is by NLS, suppose that Dαsn(·) = 1000 and Dβsn(·) = 0.001.One could define α∗=α/1000; x∗ t=1000xt;β∗=1000β;z∗ t=zt/1000.In this case, the gradients Dα∗sn(·) and Dβsn(·)will both be 1. In general, estimation programs always work better if data is scaled in this way, since roundoff errors are less likely to become important. This is important in practice.
13.4. EXAMPLES 261 •There are algorithms (such as BFGS and DFP) that use the sequential gradient evaluations to build up an approximation to the Hessian. The iterations are faster for this reason since the actual Hessian isn’t calculated, but more iterations usually are required for convergence. •Switching between algorithms during iterations is sometimes useful. 13.3. Simulated Annealing Simulated annealing is an algorithm which can find an optimum in the presence of nonconcavities, discontinuities and multiple local minima/maxima. Basically, the algorithm randomly selects evaluation points, accepts all points that yield an increase in the objective function, but also accepts some points that decrease the objective function. This allows the algorithm to escape from local minima. As more and more points are tried, periodically the algorithm focuses on the best point so far, and reduces the range over which random points are generated. Also, the probability that a negative move is accepted reduces. The algorithm relies on many evaluations, as in the search method, but focuses in on promising areas, which reduces function evaluations with respect to the search method. It does not require derivatives to be evaluated. I have a program to do this if you’re interested. 13.4. Examples This section gives a few examples of how some nonlinear models may be estimated using maximum likelihood. 13.4.1. Discrete Choice: The logit model. In this section we will consider maximum likelihood estimation of the logit model for binary 0/1 dependent variables. We will use the BFGS algotithm to find the MLE.
13.4. EXAMPLES 262 We saw an example of a binary choice model in equation 12.0.1. A more general representation is y∗=g(x)−ε y=1(y∗>0) Pr(y=1) = Fε[g(x)] ≡p(x,θ) The log-likelihood function is sn(θ) = 1 n n ∑ i=1 (yiln p(xi,θ)+(1−yi)ln[1−p(xi,θ)]) For the logit model (see the contingent valuation example above), the probability has the specific form p(x,θ) = 1 1+exp(−x0θ) You should download and examine LogitDGP.m , which generates data according to the logit model, logit.m , which calculates the loglikelihood, and EstimateLogit.m , which sets things up and calls the estimation routine, which uses the BFGS algorithm. Here are some estimation results with n=100,and the true θ= (0,1)0. *********************************************** Trial of MLE estimation of Logit model MLE Estimation Results BFGS convergence: Normal convergence Average Log-L: 0.607063 Observations: 100
13.4. EXAMPLES 263 estimate st. err t-stat p-value constant 0.5400 0.2229 2.4224 0.0154 slope 0.7566 0.2374 3.1863 0.0014 Information Criteria CAIC : 132.6230 BIC : 130.6230 AIC : 125.4127 *********************************************** The estimation program is calling mle_results() , which in turn calls a number of other routines. These functions are part of the octave-forge repository. 13.4.2. Count Data: The Poisson model. Demand for health care is usually thought of a a derived demand: health care is an input to a home production function that produces health, and health is an argument of the utility function. Grossman (1972), for example, models health as a capital stock that is subject to depreciation (e.g., the effects of ageing). Health care visits restore the stock. Under the home production framework, individuals decide when to make health care visits to maintain their health stock, or to deal with negative shocks to the stock in the form of accidents or illnesses. As such, individual demand will be a function of the parameters of the individuals’ utility functions. The MEPS health data file , meps1996.data, contains 4564 observations on six measures of health care usage. The data is from the 1996 Medical Expenditure Panel Survey (MEPS). You can get more information at http://www.meps.ahrq.gov/ . The six measures of use are are office-based visits (OBDV), outpatient visits (OPV), inpatient visits (IPV), emergency room visits (ERV), dental visits (VDV), and number of prescription drugs taken (PRESCR). These form columns 1 - 6 of meps1996.data . The conditioning variables are public insurance (PUBLIC), private insurance (PRIV),
13.4. EXAMPLES 264 sex (SEX), age (AGE), years of education (EDUC), and income (INCOME). These form columns 7 - 12 of the file , in the order given here. PRIV and PUBLIC are 0/1 binary variables, where a 1 indicates that the person has access to public or private insurance coverage. SEX is also 0/1, where 1 indicates that the person is female. This data will be used in examples fairly extensively in what follows. The program ExploreMEPS.m shows how the data may be read in, and gives some descriptive information about variables, which follows: All of the measures of use are count data, which means that they take on the values 0,1,2,.... It might be reasonable to try to use this information by specifying the density as a count data density. One of the simplest count data densities is the Poisson density, which is fY(y) = exp(−λ)λy y!. The Poisson average log-likelihood function is sn(θ) = 1 n n ∑ i=1 (−λi+yilnλi−lnyi!) We will parameterize the model as λi=exp(x0 iβ) xi= [1PUBLIC PRIV SEX AGE EDUC INC]0. This ensures that the mean is positive, as is required for the Poisson model. Note that for this parameterization βj=∂λ/∂βj λ so
13.4. EXAMPLES 265 βjxj=ηλ xj, the elasticity of the conditional mean of ywith respect to the jth conditioning variable. The program EstimatePoisson.m estimates a Poisson model using the full data set. The results of the estimation, using OBDV as the dependent variable are here: MPITB extensions found OBDV ****************************************************** Poisson model, MEPS 1996 full data set MLE Estimation Results BFGS convergence: Normal convergence Average Log-L: -3.671090 Observations: 4564 estimate st. err t-stat p-value constant -0.791 0.149 -5.290 0.000 pub. ins. 0.848 0.076 11.093 0.000 priv. ins. 0.294 0.071 4.137 0.000 sex 0.487 0.055 8.797 0.000 age 0.024 0.002 11.471 0.000
13.5. NUMERIC OPTIMIZATION: PITFALLS 272 FIGURE 13.5.1. A foggy mountain Used numeric gradient ------------------------------------------------------ STRONG CONVERGENCE Function conv 1 Param conv 1 Gradient conv 1 ------------------------------------------------------ Objective function value -0.0130329 Stepsize 0.102833 43 iterations
13.5. NUMERIC OPTIMIZATION: PITFALLS 273 ------------------------------------------------------ param gradient change 15.9999 -0.0000 0.0000 -28.8119 0.0000 0.0000 The result with poor start values ans = 16.000 -28.812 ================================================ SAMIN final results NORMAL CONVERGENCE Func. tol. 1.000000e-10 Param. tol. 1.000000e-03 Obj. fn. value -0.100023 parameter search width 0.037419 0.000018 -0.000000 0.000051 ================================================ Now try a battery of random start values and a short BFGS on each, then iterate to convergence The result using 20 randoms start values ans =
13.5. NUMERIC OPTIMIZATION: PITFALLS 274 3.7417e-02 2.7628e-07 The true maximizer is near (0.037,0) In that run, the single BFGS run with bad start values converged to a point far from the true minimizer, which simulated annealing and BFGS using a battery of random start values both found the true maximizaer. battery of random start values managed to find the global max. The moral of the story is be cautious and don’t publish your results too quickly.
EXERCISES 275 Exercises (1) In octave, type ” help bfgsmin_example ”, to find out the location of the file. Edit the file to examine it and learn how to call bfgsmin . Run it, and examine the output. (2) In octave, type ” help samin_example ”, to find out the location of the file. Edit the file to examine it and learn how to call samin . Run it, and examine the output. (3) Using logit.m and EstimateLogit.m as templates, write a function to calculate the probit loglikelihood, and a script to estimate a probit model. Run it using data that actually follows a logit model (you can generate it in the same way that is done in the logit example). (4) Study mle_results.m to see what it does. Examine the functions that mle_results.m calls, and in turn the functions that those functions call. Write a complete description of how the whole chain works. (5) Look at the Poisson estimation results for the OBDV measure of health care use and give an economic interpretation. Estimate Poisson models for the other 5 measures of health care usage.
CHAPTER 14 Asymptotic properties of extremum estimators Readings: Gourieroux and Monfort (1995), Vol. 2, Ch. 24∗; Amemiya, Ch. 4 section 4.1∗; Davidson and MacKinnon, pp. 591-96; Gallant, Ch. 3; Newey and McFadden (1994), “Large Sample Estimation and Hypothesis Testing,” in Handbook of Econometrics, Vol. 4, Ch. 36. 14.1. Extremum estimators In Definition 12.0.1 we defined an extremum estimator ˆ θas the optimizing element of an objective function sn(θ)over a set Θ. Let the objective function sn(Zn,θ)depend upon a n×prandom matrix Zn=hz1z2··· zni0where the ztare p-vectors and pis finite. EXAMPLE 18. Given the model yi=x0 iθ+εi,with nobservations, define zi= (yi,x0 i)0.The OLS estimator minimizes sn(Zn,θ) = 1/n n ∑ i=1yi−x0 iθ2 =1/nkY−Xθk2 where Yand Xare defined similarly to Z. 276
14.2. CONSISTENCY 277 14.2. Consistency The following theorem is patterned on a proof in Gallant (1987) (the article, ref. later), which we’ll see in its original form later in the course. It is interesting to compare the following proof with Amemiya’s Theorem 4.1.1, which is done in terms of convergence in probability. THEOREM 19. [Consistency of e.e.] Suppose that ˆ θnis obtained by maximizing sn(θ)over Θ. Assume (1) Compactness: The parameter space Θis an open bounded subset of Euclidean space ℜK.So the closure of Θ,Θ, is compact. (2) Uniform Convergence: There is a nonstochastic function s∞(θ)that is continuous in θon Θsuch that lim n→∞sup θ∈Θ|sn(θ)−s∞(θ)|=0,a.s. (3) Identification: s∞(·)has a unique global maximum at θ0∈Θ,i.e., s∞(θ0)> s∞(θ),∀θ6=θ0,θ∈Θ Then ˆ θn a.s. →θ0. Proof: Select a ω∈Ωand hold it fixed. Then {sn(ω,θ)}is a fixed sequence of functions. Suppose that ωis such that sn(θ)converges uniformly to s∞(θ).This happens with probability one by assumption (b). The sequence {ˆ θn}lies in the compact set Θ,by assumption (1) and the fact that maximixation is over Θ. Since every sequence from a compact set has at least one limit point (Davidson, Thm. 2.12), say that ˆ θis a limit point of {ˆ θn}.There is a subsequence {ˆ θnm}({nm}is simply a sequence of
14.2. CONSISTENCY 278 increasing integers) with limm→∞ˆ θnm=ˆ θ. By uniform convergence and continuity lim m→∞snm(ˆ θnm) = s∞(ˆ θ). To see this, first of all, select an element ˆ θtfrom the sequence ˆ θnm.Then uniform convergence implies lim m→∞snm(ˆ θt) = s∞(ˆ θt). Continuity of s∞(·)implies that lim t→∞s∞(ˆ θt) = s∞(ˆ θ) since the limit as t→∞of ˆ θtis ˆ θ. So the above claim is true. Next, by maximization snm(ˆ θnm)≥snm(θ0) which holds in the limit, so lim m→∞snm(ˆ θnm)≥lim m→∞snm(θ0). However, lim m→∞snm(ˆ θnm) = s∞(ˆ θ), as seen above, and lim m→∞snm(θ0) = s∞(θ0) by uniform convergence, so s∞(ˆ θ)≥s∞(θ0). But by assumption (3), there is a unique global maximum of s∞(θ)at θ0,so we must have s∞(ˆ θ) = s∞(θ0),and ˆ θ=θ0.Finally, all of the above limits hold almost surely,
14.2. CONSISTENCY 279 since so far we have held ωfixed, but now we need to consider all ω∈Ω. Therefore {ˆ θn}has only one limit point, θ0,except on a set C⊂Ωwith P(C) = 0. Discussion of the proof: •This proof relies on the identification assumption of a unique global maximum at θ0.An equivalent way to state this is (2) Identification: Any point θin Θwith s∞(θ)≥s∞(θ0)must be such that kθ−θ0k= 0,which matches the way we will write the assumption in the section on nonparametric inference. •We assume that ˆ θnis in fact a global maximum of sn(θ).It is not required to be unique for nfinite, though the identification assumption requires that the limiting objective function have a unique maximizing argument. The previous section on numeric optimization methods showed that actually finding the global maximum of sn(θ)may be a non-trivial problem. •See Amemiya’s Example 4.1.4 for a case where discontinuity leads to breakdown of consistency. •The assumption that θ0is in the interior of Θ(part of the identification assumption) has not been used to prove consistency, so we could directly assume that θ0is simply an element of a compact set Θ.The reason that we assume it’s in the interior here is that this is necessary for subsequent proof of asymptotic normality, and I’d like to maintain a minimal set of simple assumptions, for clarity. Parameters on the boundary of the parameter set cause theoretical difficulties that we will not deal with in this course. Just note that conventional hypothesis testing methods do not apply in this case. •Note that sn(θ)is not required to be continuous, though s∞(θ)is. •The following figures illustrate why uniform convergence is important. In the second figure, if the function is not converging around the lower of the two
14.2. CONSISTENCY 280 maxima, there is no guarantee that the maximizer will be in the neighborhood of the global maximizer. With uniform convergence, the maximum of the sample objective function eventually must be in the neighborhood of the maximum of the limiting objective function With pointwise convergence, the sample objective function may have its maximum far away from that of the limiting objective function
14.2. CONSISTENCY 281 We need a uniform strong law of large numbers in order to verify assumption (2) of Theorem 19. The following theorem is from Davidson, pg. 337. THEOREM 20. [Uniform Strong LLN] Let {Gn(θ)}be a sequence of stochastic real-valued functions on a totally-bounded metric space (Θ,ρ).Then sup θ∈Θ|Gn(θ)|a.s. →0 if and only if (a) Gn(θ)a.s. →0 for each θ∈Θ0,where Θ0is a dense subset of Θand (b) {Gn(θ)}is strongly stochastically equicontinuous.. •The metric space we are interested in now is simply Θ⊂ℜK,using the Euclidean norm. •The pointwise almost sure convergence needed for assuption (a) comes from one of the usual SLLN’s. •Stronger assumptions that imply those of the theorem are: –the parameter space is compact (this has already been assumed) –the objective function is continuous and bounded with probability one on the entire parameter space –a standard SLLN can be shown to apply to some point in the parameter space •These are reasonable conditions in many cases, and henceforth when dealing with specific estimators we’ll simply assume that pointwise almost sure convergence can be extended to uniform almost sure convergence in this way. •The more general theorem is useful in the case that the limiting objective function can be continuous in θeven if sn(θ)is discontinuous. This can happen because discontinuities may be smoothed out as we take expectations
14.5. EXAMPLES 288 order conditions ZXp(x,θ0) p(x,θ∗) ∂ ∂θ p(x,θ∗)−1−p(x,θ0) 1−p(x,θ∗) ∂ ∂θ p(x,θ∗)µ(x)dx =0 This is clearly solved by θ∗=θ0.Provided the solution is unique, ˆ θis consistent. Question: what’s needed to ensure that the solution is unique? The asymptotic normality theorem tells us that √nˆ θ−θ0d →N0,J∞(θ0)−1I∞(θ0)J∞(θ0)−1. In the case of i.i.d. observations I∞(θ0) = limn→∞Var√nDθsn(θ0)is simply the expectation of a typical element of the outer product of the gradient. •There’s no need to subtract the mean, since it’s zero, following the f.o.c. in the consistency proof above and the fact that observations are i.i.d. •The terms in nalso drop out by the same argument: lim n→∞Var√nDθsn(θ0) = lim n→∞Var√nDθ 1 n∑ t s(θ0) =lim n→∞Var 1 √nDθ∑ t s(θ0) =lim n→∞ 1 nVar∑ t Dθs(θ0) =lim n→∞VarDθs(θ0) =VarDθs(θ0) So we get I∞(θ0) = E∂ ∂θs(y,x,θ0)∂ ∂θ0s(y,x,θ0). Likewise, J∞(θ0) = E∂2 ∂θ∂θ0s(y,x,θ0).
14.5. EXAMPLES 289 Expectations are jointly over yand x,or equivalently, first over yconditional on x,then over x.From above, a typical element of the objective function is s(y,x,θ0) = yln p(x,θ0) + (1−y)ln1−p(x,θ0). Now suppose that we are dealing with a correctly specified logit model: p(x,θ) = 1+exp(−x0θ)−1. We can simplify the above results in this case. We have that ∂ ∂θ p(x,θ) = 1+exp(−x0θ)−2exp(−x0θ)x =1+exp(−x0θ)−1exp(−x0θ) 1+exp(−x0θ)x =p(x,θ)(1−p(x,θ))x =p(x,θ)−p(x,θ)2x. So ∂ ∂θs(y,x,θ0) = y−p(x,θ0)x(14.5.3) ∂2 ∂θ∂θ0s(θ0) = −p(x,θ0)−p(x,θ0)2xx0. Taking expectations over ythen xgives I∞(θ0) = ZEYy2−2p(x,θ0)p(x,θ0) + p(x,θ0)2xx0µ(x)dx(14.5.4) =Zp(x,θ0)−p(x,θ0)2xx0µ(x)dx.(14.5.5)
14.5. EXAMPLES 290 where we use the fact that EY(y) = EY(y2) = p(x,θ0). Likewise, (14.5.6) J∞(θ0) = −Zp(x,θ0)−p(x,θ0)2xx0µ(x)dx. Note that we arrive at the expected result: the information matrix equality holds (that is, J∞(θ0) = −I∞(θ0)). With this, √nˆ θ−θ0d →N0,J∞(θ0)−1I∞(θ0)J∞(θ0)−1 simplifies to √nˆ θ−θ0d →N0,−J∞(θ0)−1 which can also be expressed as √nˆ θ−θ0d →N0,I∞(θ0)−1. On a final note, the logit and standard normal CDF’s are very similar - the logit distribution is a bit more fat-tailed. While coefficients will vary slightly between the two models, functions of interest such as estimated probabilities p(x,ˆ θ)will be virtually identical for the two models. 14.5.2. Example: Linearization of a nonlinear model. Ref. Gourieroux and Monfort, section 8.3.4. White, Intn’l Econ. Rev. 1980 is an earlier reference. Suppose we have a nonlinear model yi=h(xi,θ0)+εi where εi∼iid(0,σ2)
14.5. EXAMPLES 291 The nonlinear least squares estimator solves ˆ θn=argmin 1 n n ∑ i=1 (yi−h(xi,θ))2 We’ll study this more later, but for now it is clear that the foc for minimization will require solving a set of nonlinear equations. A common approach to the problem seeks to avoid this difficulty by linearizing the model. A first order Taylor’s series expansion about the point x0with remainder gives yi=h(x0,θ0)+(xi−x0)0∂h(x0,θ0) ∂x+νi where νiencompasses both εiand the Taylor’s series remainder. Note that νiis no longer a classical error - its mean is not zero. We should expect problems. Define α∗=h(x0,θ0)−x0 0 ∂h(x0,θ0) ∂x β∗=∂h(x0,θ0) ∂x Given this, one might try to estimate α∗and β∗by applying OLS to yi=α+βxi+νi •Question, will ˆ αand ˆ βbe consistent for α∗and β∗? •The answer is no, as one can see by interpreting ˆ αand ˆ βas extremum estimators. Let γ= (α,β0)0. ˆ γ=argminsn(γ) = 1 n n ∑ i=1 (yi−α−βxi)2 The objective function converges to its expectation sn(γ)u.a.s. →s∞(γ) = EXEY|X(y−α−βx)2
14.5. EXAMPLES 292 and ˆ γconverges a.s.to the γ0that minimizes s∞(γ): γ0=argminEXEY|X(y−α−βx)2 Noting that EXEY|Xy−α−x0β2=EXEY|Xh(x,θ0)+ε−α−βx2 =σ2+EXh(x,θ0)−α−βx2 since cross products involving εdrop out. α0and β0correspond to the hyperplane that is closest to the true regression function h(x,θ0)according to the mean squared error criterion. This depends on both the shape of h(·)and the density function of the conditioning variables. x_0 α β x x x x x xx x x x Tangent line Fitted line Inconsistency of the linear approximation, even at the approximation point h(x,θ) •It is clear that the tangent line does not minimize MSE, since, for example, if h(x,θ0)is concave, all errors between the tangent line and the true function are negative.
14.5. EXAMPLES 293 •Note that the true underlying parameter θ0is not estimated consistently, either (it may be of a different dimension than the dimension of the parameter of the approximating model, which is 2 in this example). •Second order and higher-order approximations suffer from exactly the same problem, though to a less severe degree, of course. For this reason, translog, Generalized Leontiev and other “flexible functional forms” based upon secondorder approximations in general suffer from bias and inconsistency. The bias may not be too important for analysis of conditional means, but it can be very important for analyzing first and second derivatives. In production and consumer analysis, first and second derivatives (e.g., elasticities of substitution) are often of interest, so in this case, one should be cautious of unthinking application of models that impose stong restrictions on second derivatives. •This sort of linearization about a long run equilibrium is a common practice in dynamic macroeconomic models. It is justified for the purposes of theoretical analysis of a model given the model’s parameters, but it is not justifiable for the estimation of the parameters of the model using data. The section on simulation-based methods offers a means of obtaining consistent estimators of the parameters of dynamic macro models that are too complex for standard methods of analysis.
14.5. EXAMPLES 294 Chapter Exercises (1) Suppose that xi∼uniform(0,1), and yi=1−x2 i+εi,where εiis iid(0,σ2). Suppose we estimate the misspecified model yi=α+βxi+ηiby OLS. Find the numeric values of α0and β0that are the probability limits of ˆ αand ˆ β (2) Verify your results using Octave by generating data that follows the above model, and calculating the OLS estimator. When the sample size is very large the estimator should be very close to the analytical results you obtained in question 1. (3) Use the asymptotic normality theorem to find the asymptotic distribution of the ML estimator of β0for the model y=xβ0+ε,where ε∼N(0,1)and is independent of x.This means finding ∂2 ∂β∂β0sn(β),J(β0),∂sn(β) ∂β ,and I(β0). The expressions may involve the unspecified density of x. (4) Assume a d.g.p. follows the logit model: Pr(y=1|x) = 1+exp(−β0x)−1. (a) Assume that x∼uniform(-a,a). Find the asymptotic distribution of the ML estimator of β0(this is a scalar parameter). (b) Now assume that x∼uniform(-2a,2a). Again find the asymptotic distribution of the ML estimator of β0. (c) Comment on the results
CHAPTER 15 Generalized method of moments (GMM) Readings: Hamilton Ch. 14∗; Davidson and MacKinnon, Ch. 17 (see pg. 587 for refs. to applications); Newey and McFadden (1994), “Large Sample Estimation and Hypothesis Testing,” in Handbook of Econometrics, Vol. 4, Ch. 36. 15.1. Definition We’ve already seen one example of GMM in the introduction, based upon the χ2distribution. Consider the following example based upon the t-distribution. The density function of a t-distributed r.v. Ytis fYt(yt,θ0) = Γθ0+1/2 (πθ0)1/2Γ(θ0/2)1+y2 t/θ0−(θ0+1)/2 Given an iid sample of size n,one could estimate θ0by maximizing the log-likelihood function ˆ θ≡argmax ΘlnLn(θ) = n ∑ t=1 ln fYt(yt,θ) •This approach is attractive since ML estimators are asymptotically efficient. This is because the ML estimator uses all of the available information (e.g., the distribution is fully specified up to a parameter). Recalling that a distribution is completely characterized by its moments, the ML estimator is interpretable as a GMM estimator that uses all of the moments. The method of moments estimator uses only Kmoments to estimate a K−dimensional 295
15.1. DEFINITION 296 parameter. Since information is discarded, in general, by the MM estimator, efficiency is lost relative to the ML estimator. •Continuing with the example, a t-distributed r.v. with density fYt(yt,θ0)has mean zero and variance V(yt) = θ0/θ0−2(for θ0>2). •Using the notation introduced previously, define a moment condition m1t(θ) = θ/(θ−2)−y2 tand m1(θ) = 1/n∑n t=1m1t(θ) = θ/(θ−2)−1/n∑n t=1y2 t.As before, when evaluated at the true parameter value θ0,both Eθ0m1t(θ0)=0 and Eθ0m1(θ0)=0. •Choosing ˆ θto set m1(ˆ θ)≡0 yields a MM estimator: (15.1.1) ˆ θ=2 1−n ∑iy2 i This estimator is based on only one moment of the distribution - it uses less information than the ML estimator, so it is intuitively clear that the MM estimator will be inefficient relative to the ML estimator. •An alternative MM estimator could be based upon the fourth moment of the t-distribution. The fourth moment of a t-distributed r.v. is µ4≡E(y4 t) = 3θ02 (θ0−2)(θ0−4), provided θ0>4.We can define a second moment condition m2(θ) = 3(θ)2 (θ−2)(θ−4)−1 n n ∑ t=1 y4 t •A second, different MM estimator chooses ˆ θto set m2(ˆ θ)≡0.If you solve this you’ll see that the estimate is different from that in equation 15.1.1. This estimator isn’t efficient either, since it uses only one moment. A GMM estimator would use the two moment conditions together to estimate the single parameter. The
15.1. DEFINITION 297 GMM estimator is overidentified, which leads to an estimator which is efficient relative to the just identified MM estimators (more on efficiency later). •As before, set mn(θ) = (m1(θ),m2(θ))0.The nsubscript is used to indicate the sample size. Note that m(θ0) = Op(n−1/2),since it is an average of centered random variables, whereas m(θ) = Op(1),θ6=θ0,where expectations are taken using the true distribution with parameter θ0.This is the fundamental reason that GMM is consistent. •A GMM estimator requires defining a measure of distance, d(m(θ)). A popular choice (for reasons noted below) is to set d(m(θ)) = m0Wnm,and we minimize sn(θ) = m(θ)0Wnm(θ).We assume Wnconverges to a finite positive definite matrix. •In general, assume we have gmoment conditions, so m(θ)is a g-vector and Wis a g×gmatrix. For the purposes of this course, the following definition of the GMM estimator is sufficiently general: DEFINITION 24. The GMM estimator of the K-dimensional parameter vector θ0,ˆ θ≡argminΘsn(θ)≡mn(θ)0Wnmn(θ),where mn(θ) = 1 n∑n t=1mt(θ)is a g-vector, g≥K,with Eθm(θ) = 0,and Wnconverges almost surely to a finite g×gsymmetric positive definite matrix W∞. What’s the reason for using GMM if MLE is asymptotically efficient? •Robustness: GMM is based upon a limited set of moment conditions. For consistency, only these moment conditions need to be correctly specified, whereas MLE in effect requires correct specification of every conceivable moment condition. GMM is robust with respect to distributional misspecification. The price for robustness is loss of efficiency with respect to the MLE
15.5. ESTIMATION OF THE VARIANCE-COVARIANCE MATRIX 304 15.5. Estimation of the variance-covariance matrix (See Hamilton Ch. 10, pp. 261-2 and 280-84)∗. In the case that we wish to use the optimal weighting matrix, we need an estimate of Ω∞,the limiting variance-covariance matrix of √nmn(θ0). While one could estimate Ω∞parametrically, we in general have little information upon which to base a parametric specification. In general, we expect that: •mtwill be autocorrelated (Γts =E(mtm0 t−s)6=0). Note that this autocovariance will not depend on tif the moment conditions are covariance stationary. •contemporaneously correlated, since the individual moment conditions will not in general be independent of one another (E(mitmjt)6=0). •and have different variances (E(m2 it) = σ2 it ). Since we need to estimate so many components if we are to take the parametric approach, it is unlikely that we would arrive at a correct parametric specification. For this reason, research has focused on consistent nonparametric estimators of Ω∞. Henceforth we assume that mtis covariance stationary (the covariance between mt and mt−sdoes not depend on t).Define the v−th autocovariance of the moment conditions Γv=E(mtm0 t−s).Note that E(mtm0 t+s) = Γ0 v.Recall that mtand mare functions of θ,so for now assume that we have some consistent estimator of θ0,so that ˆmt=mt(ˆ θ). Now Ωn=Enm(θ0)m(θ0)0=E"n 1/n n ∑ t=1 mt! 1/n n ∑ t=1 m0 t!# =E"1/n n ∑ t=1 mt! n ∑ t=1 m0 t!# =Γ0+n−1 nΓ1+Γ0 1+n−2 nΓ2+Γ0 2···+1 nΓn−1+Γ0 n−1
15.5. ESTIMATION OF THE VARIANCE-COVARIANCE MATRIX 305 A natural, consistent estimator of Γvis b Γv=1/n n ∑ t=v+1 ˆmtˆm0 t−v. (you might use n−vin the denominator instead). So, a natural, but inconsistent, estimator of Ω∞would be ˆ Ω=c Γ0+n−1 nc Γ1+c Γ0 1+n−2 nc Γ2+c Γ0 2+···+d Γn−1+d Γ0 n−1 =c Γ0+ n−1 ∑ v=1 n−v nb Γv+b Γ0 v. This estimator is inconsistent in general, since the number of parameters to estimate is more than the number of observations, and increases more rapidly than n, so information does not build up as n→∞. On the other hand, supposing that Γvtends to zero sufficiently rapidly as vtends to ∞,a modified estimator ˆ Ω=c Γ0+ q(n) ∑ v=1b Γv+b Γ0 v, where q(n)p →∞as n→∞will be consistent, provided q(n)grows sufficiently slowly. The term n−v ncan be dropped because q(n)must be op(n).This allows information to accumulate at a rate that satisfies a LLN. A disadvantage of this estimator is that it may not be positive definite. This could cause one to calculate a negative χ2statistic, for example! •Note: the formula for ˆ Ωrequires an estimate of m(θ0),which in turn requires an estimate of θ,which is based upon an estimate of Ω! The solution to this circularity is to set the weighting matrix Warbitrarily (for example to an identity matrix), obtain a first consistent but inefficient estimate of θ0,then
15.5. ESTIMATION OF THE VARIANCE-COVARIANCE MATRIX 306 use this estimate to form ˆ Ω,then re-estimate θ0.The process can be iterated until neither ˆ Ωnor ˆ θchange appreciably between iterations. 15.5.1. Newey-West covariance estimator. The Newey-West estimator (Econometrica, 1987) solves the problem of possible nonpositive definiteness of the above estimator. Their estimator is ˆ Ω=c Γ0+ q(n) ∑ v=11−v q+1b Γv+b Γ0 v. This estimator is p.d. by construction. The condition for consistency is that n−1/4q→ 0.Note that this is a very slow rate of growth for q.This estimator is nonparametric - we’ve placed no parametric restrictions on the form of Ω.It is an example of a kernel estimator. In a more recent paper, Newey and West (Review of Economic Studies, 1994) use pre-whitening before applying the kernel estimator. The idea is to fit a VAR model to the moment conditions. It is expected that the residuals of the VAR model will be more nearly white noise, so that the Newey-West covariance estimator might perform better with short lag lengths.. The VAR model is ˆmt=Θ1ˆmt−1+···+Θpˆmt−p+ut This is estimated, giving the residuals ˆut.Then the Newey-West covariance estimator is applied to these pre-whitened residuals, and the covariance Ωis estimated combining the fitted VAR c ˆmt=c Θ1ˆmt−1+···+c Θpˆmt−p with the kernel estimate of the covariance of the ut.See Newey-West for details. •I have a program that does this if you’re interested.
15.6. ESTIMATION USING CONDITIONAL MOMENTS 307 15.6. Estimation using conditional moments So far, the moment conditions have been presented as unconditional expectations. One common way of defining unconditional moment conditions is based upon conditional moment conditions. Suppose that a random variable Yhas zero expectation conditional on the random variable X EY|XY=ZY f (Y|X)dY =0 Then the unconditional expectation of the product of Yand a function g(X)of Xis also zero. The unconditional expectation is EYg(X) = ZXZY Yg(X)f(Y,X)dYdX. This can be factored into a conditional expectation and an expectation w.r.t. the marginal density of X: EYg(X) = ZXZY Yg(X)f(Y|X)dYf(X)dX. Since g(X)doesn’t depend on Yit can be pulled out of the integral EYg(X) = ZXZY Y f (Y|X)dYg(X)f(X)dX. But the term in parentheses on the rhs is zero by assumption, so EY g(X) = 0 as claimed. This is important econometrically, since models often imply restrictions on conditional moments. Suppose a model tells us that the function K(yt,xt)has expectation,
15.6. ESTIMATION USING CONDITIONAL MOMENTS 308 conditional on the information set It,equal to k(xt,θ), EθK(yt,xt)|It=k(xt,θ). •For example, in the context of the classical linear model yt=x0 tβ+εt,we can set K(yt,xt) = ytso that k(xt,θ) = x0 tβ. With this, the function ht(θ) = K(yt,xt)−k(xt,θ) has conditional expectation equal to zero Eθht(θ)|It=0. This is a scalar moment condition, which isn’t sufficient to identify a K-dimensional parameter θ(K>1). However, the above result allows us to form various unconditional expectations mt(θ) = Z(wt)ht(θ) where Z(wt)is a g×1-vector valued function of wtand wtis a set of variables drawn from the information set It.The Z(wt)are instrumental variables. We now have g moment conditions, so as long as g>Kthe necessary condition for identification holds.
15.6. ESTIMATION USING CONDITIONAL MOMENTS 309 One can form the n×gmatrix Zn= Z1(w1)Z2(w1)··· Zg(w1) Z1(w2)Z2(w2)Zg(w2) . . .. . . Z1(wn)Z2(wn)··· Zg(wn) = Z0 1 Z0 2 Z0 n With this we can form the gmoment conditions mn(θ) = 1 nZ0 n h1(θ) h2(θ) . . . hn(θ) =1 nZ0 nhn(θ) =1 n n ∑ t=1 Ztht(θ) =1 n n ∑ t=1 mt(θ) where Z(t,·)is the tth row of Zn.This fits the previous treatment. An interesting question that arises is how one should choose the instrumental variables Z(wt)to achieve maximum efficiency.
15.6. ESTIMATION USING CONDITIONAL MOMENTS 310 Note that with this choice of moment conditions, we have that Dn≡∂ ∂θm0(θ)(a K×gmatrix) is Dn(θ) = ∂ ∂θ 1 nZ0 nhn(θ)0 =1 n∂ ∂θh0 n(θ)Zn which we can define to be Dn(θ) = 1 nHnZn. where Hnis a K×nmatrix that has the derivatives of the individual moment conditions as its columns. Likewise, define the var-cov. of the moment conditions Ωn=Enmn(θ0)mn(θ0)0 =E1 nZ0 nhn(θ0)hn(θ0)0Zn =Z0 nE1 nhn(θ0)hn(θ0)0Zn ≡Z0 n Φn nZn where we have defined Φn=Varhn(θ0).Note that the dimension of this matrix is growing with the sample size, so it is not consistently estimable without additional assumptions. The asymptotic normality theorem above says that the GMM estimator using the optimal weighting matrix is distributed as √nˆ θ−θ0d →N(0,V∞)
15.6. ESTIMATION USING CONDITIONAL MOMENTS 311 where (15.6.1) V∞=lim n→∞ HnZn nZ0 nΦnZn n−1Z0 nH0 n n!−1 . Using an argument similar to that used to prove that Ω−1 ∞is the efficient weighting matrix, we can show that putting Zn=Φ−1 nH0 n causes the above var-cov matrix to simplify to (15.6.2) V∞=lim n→∞HnΦ−1 nH0 n n−1 . and furthermore, this matrix is smaller that the limiting var-cov for any other choice of instrumental variables. (To prove this, examine the difference of the inverses of the var-cov matrices with the optimal intruments and with non-optimal instruments. As above, you can show that the difference is positive semi-definite). •Note that both Hn,which we should write more properly as Hn(θ0),since it depends on θ0,and Φmust be consistently estimated to apply this. •Usually, estimation of Hnis straightforward - one just uses b H=∂ ∂θh0 n˜ θ, where ˜ θis some initial consistent estimator based on non-optimal instruments. •Estimation of Φnmay not be possible. It is an n×nmatrix, so it has more unique elements than n,the sample size, so without restrictions on the parameters it can’t be estimated consistently. Basically, you need to provide a parametric specification of the covariances of the ht(θ)in order to be able
15.8. A SPECIFICATION TEST 312 to use optimal instruments. A solution is to approximate this matrix parametrically to define the instruments. Note that the simplified var-cov matrix in equation 15.6.2 will not apply if approximately optimal instruments are used - it will be necessary to use an estimator based upon equation 15.6.1, where the term Z0 nΦnZn nmust be estimated consistently apart, for example by the Newey-West procedure. 15.7. Estimation using dynamic moment conditions Note that dynamic moment conditions simplify the var-cov matrix, but are often harder to formulate. The will be added in future editions. For now, the Hansen application below is enough. 15.8. A specification test The first order conditions for minimization, using the an estimate of the optimal weighting matrix, are ∂ ∂θs(ˆ θ) = 2∂ ∂θm 0 nˆ θˆ Ω−1mnˆ θ≡0 or D(ˆ θ)ˆ Ω−1mn(ˆ θ)≡0 Consider a Taylor expansion of m(ˆ θ): (15.8.1) m(ˆ θ) = mn(θ0)+D0 n(θ0)ˆ θ−θ0+op(1).
15.8. A SPECIFICATION TEST 313 Multiplying by D(ˆ θ)ˆ Ω−1we obtain D(ˆ θ)ˆ Ω−1m(ˆ θ) = D(ˆ θ)ˆ Ω−1mn(θ0)+D(ˆ θ)ˆ Ω−1D(θ0)0ˆ θ−θ0+op(1) The lhs is zero, and since ˆ θtends to θ0and ˆ Ωtends to Ω∞, we can write D∞Ω−1 ∞mn(θ0)a =−D∞Ω−1 ∞D0 ∞ˆ θ−θ0 or √nˆ θ−θ0a =−√nD∞Ω−1 ∞D0 ∞−1D∞Ω−1 ∞mn(θ0) With this, and taking into account the original expansion (equation 15.8.1), we get √nm(ˆ θ)a =√nmn(θ0)−√nD0 ∞D∞Ω−1 ∞D0 ∞−1D∞Ω−1 ∞mn(θ0). This last can be written as √nm(ˆ θ)a =√nΩ1/2 ∞−D0 ∞D∞Ω−1 ∞D0 ∞−1D∞Ω−1/2 ∞Ω−1/2 ∞mn(θ0) Or √nΩ−1/2 ∞m(ˆ θ)a =√nIg−Ω−1/2 ∞D0 ∞D∞Ω−1 ∞D0 ∞−1D∞Ω−1/2 ∞Ω−1/2 ∞mn(θ0) Now √nΩ−1/2 ∞mn(θ0)d →N(0,Ig) and one can easily verify that P=Ig−Ω−1/2 ∞D0 ∞D∞Ω−1 ∞D0 ∞−1D∞Ω−1/2 ∞
15.9. OTHER ESTIMATORS INTERPRETED AS GMM ESTIMATORS 320 We need to find an Ai×1 vector of instruments xit,for each equation, that are uncorrelated with εit.Typical instruments would be low order monomials in the exogenous variables in zt,with their lagged values. Then we can define the ∑G i=1Ai×1 orthogonality conditions mt(θ) = (y1t−f1(zt,θ1))x1t (y2t−f2(zt,θ2))x2t . . . (yGt −fG(zt,θG))xGt . •A note on identification: selection of instruments that ensure identification is a non-trivial problem. •A note on efficiency: the selected set of instruments has important effects on the efficiency of estimation. Unfortunately there is little theory offering guidance on what is the optimal set. More on this later. 15.9.5. Maximum likelihood. In the introduction we argued that ML will in general be more efficient than GMM since ML implicitly uses all of the moments of the distribution while GMM uses a limited number of moments. Actually, a distribution with Pparameters can be uniquely characterized by Pmoment conditions. However, some sets of Pmoment conditions may contain more information than others, since the moment conditions could be highly correlated. A GMM estimator that chose an optimal set of Pmoment conditions would be fully efficient. Here we’ll see that the optimal moment conditions are simply the scores of the ML estimator. Let ytbe a G-vector of variables, and let Yt= (y0 1,y0 2,...,y0 t)0.Then at time t,Yt−1 has been observed (refer to it as the information set, since we assume the conditioning
15.9. OTHER ESTIMATORS INTERPRETED AS GMM ESTIMATORS 321 variables have been selected to take advantage of all useful information). The likelihood function is the joint density of the sample: L(θ) = f(y1,y2,...,yn,θ) which can be factored as L(θ) = f(yn|Yn−1,θ)·f(Yn−1,θ) and we can repeat this to get L(θ) = f(yn|Yn−1,θ)·f(yn−1|Yn−2,θ)·...·f(y1). The log-likelihood function is therefore lnL(θ) = n ∑ t=1 ln f(yt|Yt−1,θ). Define mt(Yt,θ)≡Dθln f(yt|Yt−1,θ) as the score of the tth observation. It can be shown that, under the regularity conditions, that the scores have conditional mean zero when evaluated at θ0(see notes to Introduction to Econometrics): E{mt(Yt,θ0)|Yt−1}=0 so one could interpret these as moment conditions to use to define a just-identified GMM estimator ( if there are Kparameters there are Kscore equations). The GMM estimator sets 1/n n ∑ t=1 mt(Yt,ˆ θ) = 1/n n ∑ t=1 Dθln f(yt|Yt−1,ˆ θ) = 0,
15.9. OTHER ESTIMATORS INTERPRETED AS GMM ESTIMATORS 322 which are precisely the first order conditions of MLE. Therefore, MLE can be interpreted as a GMM estimator. The GMM varcov formula is V∞=D∞Ω−1D0 ∞−1. Consistent estimates of variance components are as follows •D∞ c D∞=∂ ∂θ0m(Yt,ˆ θ) = 1/n n ∑ t=1 D2 θln f(yt|Yt−1,ˆ θ) •Ω It is important to note that mtand mt−s,s>0 are both conditionally and unconditionally uncorrelated. Conditional uncorrelation follows from the fact that mt−sis a function of Yt−s,which is in the information set at time t. Unconditional uncorrelation follows from the fact that conditional uncorrelation hold regardless of the realization of Yt−1,so marginalizing with respect to Yt−1preserves uncorrelation (see the section on ML estimation, above). The fact that the scores are serially uncorrelated implies that Ωcan be estimated by the estimator of the 0th autocovariance of the moment conditions: b Ω=1/n n ∑ t=1 mt(Yt,ˆ θ)mt(Yt,ˆ θ)0=1/n n ∑ t=1Dθln f(yt|Yt−1,ˆ θ)Dθln f(yt|Yt−1,ˆ θ)0 Recall from study of ML estimation that the information matrix equality (equation ??) states that EnDθln f(yt|Yt−1,θ0)Dθln f(yt|Yt−1,θ0)0o=−ED2 θln f(yt|Yt−1,θ0). This result implies the well known (and already seeen) result that we can estimate V∞ in any of three ways:
15.10. EXAMPLE: THE HAUSMAN TEST 323 •The sandwich version: c V∞=n ∑n t=1D2 θln f(yt|Yt−1,ˆ θ)× n∑n t=1Dθln f(yt|Yt−1,ˆ θ)Dθln f(yt|Yt−1,ˆ θ)0o−1× ∑n t=1D2 θln f(yt|Yt−1,ˆ θ) −1 •or the inverse of the negative of the Hessian (since the middle and last term cancel, except for a minus sign): c V∞="−1/n n ∑ t=1 D2 θln f(yt|Yt−1,ˆ θ)#−1 , •or the inverse of the outer product of the gradient (since the middle and last cancel except for a minus sign, and the first term converges to minus the inverse of the middle term, which is still inside the overall inverse) c V∞=(1/n n ∑ t=1Dθln f(yt|Yt−1,ˆ θ)Dθln f(yt|Yt−1,ˆ θ)0)−1 . This simplification is a special result for the MLE estimator - it doesn’t apply to GMM estimators in general. Asymptotically, if the model is correctly specified, all of these forms converge to the same limit. In small samples they will differ. In particular, there is evidence that the outer product of the gradient formula does not perform very well in small samples (see Davidson and MacKinnon, pg. 477). White’s Information matrix test (Econometrica, 1982) is based upon comparing the two ways to estimate the information matrix: outer product of gradient or negative of the Hessian. If they differ by too much, this is evidence of misspecification of the model. 15.10. Example: The Hausman Test This section discusses the Hausman test, which was originally presented in Hausman, J.A. (1978), Specification tests in econometrics, Econometrica,46, 1251-71.
15.10. EXAMPLE: THE HAUSMAN TEST 324 Consider the simple linear regression model yt=x0 tβ+εt.We assume that the functional form and the choice of regressors is correct, but that the some of the regressors may be correlated with the error term, which as you know will produce inconsistency of ˆ β.For example, this will be a problem if •if some regressors are endogeneous •some regressors are measured with error •lagged values of the dependent variable are used as regressors and εtis autocorrelated. To illustrate, the Octave program biased.m performs a Monte Carlo experiment where errors are correlated with regressors, and estimation is by OLS and IV. Figure 15.10.1 shows that the OLS estimator is quite biased, while Figure 15.10.2 shows that the IV estimator is on average much closer to the true value. If you play with the program, increasing the sample size, you can see evidence that the OLS estimator is asymptotically biased, while the IV estimator is consistent. We have seen that inconsistent and the consistent estimators converge to different probability limits. This is the idea behind the Hausman test - a pair of consistent estimators converge to the same probability limit, while if one is consistent and the other is not they converge to different limits. If we accept that one is consistent (e.g., the IV estimator), but we are doubting if the other is consistent (e.g., the OLS estimator), we might try to check if the difference between the estimators is significantly different from zero. •If we’re doubting about the consistency of OLS (or QML, etc.), why should we be interested in testing - why not just use the IV estimator? Because the OLS estimator is more efficient when the regressors are exogenous and the other classical assumptions (including normality of the errors) hold. When we have a more efficient estimator that relies on stronger assumptions (such
15.10. EXAMPLE: THE HAUSMAN TEST 325 FIGURE 15.10.1. OLS 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 2.26 2.28 2.3 2.32 2.34 2.36 2.38 2.4 OLS estimates line 1 FIGURE 15.10.2. IV 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 1.85 1.9 1.95 2 2.05 2.1 2.15 IV estimates line 1
15.10. EXAMPLE: THE HAUSMAN TEST 326 as exogeneity) than the IV estimator, we might prefer to use it, unless we have evidence that the assumptions are false. So, let’s consider the covariance between the MLE estimator ˆ θ(or any other fully efficient estimator) and some other CAN estimator, say ˜ θ. Now, let’s recall some results from MLE. Equation 4.4.1 is: √nˆ θ−θ0a.s. → −H∞(θ0)−1√ng(θ0). Equation 4.6.2 is H∞(θ) = −I∞(θ). Combining these two equations, we get √nˆ θ−θ0a.s. →I∞(θ0)−1√ng(θ0). Also, equation 4.7.1 tells us that the asymptotic covariance between any CAN estimator and the MLE score vector is V∞ √n˜ θ−θ √ng(θ) = V∞(˜ θ)IK IKI∞(θ) . Now, consider IK0K 0KI∞(θ)−1 √n˜ θ−θ √ng(θ) a.s. → √n˜ θ−θ √nˆ θ−θ .
15.10. EXAMPLE: THE HAUSMAN TEST 327 The asymptotic covariance of this is V∞ √n˜ θ−θ √nˆ θ−θ = IK0K 0KI∞(θ)−1 V∞(˜ θ)IK IKI∞(θ) IK0K 0KI∞(θ)−1 = V∞(˜ θ)I∞(θ)−1 I∞(θ)−1I∞(θ)−1 , which, for clarity in what follows, we might write as V∞ √n˜ θ−θ √nˆ θ−θ = V∞(˜ θ)I∞(θ)−1 I∞(θ)−1V∞(ˆ θ) . So, the asymptotic covariance between the MLE and any other CAN estimator is equal to the MLE asymptotic variance (the inverse of the information matrix). Now, suppose we with to test whether the the two estimators are in fact both converging to θ0, versus the alternative hypothesis that the ”MLE” estimator is not in fact consistent (the consistency of ˜ θis a maintained hypothesis). Under the null hypothesis that they are, we have hIK−IKi √n˜ θ−θ0 √nˆ θ−θ0 =√n˜ θ−ˆ θ, will be asymptotically normally distributed as √n˜ θ−ˆ θd →N0,V∞(˜ θ)−V∞(ˆ θ). So, n˜ θ−ˆ θ0V∞(˜ θ)−V∞(ˆ θ)−1˜ θ−ˆ θd →χ2(ρ),
15.10. EXAMPLE: THE HAUSMAN TEST 328 where ρis the rank of the difference of the asymptotic variances. A statistic that has the same asymptotic distribution is ˜ θ−ˆ θ0ˆ V(˜ θ)−ˆ V(ˆ θ)−1˜ θ−ˆ θd →χ2(ρ). This is the Hausman test statistic, in its original form. The reason that this test has power under the alternative hypothesis is that in that case the ”MLE” estimator will not be consistent, and will converge to θA, say, where θA6=θ0. Then the mean of the asymptotic distribution of vector √n˜ θ−ˆ θwill be θ0−θA, a non-zero vector, so the test statistic will eventually reject, regardless of how small a significance level is used. •Note: if the test is based on a sub-vector of the entire parameter vector of the MLE, it is possible that the inconsistency of the MLE will not show up in the portion of the vector that has been used. If this is the case, the test may not have power to detect the inconsistency. This may occur, for example, when the consistent but inefficient estimator is not identified for all the parameters of the model. Some things to note: •The rank, ρ, of the difference of the asymptotic variances is often less than the dimension of the matrices, and it may be difficult to determine what the true rank is. If the true rank is lower than what is taken to be true, the test will be biased against rejection of the null hypothesis. The contrary holds if we underestimate the rank. •A solution to this problem is to use a rank 1 test, by comparing only a single coefficient. For example, if a variable is suspected of possibly being endogenous, that variable’s coefficients may be compared.
15.10. EXAMPLE: THE HAUSMAN TEST 329 •This simple formula only holds when the estimator that is being tested for consistency is fully efficient under the null hypothesis. This means that it must be a ML estimator or a fully efficient estimator that has the same asymptotic distribution as the ML estimator. This is quite restrictive since modern estimators such as GMM and QML are not in general fully efficient. Following up on this last point, let’s think of two not necessarily efficient estimators, ˆ θ1and ˆ θ2, where one is assumed to be consistent, but the other may not be. We assume for expositional simplicity that both ˆ θ1and ˆ θ2belong to the same parameter space, and that they can be expressed as generalized method of moments (GMM) estimators. The estimators are defined (suppressing the dependence upon data) by ˆ θi=arg min θi∈Θmi(θi)0Wimi(θi) where mi(θi)is a gi×1 vector of moment conditions, andWiis a gi×gipositive definite weighting matrix, i=1,2.Consider the omnibus GMM estimator (15.10.1) ˆ θ1,ˆ θ2=arg min Θ×Θhm1(θ1)0m2(θ2)0i W10(g1×g2) 0(g2×g1)W2 m1(θ1) m2(θ2) . Suppose that the asymptotic covariance of the omnibus moment vector is Σ=lim n→∞Var √n m1(θ1) m2(θ2) (15.10.2) ≡ Σ1Σ12 ·Σ2 . The standard Hausman test is equivalent to a Wald test of the equality of θ1and θ2(or subvectors of the two) applied to the omnibus GMM estimator, but with the covariance
15.12. EMPIRICAL EXAMPLE: A PORTFOLIO MODEL 336 For two lags the estimation results are MPITB extensions found ****************************************************** Example of GMM estimation of rational expectations model GMM Estimation Results BFGS convergence: Normal convergence Objective function value: 0.037882 Observations: 93 Value df p-value X^2 test 3.523 3.000 0.318 estimate st. err t-stat p-value beta 0.857 0.024 35.636 0.000 gamma -2.351 0.315 -7.462 0.000 ****************************************************** Pretty clearly, the results are sensitive to the choice of instruments. Maybe there is some problem here: poor instruments, or possibly a conditional moment that is not very informative.
15.12. EMPIRICAL EXAMPLE: A PORTFOLIO MODEL 337 Exercises (1) Show how to cast the generalized IV estimator presented in section 11.4 as a GMM estimator. Identify what are the moment conditions, mt(θ), what is the form of the the matrix Dn,what is the efficient weight matrix, and show that the covariance matrix formula given previously corresponds to the GMM covariance matrix formula. (2) Using Octave, generate data from the logit dgp . Recall that E(yt|xt) = p(xt,θ) = [1+exp(−xt0θ)]−1. Consider the moment condtions (exactly identified) mt(θ) = [yt−p(xt,θ)]xt (a) Estimate by GMM, using these moments. (b) Estimate by MLE. (c) The two estimators should coincide. Prove analytically that the estimators coicide. (3) Verify the missing steps needed to show that n·m(ˆ θ)0ˆ Ω−1m(ˆ θ)has a χ2(g− K)distribution. That is, show that the monster matrix is idempotent and has trace equal to g−K. (4) For the portfolio example, experiment with the program using lags of 3 and 4 periods to define instruments (a) Iterate the estimation of θ= (β,γ)and Ωto convergence. (b) Comment on the results. Are the results sensitive to the set of instruments used? (Look at ˆ Ωas well as ˆ θ.Are these good instruments? Are the instruments highly correlated with one another?
CHAPTER 16 Quasi-ML Quasi-ML is the estimator one obtains when a misspecified probability model is used to calculate an ”ML” estimator. Given a sample of size nof a random vector yand a vector of conditioning variables x,suppose the joint density of Y=y1... ynconditional on X=x1... xn is a member of the parametric family pY(Y|X,ρ),ρ∈Ξ.The true joint density is associated with the vector ρ0: pY(Y|X,ρ0). As long as the marginal density of Xdoesn’t depend on ρ0,this conditional density fully characterizes the random characteristics of samples: i.e., it fully describes the probabilistically important features of the d.g.p. The likelihood function is just this density evaluated at other values ρ L(Y|X,ρ) = pY(Y|X,ρ),ρ∈Ξ. •Let Yt−1=y1... yt−1,Y0=0,and let Xt=x1... xtThe likelihood function, taking into account possible dependence of observations, can be written as L(Y|X,ρ) = n ∏ t=1 pt(yt|Yt−1,Xt,ρ) ≡ n ∏ t=1 pt(ρ) 338
16. QUASI-ML 339 •The average log-likelihood function is: sn(ρ) = 1 nlnL(Y|X,ρ) = 1 n n ∑ t=1 ln pt(ρ) •Suppose that we do not have knowledge of the family of densities pt(ρ). Mistakenly, we may assume that the conditional density of ytis a member of the family ft(yt|Yt−1,Xt,θ),θ∈Θ,where there is no θ0such that ft(yt|Yt−1,Xt,θ0) = pt(yt|Yt−1,Xt,ρ0),∀t(this is what we mean by “misspecified”). •This setup allows for heterogeneous time series data, with dynamic misspecification. The QML estimator is the argument that maximizes the misspecified average log likelihood, which we refer to as the quasi-log likelihood function. This objective function is sn(θ) = 1 n n ∑ t=1 ln ft(yt|Yt−1,Xt,θ0) ≡1 n n ∑ t=1 ln ft(θ) and the QML is ˆ θn=argmax Θsn(θ) A SLLN for dependent sequences applies (we assume), so that sn(θ)a.s. →lim n→∞E1 n n ∑ t=1 ln ft(θ)≡s∞(θ)
16.1. CONSISTENT ESTIMATION OF VARIANCE COMPONENTS 340 We assume that this can be strengthened to uniform convergence, a.s., following the previous arguments. The “pseudo-true” value of θis the value that maximizes ¯s(θ): θ0=argmax Θs∞(θ) Given assumptions so that theorem 19 is applicable, we obtain lim n→∞ ˆ θn=θ0,a.s. •Applying the asymptotic normality theorem, √nˆ θ−θ0d →N0,J∞(θ0)−1I∞(θ0)J∞(θ0)−1 where J∞(θ0) = lim n→∞ED2 θsn(θ0) and I∞(θ0) = lim n→∞Var√nDθsn(θ0). •Note that asymptotic normality only requires that the additional assumptions regarding Jand Ihold in a neighborhood of θ0for Jand at θ0,for I,not throughout Θ.In this sense, asymptotic normality is a local property. 16.1. Consistent Estimation of Variance Components Consistent estimation of J∞(θ0)is straightforward. Assumption (b) of Theorem 22 implies that Jn(ˆ θn) = 1 n n ∑ t=1 D2 θln ft(ˆ θn)a.s. →lim n→∞E1 n n ∑ t=1 D2 θln ft(θ0) = J∞(θ0). That is, just calculate the Hessian using the estimate ˆ θnin place of θ0. Consistent estimation of I∞(θ0)is more difficult, and may be impossible.
16.1. CONSISTENT ESTIMATION OF VARIANCE COMPONENTS 341 •Notation: Let gt≡Dθft(θ0) We need to estimate I∞(θ0) = lim n→∞Var√nDθsn(θ0) =lim n→∞Var√n1 n n ∑ t=1 Dθln ft(θ0) =lim n→∞ 1 nVar n ∑ t=1 gt =lim n→∞ 1 nE( n ∑ t=1 (gt−Egt)! n ∑ t=1 (gt−Egt)!0) This is going to contain a term lim n→∞ 1 n n ∑ t=1 (Egt)(Egt)0 which will not tend to zero, in general. This term is not consistently estimable in general, since it requires calculating an expectation using the true density under the d.g.p., which is unknown. •There are important cases where I∞(θ0)is consistently estimable. For example, suppose that the data come from a random sample (i.e., they are iid). This would be the case with cross sectional data, for example. (Note: under i.i.d. sampling, the joint distribution of (yt,xt)is identical. This does not imply that the conditional density f(yt|xt)is identical). •With random sampling, the limiting objective function is simply s∞(θ0) = EXE0ln f(y|x,θ0) where E0means expectation of y|xand EXmeans expectation respect to the marginal density of x.
16.2. EXAMPLE: THE MEPS DATA 342 •By the requirement that the limiting objective function be maximized at θ0 we have DθEXE0ln f(y|x,θ0) = Dθs∞(θ0) = 0 •The dominated convergence theorem allows switching the order of expectation and differentiation, so DθEXE0ln f(y|x,θ0) = EXE0Dθln f(y|x,θ0) = 0 The CLT implies that 1 √n n ∑ t=1 Dθln f(y|x,θ0)d →N(0,I∞(θ0)). That is, it’s not necessary to subtract the individual means, since they are zero. Given this, and due to independent observations, a consistent estimator is b I=1 n n ∑ t=1 Dθln ft(ˆ θ)Dθ0ln ft(ˆ θ) This is an important case where consistent estimation of the covariance matrix is possible. Other cases exist, even for dynamically misspecified time series models. 16.2. Example: the MEPS Data To check the plausibility of the Poisson model for the MEPS data, we can compare the sample unconditional variance with the estimated unconditional variance according to the Poisson model: d V(y) = ∑n t=1ˆ λt n. Using the program PoissonVariance.m, for OBDV and ERV, we get We see that even after conditioning, the overdispersion is not TABLE 1. Marginal Variances, Sample and Estimated (Poisson) OBDV ERV Sample 38.09 0.151 Estimated 3.28 0.086
16.2. EXAMPLE: THE MEPS DATA 343 captured in either case. There is huge problem with OBDV, and a significant problem with ERV. In both cases the Poisson model does not appear to be plausible. You can check this for the other use measures if you like. 16.2.1. Infinite mixture models: the negative binomial model. Reference: Cameron and Trivedi (1998) Regression analysis of count data, chapter 4. The two measures seem to exhibit extra-Poisson variation. To capture unobserved heterogeneity, a possibility is the random parameters approach. Consider the possibility that the constant term in a Poisson model were random: fY(y|x,ε) = exp(−θ)θy y! θ=exp(x0β+ε) =exp(x0β)exp(ε) =λν where λ=exp(x0β) and ν=exp(ε). Now νcaptures the randomness in the constant. The problem is that we don’t observe ν, so we will need to marginalize it to get a usable density fY(y|x) = Z∞ −∞ exp[−θ]θy y!fv(z)dz This density can be used directly, perhaps using numerical integration to evaluate the likelihood function. In some cases, though, the integral will have an analytic solution. For example, if νfollows a certain one parameter gamma density, then (16.2.1) fY(y|x,φ) = Γ(y+ψ) Γ(y+1)Γ(ψ)ψ ψ+λψλ ψ+λy where φ= (λ,ψ).ψappears since it is the parameter of the gamma density. •For this density, E(y|x) = λ, which we have parameterized λ=exp(x0β)
16.2. EXAMPLE: THE MEPS DATA 344 •The variance depends upon how ψis parameterized. –If ψ=λ/α, where α>0, then V(y|x) = λ+αλ. Note that λis a function of x, so that the variance is too. This is referred to as the NB-I model. –If ψ=1/α, where α>0, then V(y|x) = λ+αλ2. This is referred to as the NB-II model. So both forms of the NB model allow for overdispersion, with the NB-II model allowing for a more radical form. Testing reduction of a NB model to a Poisson model cannot be done by testing α=0 using standard Wald or LR procedures. The critical values need to be adjusted to account for the fact that α=0 is on the boundary of the parameter space. Without getting into details, suppose that the data were in fact Poisson, so there is equidispersion and the true α=0. Then about half the time the sample data will be underdispersed, and about half the time overdispersed. When the data is underdispersed, the MLE of α will be ˆ α=0. Thus, under the null, there will be a probability spike in the asymptotic distribution of pn(ˆ α−α) = √nˆ αat 0, so standard testing methods will not be valid. This program will do estimation using the NB model. Note how modelargs is used to select a NB-I or NB-II density. Here are NB-I estimation results for OBDV: MPITB extensions found OBDV ====================================================== BFGSMIN final results Used analytic gradient ------------------------------------------------------ STRONG CONVERGENCE Function conv 1 Param conv 1 Gradient conv 1 ------------------------------------------------------
16.2. EXAMPLE: THE MEPS DATA 345 Objective function value 2.18573 Stepsize 0.0007 17 iterations ------------------------------------------------------ param gradient change 1.0965 0.0000 -0.0000 0.2551 -0.0000 0.0000 0.2024 -0.0000 0.0000 0.2289 0.0000 -0.0000 0.1969 0.0000 -0.0000 0.0769 0.0000 -0.0000 0.0000 -0.0000 0.0000 1.7146 -0.0000 0.0000 ****************************************************** Negative Binomial model, MEPS 1996 full data set MLE Estimation Results BFGS convergence: Normal convergence Average Log-L: -2.185730 Observations: 4564 estimate st. err t-stat p-value constant -0.523 0.104 -5.005 0.000 pub. ins. 0.765 0.054 14.198 0.000 priv. ins. 0.451 0.049 9.196 0.000 sex 0.458 0.034 13.512 0.000 age 0.016 0.001 11.869 0.000 edu 0.027 0.007 3.979 0.000 inc 0.000 0.000 0.000 1.000 alpha 5.555 0.296 18.752 0.000 Information Criteria CAIC : 20026.7513 Avg. CAIC: 4.3880 BIC : 20018.7513 Avg. BIC: 4.3862 AIC : 19967.3437 Avg. AIC: 4.3750 ******************************************************
16.2. EXAMPLE: THE MEPS DATA 352 Why is all of this in the chapter on QML? Let’s suppose that the correct model for OBDV is in fact the NB-II model. It turns out in this case that the Poisson model will give consistent estimates of the slope parameters (if a model is a member of the linearexponential family and the conditional mean is correctly specified, then the parameters of the conditional mean will be consistently estimated). So the Poisson estimator would be a QML estimator that is consistent for some parameters of the true model. The ordinary OPG or inverse Hessinan ”ML” covariance estimators are however biased and inconsistent, since the information matrix equality does not hold for QML estimators. But for i.i.d. data (which is the case for the MEPS data) the QML asymptotic covariance can be consistently estimated, as discussed above, using the sandwich form for the ML estimator. mle_results in fact reports sandwich results, so the Poisson estimation results would be reliable for inference even if the true model is the NB-I or NB-II. Not that they are in fact similar to the results for the NB models. However, if we assume that the correct model is the MNB-II model, as is favored by the information criteria, then both the Poisson and NB-xmodels will have misspecified mean functions, so the parameters that influence the means would be estimated with bias and inconsistently.
EXERCISES 353 Exercises Exercises (1) Considering the MEPS data (the description is in Section 13.4.2), for the OBDV (y) measure, let ηbe a latent index of health status that has expectation equal to unity.1We suspect that ηand PRIV may be correlated, but we assume that ηis uncorrelated with the other regressors. We assume that E(y|PUB,PRIV,AGE,EDUC,INC,η) =exp(β1+β2PUB +β3PRIV +β4AGE +β5EDUC +β6INC)η. We use the Poisson QML estimator of the model y∼Poisson(λ) λ=exp(β1+β2PUB +β3PRIV +(16.2.2) β4AGE +β5EDUC +β6INC). Since much previous evidence indicates that health care services usage is overdispersed2, this is almost certainly not an ML estimator, and thus is not efficient. However, when ηand PRIV are uncorrelated, this estimator is consistent for the βi parameters, since the conditional mean is correctly specified in that case. When η and PRIV are correlated, Mullahy’s (1997) NLIV estimator that uses the residual function ε=y λ−1, 1A restriction of this sort is necessary for identification. 2Overdispersion exists when the conditional variance is greater than the conditional mean. If this is the case, the Poisson specification is not correct.
EXERCISES 354 where λis defined in equation 16.2.2, with appropriate instruments, is consistent. As instruments we use all the exogenous regressors, as well as the cross products of PUB with the variables in Z={AGE,EDUC,INC}. That is, the full set of instruments is W={1PUB Z PUB ×Z}. (a) Calculate the Poisson QML estimates. (b) Calculate the generalized IV estimates (do it using a GMM formulation - see the portfolio example for hints how to do this). (c) Calculate the Hausman test statistic to test the exogeneity of PRIV. (d) comment on the results
CHAPTER 17 Nonlinear least squares (NLS) Readings: Davidson and MacKinnon, Ch. 2∗and 5∗; Gallant, Ch. 1 17.1. Introduction and definition Nonlinear least squares (NLS) is a means of estimating the parameter of the model yt=f(xt,θ0)+εt. •In general, εtwill be heteroscedastic and autocorrelated, and possibly nonnormally distributed. However, dealing with this is exactly as in the case of linear models, so we’ll just treat the iid case here, εt∼iid(0,σ2) If we stack the observations vertically, defining y= (y1,y2,...,yn)0 f= ( f(x1,θ),f(x1,θ),..., f(x1,θ))0 and ε= (ε1,ε2,...,εn)0 we can write the nobservations as y=f(θ)+ε 355
17.1. INTRODUCTION AND DEFINITION 356 Using this notation, the NLS estimator can be defined as ˆ θ≡argmin Θsn(θ) = 1 n[y−f(θ)]0[y−f(θ)] = 1 nky−f(θ)k2 •The estimator minimizes the weighted sum of squared errors, which is the same as minimizing the Euclidean distance between yand f(θ). The objective function can be written as sn(θ) = 1 ny0y−2y0f(θ)+f(θ)0f(θ), which gives the first order conditions −∂ ∂θf(ˆ θ)0y+∂ ∂θf(ˆ θ)0f(ˆ θ)≡0. Define the n×Kmatrix (17.1.1) F(ˆ θ)≡Dθ0f(ˆ θ). In shorthand, use ˆ Fin place of F(ˆ θ).Using this, the first order conditions can be written as −ˆ F0y+ˆ F0f(ˆ θ)≡0, or (17.1.2) ˆ F0y−f(ˆ θ)≡0. This bears a good deal of similarity to the f.o.c. for the linear model - the derivative of the prediction is orthogonal to the prediction error. If f(θ) = Xθ,then ˆ Fis simply X, so the f.o.c. (with spherical errors) simplify to X0y−X0Xβ=0,
17.2. IDENTIFICATION 357 the usual 0LS f.o.c. We can interpret this geometrically: INSERT drawings of geometrical depiction of OLS and NLS (see Davidson and MacKinnon, pgs. 8,13 and 46). •Note that the nonlinearity of the manifold leads to potential multiple local maxima, minima and saddlepoints: the objective function sn(θ)is not necessarily well-behaved and may be difficult to minimize. 17.2. Identification As before, identification can be considered conditional on the sample, and asymptotically. The condition for asymptotic identification is that sn(θ)tend to a limiting function s∞(θ)such that s∞(θ0)<s∞(θ),∀θ6=θ0.This will be the case if s∞(θ0)is strictly convex at θ0,which requires that D2 θs∞(θ0)be positive definite. Consider the objective function: sn(θ) = 1 n n ∑ t=1 [yt−f(xt,θ)]2 =1 n n ∑ t=1f(xt,θ0)+εt−ft(xt,θ)2 =1 n n ∑ t=1ft(θ0)−ft(θ)2+1 n n ∑ t=1 (εt)2 −2 n n ∑ t=1ft(θ0)−ft(θ)εt •As in example 14.3, which illustrated the consistency of extremum estimators using OLS, we conclude that the second term will converge to a constant which does not depend upon θ. •A LLN can be applied to the third term to conclude that it converges pointwise to 0, as long as f(θ)and εare uncorrelated.
17.2. IDENTIFICATION 358 •Next, pointwise convergence needs to be stregnthened to uniform almost sure convergence. There are a number of possible assumptions one could use. Here, we’ll just assume it holds. •Turning to the first term, we’ll assume a pointwise law of large numbers applies, so (17.2.1) 1 n n ∑ t=1ft(θ0)−ft(θ)2a.s. →Zf(z,θ0)−f(z,θ)2dµ(z), where µ(x)is the distribution function of x.In many cases, f(x,θ)will be bounded and continuous, for all θ∈Θ,so strengthening to uniform almost sure convergence is immediate. For example if f(x,θ) = [1+exp(−xθ)]−1, f:ℜK→(0,1),a bounded range, and the function is continuous in θ. Given these results, it is clear that a minimizer is θ0.When considering identification (asymptotic), the question is whether or not there may be some other minimizer. A local condition for identification is that ∂2 ∂θ∂θ0s∞(θ) = ∂2 ∂θ∂θ0Zf(x,θ0)−f(x,θ)2dµ(x) be positive definite at θ0.Evaluating this derivative, we obtain (after a little work) ∂2 ∂θ∂θ0Zf(x,θ0)−f(x,θ)2dµ(x)θ0 =2ZDθf(z,θ0)0Dθ0f(z,θ0)0dµ(z) the expectation of the outer product of the gradient of the regression function evaluated at θ0.(Note: the uniform boundedness we have already assumed allows passing the derivative through the integral, by the dominated convergence theorem.) This matrix will be positive definite (wp1) as long as the gradient vector is of full rank (wp1). The tangent space to the regression manifold must span a K-dimensional space if we are
17.4. ASYMPTOTIC NORMALITY 359 to consistently estimate a K-dimensional parameter vector. This is analogous to the requirement that there be no perfect colinearity in a linear model. This is a necessary condition for identification. Note that the LLN implies that the above expectation is equal to J∞(θ0) = 2limEF0F n 17.3. Consistency We simply assume that the conditions of Theorem 19 hold, so the estimator is consistent. Given that the strong stochastic equicontinuity conditions hold, as discussed above, and given the above identification conditions an a compact estimation space (the closure of the parameter space Θ),the consistency proof’s assumptions are satisfied. 17.4. Asymptotic normality As in the case of GMM, we also simply assume that the conditions for asymptotic normality as in Theorem 22 hold. The only remaining problem is to determine the form of the asymptotic variance-covariance matrix. Recall that the result of the asymptotic normality theorem is √nˆ θ−θ0d →N0,J∞(θ0)−1I∞(θ0)J∞(θ0)−1, where J∞(θ0)is the almost sure limit of ∂2 ∂θ∂θ0sn(θ)evaluated at θ0,and I∞(θ0) = limVar√nDθsn(θ0) The objective function is sn(θ) = 1 n n ∑ t=1 [yt−f(xt,θ)]2
17.4. ASYMPTOTIC NORMALITY 360 So Dθsn(θ) = −2 n n ∑ t=1 [yt−f(xt,θ)]Dθf(xt,θ). Evaluating at θ0, Dθsn(θ0) = −2 n n ∑ t=1 εtDθf(xt,θ0). Note that the expectation of this is zero, since εtand xtare assumed to be uncorrelated. So to calculate the variance, we can simply calculate the second moment about zero. Also note that n ∑ t=1 εtDθf(xt,θ0) = ∂ ∂θ f(θ0)0ε =F0ε With this we obtain I∞(θ0) = limVar√nDθsn(θ0) =limnE4 n2F0εε’F =4σ2limEF0F n We’ve already seen that J∞(θ0) = 2limEF0F n, where the expectation is with respect to the joint density of xand ε.Combining these expressions for J∞(θ0)and I∞(θ0),and the result of the asymptotic normality theorem, we get √nˆ θ−θ0d →N 0,limEF0F n−1 σ2!.
17.5. EXAMPLE: THE POISSON MODEL FOR COUNT DATA 361 We can consistently estimate the variance covariance matrix using (17.4.1) ˆ F0ˆ F n−1 ˆ σ2, where ˆ Fis defined as in equation 17.1.1 and ˆ σ2=y−f(ˆ θ)0y−f(ˆ θ) n, the obvious estimator. Note the close correspondence to the results for the linear model. 17.5. Example: The Poisson model for count data Suppose that ytconditional on xtis independently distributed Poisson. A Poisson random variable is a count data variable, which means it can take the values {0,1,2,...}. This sort of model has been used to study visits to doctors per year, number of patents registered by businesses per year, etc. The Poisson density is f(yt) = exp(−λt)λyt t yt!,yt∈{0,1,2,...}. The mean of ytis λt,as is the variance. Note that λtmust be positive. Suppose that the true mean is λ0 t=exp(x0 tβ0), which enforces the positivity of λt.Suppose we estimate β0by nonlinear least squares: ˆ β=argminsn(β) = 1 T n ∑ t=1yt−exp(x0 tβ)2
17.7. APPLICATION: LIMITED DEPENDENT VARIABLES AND SAMPLE SELECTION 368 s=x0β+ρσ φ(r0θ) Φ(r0θ)+η(17.7.1) ≡hx0φ(r0θ) Φ(r0θ)i β ζ +η.(17.7.2) where ζ=ρσ. The error term ηhas conditional mean zero, and is uncorrelated with the regressors x0φ(r0θ) Φ(r0θ).At this point, we can estimate the equation by NLS. •Heckman showed how one can estimate this in a two step procedure where first θis estimated, then equation 17.7.2 is estimated by least squares using the estimated value of θto form the regressors. This is inefficient and estimation of the covariance is a tricky issue. It is probably easier (and more efficient) just to do MLE. •The model presented above depends strongly on joint normality. There exist many alternative models which weaken the maintained assumptions. It is possible to estimate consistently without distributional assumptions. See Ahn and Powell, Journal of Econometrics, 1994.
CHAPTER 18 Nonparametric inference 18.1. Possible pitfalls of parametric inference: estimation Readings: H. White (1980) “Using Least Squares to Approximate Unknown Regression Functions,” International Economic Review, pp. 149-70. In this section we consider a simple example, which illustrates both why nonparametric methods may in some cases be preferred to parametric methods. We suppose that data is generated by random sampling of (y,x), where y=f(x) +ε,xis uniformly distributed on (0,2π),and εis a classical error. Suppose that f(x) = 1+3x 2π−x 2π2 The problem of interest is to estimate the elasticity of f(x)with respect to x,throughout the range of x. In general, the functional form of f(x)is unknown. One idea is to take a Taylor’s series approximation to f(x)about some point x0.Flexible functional forms such as the transcendental logarithmic (usually know as the translog) can be interpreted as second order Taylor’s series approximations. We’ll work with a first order approximation, for simplicity. Approximating about x0: h(x) = f(x0)+Dxf(x0)(x−x0) If the approximation point is x0=0,we can write h(x) = a+bx 369
18.1. POSSIBLE PITFALLS OF PARAMETRIC INFERENCE: ESTIMATION 370 The coefficient ais the value of the function at x=0,and the slope is the value of the derivative at x=0.These are of course not known. One might try estimation by ordinary least squares. The objective function is s(a,b) = 1/n n ∑ t=1 (yt−h(xt))2. The limiting objective function, following the argument we used to get equations 14.3.1 and 17.2.1 is s∞(a,b) = Z2π 0(f(x)−h(x))2dx. The theorem regarding the consistency of extremum estimators (Theorem 19) tells us that ˆaand ˆ bwill converge almost surely to the values that minimize the limiting objective function. Solving the first order conditions1reveals that s∞(a,b)obtains its minimum at a0=7 6,b0=1 π.The estimated approximating function ˆ h(x)therefore tends almost surely to h∞(x) = 7/6+x/π In Figure 18.1.1 we see the true function and the limit of the approximation to see the asymptotic bias as a function of x. (The approximating model is the straight line, the true model has curvature.) Note that the approximating model is in general inconsistent, even at the approximation point. This shows that “flexible functional forms” based upon Taylor’s series approximations do not in general lead to consistent estimation of functions. The approximating model seems to fit the true model fairly well, asymptotically. However, we are interested in the elasticity of the function. Recall that an elasticity is 1The following results were obtained using the command maxima -b fff.mac You can get the source file at http://pareto.uab.es/mcreel/Econometrics/Include/Nonparametric/fff.mac .
18.1. POSSIBLE PITFALLS OF PARAMETRIC INFERENCE: ESTIMATION 371 FIGURE 18.1.1. True and simple approximating functions 1 1.5 2 2.5 3 3.5 0 1 2 3 4 5 6 7 Fun1 x/%PI+7/6 the marginal function divided by the average function: ε(x) = xφ0(x)/φ(x) Good approximation of the elasticity over the range of xwill require a good approximation of both f(x)and f0(x)over the range of x.The approximating elasticity is η(x) = xh0(x)/h(x) In Figure 18.1.2 we see the true elasticity and the elasticity obtained from the limiting approximating model. The true elasticity is the line that has negative slope for large x.Visually we see that the elasticity is not approximated so well. Root mean squared error in the approximation of the elasticity is Z2π 0(ε(x)−η(x))2dx1/2 =.31546
18.1. POSSIBLE PITFALLS OF PARAMETRIC INFERENCE: ESTIMATION 372 FIGURE 18.1.2. True and approximating elasticities 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0 1 2 3 4 5 6 7 Fun1 x/(%PI*(x/%PI+7/6)) Now suppose we use the leading terms of a trigonometric series as the approximating model. The reason for using a trigonometric series as an approximating model is motivated by the asymptotic properties of the Fourier flexible functional form (Gallant, 1981, 1982), which we will study in more detail below. Normally with this type of model the number of basis functions is an increasing function of the sample size. Here we hold the set of basis function fixed. We will consider the asymptotic behavior of a fixed model, which we interpret as an approximation to the estimator’s behavior in finite samples. Consider the set of basis functions: Z(x) = h1xcos(x)sin(x)cos(2x)sin(2x)i. The approximating model is gK(x) = Z(x)α.
18.1. POSSIBLE PITFALLS OF PARAMETRIC INFERENCE: ESTIMATION 373 FIGURE 18.1.3. True function and more flexible approximation 1 1.5 2 2.5 3 3.5 0 1 2 3 4 5 6 7 Fun1 Fun2 Maintaining these basis functions as the sample size increases, we find that the limiting objective function is minimized at a1=7 6,a2=1 π,a3=−1 π2,a4=0,a5=−1 4π2,a6=0. Substituting these values into gK(x)we obtain the almost sure limit of the approximation (18.1.1) g∞(x) = 7/6+x/π+ (cosx)−1 π2+(sinx)0+ (cos2x)−1 4π2+(sin2x)0 In Figure 18.1.3 we have the approximation and the true function: Clearly the truncated trigonometric series model offers a better approximation, asymptotically, than does the linear model. In Figure 18.1.4 we have the more flexible approximation’s elasticity and that of the true function: On average, the fit is better, though there is
18.2. POSSIBLE PITFALLS OF PARAMETRIC INFERENCE: HYPOTHESIS TESTING 374 FIGURE 18.1.4. True elasticity and more flexible approximation 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0 1 2 3 4 5 6 7 Fun1 Fun2 some implausible wavyness in the estimate. Root mean squared error in the approximation of the elasticity is Z2π 0ε(x)−g0 ∞(x)x g∞(x)2 dx!1/2 =.16213, about half that of the RMSE when the first order approximation is used. If the trigonometric series contained infinite terms, this error measure would be driven to zero, as we shall see. 18.2. Possible pitfalls of parametric inference: hypothesis testing What do we mean by the term “nonparametric inference”? Simply, this means inferences that are possible without restricting the functions of interest to belong to a parametric family. •Consider means of testing for the hypothesis that consumers maximize utility. A consequence of utility maximization is that the Slutsky matrix D2 ph(p,U),
18.2. POSSIBLE PITFALLS OF PARAMETRIC INFERENCE: HYPOTHESIS TESTING 375 where h(p,U)are the a set of compensated demand functions, must be negative semi-definite. One approach to testing for utility maximization would estimate a set of normal demand functions x(p,m). •Estimation of these functions by normal parametric methods requires specification of the functional form of demand, for example x(p,m) = x(p,m,θ0) + ε,θ0∈Θ0, where x(p,m,θ0)is a function of known form and Θ0is a finite dimensional parameter. •After estimation, we could use ˆx=x(p,m,ˆ θ)to calculate (by solving the integrability problem, which is non-trivial) b D2 ph(p,U).If we can statistically reject that the matrix is negative semi-definite, we might conclude that consumers don’t maximize utility. •The problem with this is that the reason for rejection of the theoretical proposition may be that our choice of functional form is incorrect. In the introductory section we saw that functional form misspecification leads to inconsistent estimation of the function and its derivatives. •Testing using parametric models always means we are testing a compound hypothesis. The hypothesis that is tested is 1) the economic proposition we wish to test, and 2) the model is correctly specified. Failure of either 1) or 2) can lead to rejection. This is known as the “model-induced augmenting hypothesis.” •Varian’s WARP allows one to test for utility maximization without specifying the form of the demand functions. The only assumptions used in the test are those directly implied by theory, so rejection of the hypothesis calls into question the theory.
18.3. THE FOURIER FUNCTIONAL FORM 376 •Nonparametric inference allows direct testing of economic propositions, without the “model-induced augmenting hypothesis”. 18.3. The Fourier functional form Readings: Gallant, 1987, “Identification and consistency in semi-nonparametric regression,” in Advances in Econometrics, Fifth World Congress, V. 1, Truman Bewley, ed., Cambridge. •Suppose we have a multivariate model y=f(x)+ε, where f(x)is of unknown form and xis a P−dimensional vector. For simplicity, assume that εis a classical error. Let us take the estimation of the vector of elasticities with typical element ξxi=xi f(x) ∂f(x) ∂xif(x), at an arbitrary point xi. The Fourier form, following Gallant (1982), but with a somewhat different parameterization, may be written as (18.3.1) gK(x|θK) = α+x0β+1/2x0Cx+ A ∑ α=1 J ∑ j=1ujαcos(jk0 αx)−vjαsin(jk0 αx). where the K-dimensional parameter vector (18.3.2) θK={α,β0,vec∗(C)0,u11,v11,...,uJA,vJA}0.
18.3. THE FOURIER FUNCTIONAL FORM 377 •We assume that the conditioning variables xhave each been transformed to lie in an interval that is shorter than 2π.This is required to avoid periodic behavior of the approximation, which is desirable since economic functions aren’t periodic. For example, subtract sample means, divide by the maxima of the conditioning variables, and multiply by 2π−eps,where eps is some positive number less than 2πin value. •The kαare ”elementary multi-indices” which are simply P−vectors formed of integers (negative, positive and zero). The kα,α=1,2,...,Aare required to be linearly independent, and we follow the convention that the first non-zero element be positive. For example h01−101i0 is a potential multi-index to be used, but h0−1−101i0 is not since its first nonzero element is negative. Nor is h02−202i0 a multi-index we would use, since it is a scalar multiple of the original multiindex. •We parameterize the matrix Cdifferently than does Gallant because it simplifies things in practice. The cost of this is that we are no longer able to test a quadratic specification using nested testing.
18.3. THE FOURIER FUNCTIONAL FORM 384 With random sampling, as in the case of Equations 14.3.1 and 17.2.1, the limiting objective function is (18.3.6) s∞(g,f) = −ZX (f(x)−g(x))2dµx −σ2 ε. where the true function f(x)takes the place of the generic function h∗in the presentation of the theorem. Both g(x)and f(x)are elements of ∪∞HK. The pointwise convergence of the objective function needs to be strengthened to uniform convergence. We will simply assume that this holds, since the way to verify this depends upon the specific application. We also have continuity of the objective function in g,with respect to the norm khk1,Xsince lim kg1−g0k1,X→0s∞g1,f)−s∞g0,f) =lim kg1−g0k1,X→0ZXhg1(x)−f(x)2−g0(x)−f(x)2idµx. By the dominated convergence theorem (which applies since the finite bound Dused to define W2,Z(D)is dominated by an integrable function), the limit and the integral can be interchanged, so by inspection, the limit is zero. 18.3.6. Identification. The identification condition requires that for any point (g,f) in H×H,s∞(g,f)≥s∞(f,f)⇒ kg−fk1,X=0. This condition is clearly satisfied given that gand fare once continuously differentiable (by the assumption that defines the estimation space). 18.3.7. Review of concepts. For the example of estimation of first-order elasticities, the relevant concepts are:
18.3. THE FOURIER FUNCTIONAL FORM 385 •Estimation space H=W2,X(D): the function space in the closure of which the true function must lie. •Consistency norm khk1,X.The closure of His compact with respect to this norm. •Estimation subspace HK.The estimation subspace is the subset of Hthat is representable by a Fourier form with parameter θK.These are dense subsets of H. •Sample objective function sn(θK),the negative of the sum of squares. By standard arguments this converges uniformly to the •Limiting objective function s∞(g,f),which is continuous in gand has a global maximum in its first argument, over the closure of the infinite union of the estimation subpaces, at g=f. •As a result of this, first order elasticities xi f(x) ∂f(x) ∂xif(x) are consistently estimated for all x∈X. 18.3.8. Discussion. Consistency requires that the number of parameters used in the expansion increase with the sample size, tending to infinity. If parameters are added at a high rate, the bias tends relatively rapidly to zero. A basic problem is that a high rate of inclusion of additional parameters causes the variance to tend more slowly to zero. The issue of how to chose the rate at which parameters are added and which to add first is fairly complex. A problem is that the allowable rates for asymptotic normality to obtain (Andrews 1991; Gallant and Souza, 1991) are very strict. Supposing we stick to these rates, our approximating model is: gK(x|θK) = z0θK.
18.4. KERNEL REGRESSION ESTIMATORS 386 •Define ZKas the n×Kmatrix of regressors obtained by stacking observations. The LS estimator is ˆ θK=Z0 KZK+Z0 Ky, where (·)+is the Moore-Penrose generalized inverse. –This is used since Z0 KZKmay be singular, as would be the case for K(n) large enough when some dummy variables are included. •. The prediction, z0ˆ θK,of the unknown function f(x)is asymptotically normally distributed: √nz0ˆ θK−f(x)d →N(0,AV), where AV =lim n→∞E"z0Z0 KZK n+ zˆ σ2#. Formally, this is exactly the same as if we were dealing with a parametric linear model. I emphasize, though, that this is only valid if Kgrows very slowly as ngrows. If we can’t stick to acceptable rates, we should probably use some other method of approximating the small sample distribution. Bootstrapping is a possibility. We’ll discuss this in the section on simulation. 18.4. Kernel regression estimators Readings: Bierens, 1987, “Kernel estimators of regression functions,” in Advances in Econometrics, Fifth World Congress, V. 1, Truman Bewley, ed., Cambridge. An alternative method to the semi-nonparametric method is a fully nonparametric method of estimation. Kernel regression estimation is an example (others are splines, nearest neighbor, etc.). We’ll consider the Nadaraya-Watson kernel regression estimator in a simple case.
18.4. KERNEL REGRESSION ESTIMATORS 387 •Suppose we have an iid sample from the joint density f(x,y),where xis k -dimensional. The model is yt=g(xt)+εt, where E(εt|xt) = 0. •The conditional expectation of ygiven xis g(x).By definition of the conditional expectation, we have g(x) = Zyf(x,y) h(x)dy =1 h(x)Zy f (x,y)dy, where h(x)is the marginal density of x: h(x) = Zf(x,y)dy. •This suggests that we could estimate g(x)by estimating h(x)and Ry f (x,y)dy. 18.4.1. Estimation of the denominator. A kernel estimator for h(x)has the form ˆ h(x) = 1 n n ∑ t=1 K[(x−xt)/γn] γk n , where nis the sample size and kis the dimension of x. •The function K(·)(the kernel) is absolutely integrable: Z|K(x)|dx <∞,
18.4. KERNEL REGRESSION ESTIMATORS 388 and K(·)integrates to 1 : ZK(x)dx =1. In this respect, K(·)is like a density function, but we do not necessarily restrict K(·)to be nonnegative. •The window width parameter, γnis a sequence of positive numbers that satisfies lim n→∞γn=0 lim n→∞nγk n=∞ So, the window width must tend to zero, but not too quickly. •To show pointwise consistency of ˆ h(x)for h(x),first consider the expectation of the estimator (since the estimator is an average of iid terms we only need to consider the expectation of a representative term): Eˆ h(x)=Zγ−k nK[(x−z)/γn]h(z)dz. Change variables as z∗= (x−z)/γn,so z=x−γnz∗and |dz dz∗0 |=γk n,we obtain Eˆ h(x)=Zγ−k nK(z∗)h(x−γnz∗)γk ndz∗ =ZK(z∗)h(x−γnz∗)dz∗.
18.4. KERNEL REGRESSION ESTIMATORS 389 Now, asymptotically, lim n→∞Eˆ h(x)=lim n→∞ZK(z∗)h(x−γnz∗)dz∗ =Zlim n→∞K(z∗)h(x−γnz∗)dz∗ =ZK(z∗)h(x)dz∗ =h(x)ZK(z∗)dz∗ =h(x), since γn→0 and RK(z∗)dz∗=1 by assumption. (Note: that we can pass the limit through the integral is a result of the dominated convergence theorem.. For this to hold we need that h(·)be dominated by an absolutely integrable function. •Next, considering the variance of ˆ h(x),we have, due to the iid assumption nγk nVˆ h(x)=nγk n 1 n2 n ∑ t=1 VK[(x−xt)/γn] γk n =γ−k n 1 n n ∑ t=1 V{K[(x−xt)/γn]} •By the representative term argument, this is nγk nVˆ h(x)=γ−k nV{K[(x−z)/γn]} •Also, since V(x) = E(x2)−E(x)2we have nγk nVˆ h(x)=γ−k nEn(K[(x−z)/γn])2o−γ−k n{E(K[(x−z)/γn])}2 =Zγ−k nK[(x−z)/γn]2h(z)dz −γk nZγ−k nK[(x−z)/γn]h(z)dz2 =Zγ−k nK[(x−z)/γn]2h(z)dz −γk nEhbh(x)i2
18.4. KERNEL REGRESSION ESTIMATORS 390 The second term converges to zero: γk nEhbh(x)i2→0, by the previous result regarding the expectation and the fact that γn→0. Therefore, lim n→∞nγk nVˆ h(x)=lim n→∞Zγ−k nK[(x−z)/γn]2h(z)dz. Using exactly the same change of variables as before, this can be shown to be lim n→∞nγk nVˆ h(x)=h(x)Z[K(z∗)]2dz∗. Since both R[K(z∗)]2dz∗and h(x)are bounded, this is bounded, and since nγk n→∞by assumption, we have that Vˆ h(x)→0. •Since the bias and the variance both go to zero, we have pointwise consistency (convergence in quadratic mean implies convergence in probability). 18.4.2. Estimation of the numerator. To estimate Ry f (x,y)dy,we need an estimator of f(x,y).The estimator has the same form as the estimator for h(x),only with one dimension more: ˆ f(x,y) = 1 n n ∑ t=1 K∗[(y−yt)/γn,(x−xt)/γn] γk+1 n The kernel K∗(·)is required to have mean zero: ZyK∗(y,x)dy =0
18.4. KERNEL REGRESSION ESTIMATORS 391 and to marginalize to the previous kernel for h(x): ZK∗(y,x)dy =K(x). With this kernel, we have Zyˆ f(y,x)dy =1 n n ∑ t=1 yt K[(x−xt)/γn] γk n by marginalization of the kernel, so we obtain ˆg(x) = 1 ˆ h(x)Zyˆ f(y,x)dy = 1 n∑n t=1ytK[(x−xt)/γn] γk n 1 n∑n t=1K[(x−xt)/γn] γk n =∑n t=1ytK[(x−xt)/γn] ∑n t=1K[(x−xt)/γn]. This is the Nadaraya-Watson kernel regression estimator. 18.4.3. Discussion. •The kernel regression estimator for g(xt)is a weighted average of the yj,j= 1,2,...,n, where higher weights are associated with points that are closer to xt.The weights sum to 1. •The window width parameter γnimposes smoothness. The estimator is increasingly flat as γn→∞,since in this case each weight tends to 1/n. •A large window width reduces the variance (strong imposition of flatness), but increases the bias. •A small window width reduces the bias, but makes very little use of information except points that are in a small neighborhood of xt.Since relatively little information is used, the variance is large when the window width is small.
18.5. KERNEL DENSITY ESTIMATION 392 •The standard normal density is a popular choice for K(.)and K∗(y,x),though there are possibly better alternatives. 18.4.4. Choice of the window width: Cross-validation. The selection of an appropriate window width is important. One popular method is cross validation. This consists of splitting the sample into two parts (e.g., 50%-50%). The first part is the “in sample” data, which is used for estimation, and the second part is the “out of sample” data, used for evaluation of the fit though RMSE or some other criterion. The steps are: (1) Split the data. The out of sample data is yout and xout . (2) Choose a window width γ. (3) With the in sample data, fit ˆyout tcorresponding to each xout t.This fitted value is a function of the in sample data, as well as the evaluation point xout t, but it does not involve yout t. (4) Repeat for all out of sample points. (5) Calculate RMSE(γ) (6) Go to step 2,or to the next step if enough window widths have been tried. (7) Select the γthat minimizes RMSE(γ)(Verify that a minimum has been found, for example by plotting RMSE as a function of γ). (8) Re-estimate using the best γand all of the data. This same principle can be used to choose Aand Jin a Fourier form model. 18.5. Kernel density estimation The previous discussion suggests that a kernel density estimator may easily be constructed. We have already seen how joint densities may be estimated. If were interested in a conditional density, for example of yconditional on x, then the kernel
18.6. SEMI-NONPARAMETRIC MAXIMUM LIKELIHOOD 393 estimate of the conditional density is simply b fy|x=ˆ f(x,y) ˆ h(x) = 1 n∑n t=1K∗[(y−yt)/γn,(x−xt)/γn] γk+1 n 1 n∑n t=1K[(x−xt)/γn] γk n =1 γn ∑n t=1K∗[(y−yt)/γn,(x−xt)/γn] ∑n t=1K[(x−xt)/γn] where we obtain the expressions for the joint and marginal densities from the section on kernel regression. 18.6. Semi-nonparametric maximum likelihood Readings: Gallant and Nychka, Econometrica, 1987. For a Fortran program to do this and a useful discussion in the user’s guide, see this link . See also Cameron and Johansson, Journal of Applied Econometrics, V. 12, 1997. MLE is the estimation method of choice when we are confident about specifying the density. Is is possible to obtain the benefits of MLE when we’re not so confident about the specification? In part, yes. Suppose we’re interested in the density of yconditional on x(both may be vectors). Suppose that the density f(y|x,φ)is a reasonable starting approximation to the true density. This density can be reshaped by multiplying it by a squared polynomial. The new density is gp(y|x,φ,γ) = h2 p(y|γ)f(y|x,φ) ηp(x,φ,γ) where hp(y|γ) = p ∑ k=0 γkyk
18.7. EXAMPLES 400 Information Criteria CAIC : 19907.6244 Avg. CAIC: 4.3619 BIC : 19897.6244 Avg. BIC: 4.3597 AIC : 19833.3649 Avg. AIC: 4.3456 ****************************************************** Note that the CAIC and BIC are lower for this model than for the models presented in Table 3. This model fits well, still being parsimonious. You can play around trying other use measures, using a NP-II baseline density, and using other orders of expansions. Density functions formed in this way may have MANY local maxima, so you need to be careful before accepting the results of a casual run. To guard against having converged to a local maximum, one can try using multiple starting values, or one could try simulated annealing as an optimization method. If you uncomment the relevant lines in the program, you can use SA to do the minimization. This will take alot of time, compared to the default BFGS minimization. The chapter on parallel computations might be interesting to read before trying this.
CHAPTER 19 Simulation-based estimation Readings: In addition to the book mentioned previously, articles include Gallant and Tauchen (1996), “Which Moments to Match?”, ECONOMETRIC THEORY, Vol. 12, 1996, pages 657-681;˘ a Gourieroux, Monfort and Renault (1993), “Indirect Inference,” J. Apl. Econometrics; Pakes and Pollard (1989) Econometrica; McFadden (1989) Econometrica. 19.1. Motivation Simulation methods are of interest when the DGP is fully characterized by a parameter vector, but the likelihood function is not calculable. If it were available, we would simply estimate by MLE, which is asymptotically fully efficient. 19.1.1. Example: Multinomial and/or dynamic discrete response models. Let y∗ ibe a latent random vector of dimension m.Suppose that y∗ i=Xiβ+εi where Xiis m×K.Suppose that (19.1.1) εi∼N(0,Ω) Henceforth drop the isubscript when it is not needed for clarity. •y∗is not observed. Rather, we observe a many-to-one mapping y=τ(y∗) 401
19.1. MOTIVATION 402 This mapping is such that each element of yis either zero or one (in some cases only one element will be one). •Define Ai=A(yi) = {y∗|yi=τ(y∗)} Suppose random sampling of (yi,Xi). In this case the elements of yimay not be independent of one another (and clearly are not if Ωis not diagonal). However, yiis independent of yj,i6=j. •Let θ= (β0,(vec∗Ω)0)0be the vector of parameters of the model. The contribution of the ith observation to the likelihood function is pi(θ) = ZAi n(y∗ i−Xiβ,Ω)dy∗ i where n(ε,Ω) = (2π)−M/2|Ω|−1/2exp−ε0Ω−1ε 2 is the multivariate normal density of an M-dimensional random vector. The log-likelihood function is lnL(θ) = 1 n n ∑ i=1 ln pi(θ) and the MLE ˆ θsolves the score equations 1 n n ∑ i=1 gi(ˆ θ) = 1 n n ∑ i=1 Dθpi(ˆ θ) pi(ˆ θ)≡0. •The problem is that evaluation of Li(θ)and its derivative w.r.t. θby standard methods of numeric integration such as quadrature is computationally infeasible when m(the dimension of y)is higher than 3 or 4 (as long as there are no restrictions on Ω).
19.1. MOTIVATION 403 •The mapping τ(y∗)has not been made specific so far. This setup is quite general: for different choices of τ(y∗)it nests the case of dynamic binary discrete choice models as well as the case of multinomial discrete choice (the choice of one out of a finite set of alternatives). –Multinomial discrete choice is illustrated by a (very simple) job search model. We have cross sectional data on individuals’ matching to a set of mjobs that are available (one of which is unemployment). The utility of alternative jis uj=Xjβ+εj Utilities of jobs, stacked in the vector uiare not observed. Rather, we observe the vector formed of elements yj=1uj>uk,∀k∈m,k6=j Only one of these elements is different than zero. –Dynamic discrete choice is illustrated by repeated choices over time between two alternatives. Let alternative jhave utility ujt =Wjtβ−εjt, j∈ {1,2} t∈ {1,2,...,m} Then y∗=u2−u1 = (W2−W1)β+ε2−ε1 ≡Xβ+ε
19.1. MOTIVATION 404 Now the mapping is (element-by-element) y=1[y∗>0], that is yit =1 if individual ichooses the second alternative in period t, zero otherwise. 19.1.2. Example: Marginalization of latent variables. Economic data often presents substantial heterogeneity that may be difficult to model. A possibility is to introduce latent random variables. This can cause the problem that there may be no known closed form for the distribution of observable variables after marginalizing out the unobservable latent variables. For example, count data (that takes values 0,1,2,3,...)is often modeled using the Poisson distribution Pr(y=i) = exp(−λ)λi i! The mean and variance of the Poisson distribution are both equal to λ: E(y) = V(y) = λ. Often, one parameterizes the conditional mean as λi=exp(Xiβ). This ensures that the mean is positive (as it must be). Estimation by ML is straightforward. Often, count data exhibits “overdispersion” which simply means that V(y)>E(y).
19.1. MOTIVATION 405 If this is the case, a solution is to use the negative binomial distribution rather than the Poisson. An alternative is to introduce a latent variable that reflects heterogeneity into the specification: λi=exp(Xiβ+ηi) where ηihas some specified density with support S(this density may depend on additional parameters). Let dµ(ηi)be the density of ηi.In some cases, the marginal density of y Pr(y=yi) = ZS exp[−exp(Xiβ+ηi)][exp(Xiβ+ηi)]yi yi!dµ(ηi) will have a closed-form solution (one can derive the negative binomial distribution in the way if ηhas an exponential distribution), but often this will not be possible. In this case, simulation is a means of calculating Pr(y=i),which is then used to do ML estimation. This would be an example of the Simulated Maximum Likelihood (SML) estimation. •In this case, since there is only one latent variable, quadrature is probably a better choice. However, a more flexible model with heterogeneity would allow all parameters (not just the constant) to vary. For example Pr(y=yi) = ZS exp[−exp(Xiβi)][exp(Xiβi)]yi yi!dµ(βi) entails a K=dimβi-dimensional integral, which will not be evaluable by quadrature when Kgets large. 19.1.3. Estimation of models specified in terms of stochastic differential equations. It is often convenient to formulate models in terms of continuous time using differential equations. A realistic model should account for exogenous shocks to the system, which can be done by assuming a random component. This leads to a model
19.1. MOTIVATION 406 that is expressed as a system of stochastic differential equations. Consider the process dyt=g(θ,yt)dt +h(θ,yt)dWt which is assumed to be stationary. {Wt}is a standard Brownian motion (Weiner process), such that W(T) = ZT 0dWt∼N(0,T) Brownian motion is a continuous-time stochastic process such that •W(0) = 0 •[W(s)−W(t)] ∼N(0,s−t) •[W(s)−W(t)] and [W(j)−W(k)] are independent for s>t>j>k.That is, non-overlapping segments are independent. One can think of Brownian motion the accumulation of independent normally distributed shocks with infinitesimal variance. •The function g(θ,yt)is the deterministic part. •h(θ,yt)determines the variance of the shocks. To estimate a model of this sort, we typically have data that are assumed to be observations of ytin discrete points y1,y2,...yT.That is, though ytis a continuous process it is observed in discrete time. To perform inference on θ,direct ML or GMM estimation is not usually feasible, because one cannot, in general, deduce the transition density f(yt|yt−1,θ).This density is necessary to evaluate the likelihood function or to evaluate moment conditions (which are based upon expectations with respect to this density). •A typical solution is to “discretize” the model, by which we mean to find a discrete time approximation to the model. The discretized version of the
19.2. SIMULATED MAXIMUM LIKELIHOOD (SML) 407 model is yt−yt−1=g(φ,yt−1)+h(φ,yt−1)εt εt∼N(0,1) The discretization induces a new parameter, φ(that is, the φ0which defines the best approximation of the discretization to the actual (unknown) discrete time version of the model is not equal to θ0which is the true parameter value). This is an approximation, and as such “ML” estimation of φ(which is actually quasi-maximum likelihood, QML) based upon this equation is in general biased and inconsistent for the original parameter, θ. Nevertheless, the approximation shouldn’t be too bad, which will be useful, as we will see. •The important point about these three examples is that computational difficulties prevent direct application of ML, GMM, etc. Nevertheless the model is fully specified in probabilistic terms up to a parameter vector. This means that the model is simulable, conditional on the parameter vector. 19.2. Simulated maximum likelihood (SML) For simplicity, consider cross-sectional data. An ML estimator solves ˆ θML =argmaxsn(θ) = 1 n n ∑ t=1 ln p(yt|Xt,θ) where p(yt|Xt,θ)is the density function of the tth observation. When p(yt|Xt,θ)does not have a known closed form, ˆ θML is an infeasible estimator. However, it may be possible to define a random function such that Eνf(ν,yt,Xt,θ) = p(yt|Xt,θ)
19.2. SIMULATED MAXIMUM LIKELIHOOD (SML) 408 where the density of νis known. If this is the case, the simulator ˜p(yt,Xt,θ) = 1 H H ∑ s=1 f(νts,yt,Xt,θ) is unbiased for p(yt|Xt,θ). •The SML simply substitutes ˜p(yt,Xt,θ)in place of p(yt|Xt,θ)in the loglikelihood function, that is ˆ θSML =argmaxsn(θ) = 1 n n ∑ i=1 ln ˜p(yt,Xt,θ) 19.2.1. Example: multinomial probit. Recall that the utility of alternative jis uj=Xjβ+εj and the vector yis formed of elements yj=1uj>uk,k∈m,k6=j The problem is that Pr(yj=1|θ)can’t be calculated when mis larger than 4 or 5. However, it is easy to simulate this probability. •Draw ˜ εifrom the distribution N(0,Ω) •Calculate ˜ui=Xiβ+˜ εi(where Xiis the matrix formed by stacking the Xi j) •Define ˜yi j =1ui j >uik,∀k∈m,k6=j •Repeat this Htimes and define eπi j =∑H h=1˜yi jh H •Define eπias the m-vector formed of the eπi j. Each element of eπiis between 0 and 1, and the elements sum to one. •Now ˜p(yi,Xi,θ) = y0 ieπi
19.2. SIMULATED MAXIMUM LIKELIHOOD (SML) 409 •The SML multinomial probit log-likelihood function is lnL(β,Ω) = 1 n n ∑ i=1 y0 iln ˜p(yi,Xi,θ) This is to be maximized w.r.t. βand Ω. Notes: •The Hdraws of ˜ εiare draw only once and are used repeatedly during the iterations used to find ˆ βand ˆ Ω.The draws are different for each i.If the ˜ εiare re-drawn at every iteration the estimator will not converge. •The log-likelihood function with this simulator is a discontinuous function of βand Ω.This does not cause problems from a theoretical point of view since it can be shown that lnL(β,Ω)is stochastically equicontinuous. However, it does cause problems if one attempts to use a gradient-based optimization method such as Newton-Raphson. •It may be the case, particularly if few simulations, H, are used, that some elements of eπiare zero. If the corresponding element of yiis equal to 1, there will be a log(0)problem. •Solutions to discontinuity: –1) use an estimation method that doesn’t require a continuous and differentiable objective function, for example, simulated annealing. This is computationally costly. –2) Smooth the simulated probabilities so that they are continuous functions of the parameters. For example, apply a kernel transformation such as ˜yi j =ΦA×ui j −m max k=1uik+.5×1ui j =m max k=1uik