Code for course 'Moments Based Methods for Estimation' -- information about course: http://www.theloudis.net/teaching.html
Instructions for code and data:
- This distribution contains a number of Stata and Matlab files. Clone/save them to a location that your machine can read. No write rights are needed.
- Spreadsheet PSID_97_11_selected.xlsx is available from my cloud: https://www.dropbox.com/s/2i54ccib7nv9ced/PSID_97_11_selected.xlsx?dl=1. This is the PSID data that our applications will use. Save the spreadsheet in this folder.
- Folder code contains the following text files: 'LISER_MOMENTS_Stata_Shell.do' (Stata) and 'LISER_MOMENTS_Matlab_Shell.m', 'readData.m', 'mindistance_wages.m', 'wage_structure.m', 'wage_correlations.m', 'gmm_laborsupply.m', 'laborsupply_structure.m', 'laborsupply_eqcons.m', and 'slices_model.m' (Matlab).
- We will run the code on Stata and Matlab. Both software is proprietary but usually academic and research institutions provide subscriptions to them. Users without access to Stata or Matlab should still be able to open these files in any text editor and read them.
- The only Stata file is LISER_MOMENTS_Stata_Shell.do. This implements the GMM estimation of wage dynamics (see course slides for details). The code is optimised for Stata version 14.0 but can run on earlier versions too (hopefully the code will catch errors that earlier versions may return). The user must specify the machine path to folder code (done in the first few lines of this script) otherwise the script will not run.
- The main Matlab file is LISER_MOMENTS_MATLAB_Shell.m. This implements: a. the Minimum Distance estimation of wage dynamics (equivalent to point 5 above), b. the GMM estimation of a dynamic labor supply model, c. checks the behavior of the dynamic labor supply model around the optimal. The code runs on MATLAB R2016b; it has not been checked against earlier versions of the software (but the user should be able to get around any errors easily). The user must specify the machine path to folder code (done in the first few lines of the above script) otherwise the script will not run.
- LISER_MOMENTS_MATLAB_Shell.m calls a number of functions provided in this folder as well as optimizer ‘fmincon’ that is available in the Optimization Toolbox. The code is extensively commented; users without access to ‘fmincon’ will easily be able to pass the objective functions to alternative optimizers.