If you use this code (even to spur ideas), please attribute its source.
If you are here to see AIYAGARI code, please visit here for a warning, or here for tested and verified code.
aiyagari.m This solves HW 11.c. Run command "aiyagari" in matlab or octave. This and the next were done as a class assignment--no guarantee that it works.
aiyagaritax.m This solves HW 11.d. Run command "aiyagaritax" in matlab or octave.
huggett93.m This solves Corbae's computational class 4a (fall 2010). You may want to increase the grid size for a better answer. Also note the Lorenz curve goes negative: this is not weird if you consider that people in this economy can borrow. If you dislike this concept, simply add 2 to k_rich and k_poor for a true cdf.
HW4.m and Lorenz.m These are files which solve Corbae's computations class 4 (fall 2010). Again, see hugget93.m's explanation.
HW5.m This is a partial solution to Dean Corbae's HW5, which solves Hugget (1996). Note there appears to be a pathology I have yet to work out: it could very well be an issue stemming from permutation or repmat.
ps1.m This is a solution to Eugenio Miravete's Problem Set 1 for Metrics III. Solves part of the dynamic optimization problem (the producer's problem) in Pakes 1986 "Patents as Options" paper. Essentially just solves the backwards induction required, then forward-solves for r-bar.
sugarscape This is a short paper with code focusing on the capabilities of the Sugarscape model with a myopic social planner and heterogeneous preferences. Written as a mid-term project for Dr. Kendricks Comp Econ class, S2011 UT-Austin. Feel free to use code with proper attribution. Be sure after extracting to view the readme.
NPL & Rust: This is a Matlab implementation of the Nested Pseudo (maximum) Likelihood Estimation technique created by Aguirregabiria-Mira (2002), implemented to solve for Rust's bus engine replacement nested fixed point algorithm (though clogit and npl_sing can be used more generally for nearly any dynamic discrete choice question). Please be sure to source them also if you use this code. Also included is a writeup and results of running NPL_contra (the example master file). There are a couple of bugs in the Matlab implementation that I have yet to work out: for a working GAUSS copy, see here. Heavy-hitting fellow contributors to the code include Julie Pechacek and Melinda Petre.