Econometrics Michael Creel Department of Economics and Economic History Universitat Autònoma de Barcelona February 2014 Contents 1 About this document 16 1.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 1.2 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.3 Licenses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.4 Obtaining the materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.5 An easy way run the examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2 Introduction: Economic and econometric models 23 3 Ordinary Least Squares 28 3.1 The Linear Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 3.2 Estimation by least squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.3 Geometric interpretation of least squares estimation . . . . . . . . . . . . . . . . . . . . 33 3.4 Influential observations and outliers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 3.5 Goodness of fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 3.6 The classical linear regression model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 1 3.7 Small sample statistical properties of the least squares estimator . . . . . . . . . . . . . 46 3.8 Example: The Nerlove model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 3.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 4 Asymptotic properties of the least squares estimator 63 4.1 Consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 4.2 Asymptotic normality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 4.3 Asymptotic efficiency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 4.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 5 Restrictions and hypothesis tests 69 5.1 Exact linear restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 5.2 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 5.3 The asymptotic equivalence of the LR, Wald and score tests . . . . . . . . . . . . . . . 85 5.4 Interpretation of test statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 5.5 Confidence intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 5.6 Bootstrapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 5.7 Wald test for nonlinear restrictions: the delta method . . . . . . . . . . . . . . . . . . . 94 5.8 Example: the Nerlove data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 5.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 6 Stochastic regressors 108 6.1 Case 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 6.2 Case 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 6.3 Case 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 6.4 When are the assumptions reasonable? . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 6.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 7 Data problems 117 7.1 Collinearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 7.2 Measurement error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 7.3 Missing observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 7.4 Missing regressors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 7.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 8 Functional form and nonnested tests 150 8.1 Flexible functional forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 8.2 Testing nonnested hypotheses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 9 Generalized least squares 168 9.1 Effects of nonspherical disturbances on the OLS estimator . . . . . . . . . . . . . . . . 169 9.2 The GLS estimator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 9.3 Feasible GLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 9.4 Heteroscedasticity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 9.5 Autocorrelation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 9.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 10 Endogeneity and simultaneity 235 10.1 Simultaneous equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 10.2 Reduced form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 10.3 Estimation of the reduced form equations . . . . . . . . . . . . . . . . . . . . . . . . . . 243 10.4 Bias and inconsistency of OLS estimation of a structural equation . . . . . . . . . . . . 247 10.5 Note about the rest of this chaper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 10.6 Identification by exclusion restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249 10.7 2SLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 10.8 Testing the overidentifying restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 10.9 System methods of estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 10.10Example: Klein’s Model 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 11 Numeric optimization methods 284 11.1 Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 11.2 Derivative-based methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 11.3 Simulated Annealing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 11.4 A practical example: Maximum likelihood estimation using count data: The MEPS data and the Poisson model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 11.5 Numeric optimization: pitfalls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 11.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 12 Asymptotic properties of extremum estimators 308 12.1 Extremum estimators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 12.2 Existence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 12.3 Consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 12.4 Example: Consistency of Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 12.5 Example: Inconsistency of Misspecified Least Squares . . . . . . . . . . . . . . . . . . . 322 12.6 Example: Linearization of a nonlinear model . . . . . . . . . . . . . . . . . . . . . . . . 322 12.7 Asymptotic Normality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326 12.8 Example: Classical linear model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 12.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 13 Maximum likelihood estimation 332 13.1 The likelihood function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 13.2 Consistency of MLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 13.3 The score function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 13.4 Asymptotic normality of MLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341 13.5 The information matrix equality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345 13.6 The Cramér-Rao lower bound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350 13.7 Likelihood ratio-type tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353 13.8 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 13.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372 14 Generalized method of moments 375 14.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 14.2 Definition of GMM estimator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381 14.3 Consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382 14.4 Asymptotic normality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 14.5 Choosing the weighting matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 14.6 Estimation of the variance-covariance matrix . . . . . . . . . . . . . . . . . . . . . . . . 390 14.7 Estimation using conditional moments . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 14.8 Estimation using dynamic moment conditions . . . . . . . . . . . . . . . . . . . . . . . 398 14.9 A specification test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 14.10Example: Generalized instrumental variables estimator . . . . . . . . . . . . . . . . . . 402 14.11Nonlinear simultaneous equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413 14.12Maximum likelihood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414 14.13Example: OLS as a GMM estimator - the Nerlove model again . . . . . . . . . . . . . . 417 14.14Example: The MEPS data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417 14.15Example: The Hausman Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420 14.16Application: Nonlinear rational expectations . . . . . . . . . . . . . . . . . . . . . . . . 429 14.17Empirical example: a portfolio model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 14.18Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 15 Models for time series data 442 15.1 ARMA models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445 15.2 VAR models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 15.3 ARCH, GARCH and Stochastic volatility . . . . . . . . . . . . . . . . . . . . . . . . . . 455 15.4 State space models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461 15.5 Nonstationarity and cointegration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462 15.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462 16 Bayesian methods 463 16.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 16.2 Philosophy, etc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465 16.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467 16.4 Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468 16.5 Computational methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470 16.6 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474 16.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482 17 Introduction to panel data 483 17.1 Generalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 17.2 Static models and correlations between variables . . . . . . . . . . . . . . . . . . . . . . 486 17.3 Estimation of the simple linear panel model . . . . . . . . . . . . . . . . . . . . . . . . 488 17.4 Dynamic panel data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492 17.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497 18 Quasi-ML 499 18.1 Consistent Estimation of Variance Components . . . . . . . . . . . . . . . . . . . . . . 502 18.2 Example: the MEPS Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504 18.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517 19 Nonlinear least squares (NLS) 519 19.1 Introduction and definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519 19.2 Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522 19.3 Consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 19.4 Asymptotic normality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 19.5 Example: The Poisson model for count data . . . . . . . . . . . . . . . . . . . . . . . . 526 19.6 The Gauss-Newton algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 19.7 Application: Limited dependent variables and sample selection . . . . . . . . . . . . . . 530 20 Nonparametric inference 535 20.1 Possible pitfalls of parametric inference: estimation . . . . . . . . . . . . . . . . . . . . 535 20.2 Possible pitfalls of parametric inference: hypothesis testing . . . . . . . . . . . . . . . . 541 20.3 Estimation of regression functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543 20.4 Density function estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561 20.5 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567 20.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574 21 Quantile regression 575 22 Simulation-based methods for estimation and inference 581 22.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582 22.2 Simulated maximum likelihood (SML) . . . . . . . . . . . . . . . . . . . . . . . . . . . 589 22.3 Method of simulated moments (MSM) . . . . . . . . . . . . . . . . . . . . . . . . . . . 593 22.4 Efficient method of moments (EMM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597 22.5 Indirect likelihood inference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604 22.6 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611 22.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618 23 Parallel programming for econometrics 619 23.1 Example problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621 24 Introduction to Octave 628 24.1 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628 24.2 A short introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629 24.3 If you’re running a Linux installation . . . . . . . . . . . . . . . . . . . . . . . . . . . 631 25 Notation and Review 632 25.1 Notation for differentiation of vectors and matrices . . . . . . . . . . . . . . . . . . . . 632 25.2 Convergenge modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634 25.3 Rates of convergence and asymptotic equality . . . . . . . . . . . . . . . . . . . . . . . 638 26 Licenses 642 26.1 The GPL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642 26.2 Creative Commons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658 27 The attic 666 27.1 Hurdle models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677 [...]... similar level and content) • Cameron, A.C and P.K Trivedi, Microeconometrics - Methods and Applications • Davidson, R and J.G MacKinnon, Econometric Theory and Methods • Gallant, A.R., An Introduction to Econometric Theory • Hamilton, J.D., Time Series Analysis • Hayashi, F., Econometrics A more introductory-level reference is Introductory Econometrics: A Modern Approach by Jeffrey Wooldridge 1.2 Contents... because it is An easier solution is available: The Linux OS image file econometrics. iso an ISO image file that may be copied to USB or burnt to CDROM It contains a bootable-from-CD or USB GNU/Linux system These notes, in source form and as a PDF, together with all of the examples and the software needed to run them are available on econometrics. iso I recommend starting off by using virtualization, to run... been used for most of the example programs, which are scattered though the document This choice is motivated by several factors The first is the high quality of the Octave environment for doing applied econometrics Octave is similar to the commercial package Matlab R , and will run scripts for that language without modification1 The fundamental tools (manipulation of matrices, statistical functions,... sample GNU/Linux work environment, with an Octave script being edited, and the results are visible in an embedded shell window As of 2011, some examples are being added using Gretl, the Gnu Regression, Econometrics, and Time-Series Library This is an easy to use program, available in a number of languages, and it comes with a lot of data ready to use It runs on the major operating systems As of 2012,... prepared under the assumption that the reader understands basic statistics, linear algebra, and mathematical optimization There are many sources for this material, one are the appendices to Introductory Econometrics: A Modern Approach by Jeffrey Wooldridge It is the student’s resposibility to get up to speed on this material, it will not be covered in class This document integrates lecture notes for a . 2012, I am increasingly trying to make examples run on Matlab, though the need for add-on toolboxes for tasks as simple as generating random numbers limits what can be done. The main document was. textbooks with 16 similar level and content) • Cameron, A.C. and P.K. Trivedi, Microeconometrics - Methods and Applications • Davidson, R. and J.G. MacKinnon, Econometric Theory and Methods • Gallant,. Introduction to Econometric Theory • Hamilton, J.D., Time Series Analysis • Hayashi, F., Econometrics A more introductory-level reference is Introductory Econometrics: A Modern Approach by Jeffrey Wooldridge. 1.2