Blog Topics...

3D plotting (1) Academic Life (2) ACE (18) Adaptive Behavior (2) Agglomeration (1) Aggregation Problems (1) Asset Pricing (1) Asymmetric Information (2) Behavioral Economics (1) Breakfast (4) Business Cycles (8) Business Theory (4) China (1) Cities (2) Clustering (1) Collective Intelligence (1) Community Structure (1) Complex Systems (42) Computational Complexity (1) Consumption (1) Contracting (1) Credit constraints (1) Credit Cycles (6) Daydreaming (2) Decision Making (1) Deflation (1) Diffusion (2) Disequilibrium Dynamics (6) DSGE (3) Dynamic Programming (6) Dynamical Systems (9) Econometrics (2) Economic Growth (5) Economic Policy (5) Economic Theory (1) Education (4) Emacs (1) Ergodic Theory (6) Euro Zone (1) Evolutionary Biology (1) EVT (1) Externalities (1) Finance (29) Fitness (6) Game Theory (3) General Equilibrium (8) Geopolitics (1) GitHub (1) Graph of the Day (11) Greatest Hits (1) Healthcare Economics (1) Heterogenous Agent Models (2) Heteroskedasticity (1) HFT (1) Housing Market (2) Income Inequality (2) Inflation (2) Institutions (2) Interesting reading material (2) IPython (1) IS-LM (1) Jerusalem (7) Keynes (1) Kronecker Graphs (3) Krussel-Smith (1) Labor Economics (1) Leverage (2) Liquidity (11) Logistics (6) Lucas Critique (2) Machine Learning (2) Macroeconomics (45) Macroprudential Regulation (1) Mathematics (23) matplotlib (10) Mayavi (1) Micro-foundations (10) Microeconomic of Banking (1) Modeling (8) Monetary Policy (4) Mountaineering (9) MSD (1) My Daily Show (3) NASA (1) Networks (46) Non-parametric Estimation (5) NumPy (2) Old Jaffa (9) Online Gaming (1) Optimal Growth (1) Oxford (4) Pakistan (1) Pandas (8) Penn World Tables (1) Physics (2) Pigouvian taxes (1) Politics (6) Power Laws (10) Prediction Markets (1) Prices (3) Prisoner's Dilemma (2) Producer Theory (2) Python (29) Quant (4) Quote of the Day (21) Ramsey model (1) Rational Expectations (1) RBC Models (2) Research Agenda (36) Santa Fe (6) SciPy (1) Shakshuka (1) Shiller (1) Social Dynamics (1) St. Andrews (1) Statistics (1) Stocks (2) Sugarscape (2) Summer Plans (2) Systemic Risk (13) Teaching (16) Theory of the Firm (4) Trade (4) Travel (3) Unemployment (9) Value iteration (2) Visualizations (1) wbdata (2) Web 2.0 (1) Yale (1)

Thursday, January 24, 2013

Solving models with heterogenous agents...


This material was previously part of another post on welfare costs of business cycles. I decided that the links on solving Krusell-Smith deserved its own post!

Place to start is definitely Wouter den Haan's website, specifically his introductory slides on heterogenous agent models. Krusell and Smith (2006) is an excellent literature review on heterogenous agent models.

Various solution algorithms: Key difficulty in solving Krusell-Smith type models is to find a way to summarize the cross-sectional distribution of capital and employment status (a potentially infinite dimensional object) with a limited set of its moments. 
  • Original KS algorithm: The KS algorithm specifies a law of motion for these moments and then finds the approximating function to this law of motion using a simulation procedure. Specifically, for a given a set of individual policy rules (which can be solved for via value function iterations, etc), a time series of cross-sectional moments is generated and new laws of motion for the aggregate moments are estimated using this simulated data. 
  • Xpa algorithm  
  • Other algorithms
General issues with implementing Krusell-Smith algorithm:

Den Haan (2010):
This paper compares numerical solutions to the model of Krusell and Smith [1998. Income and wealth heterogeneity in the macroeconomy. Journal of Political Economy 106, 867–896] generated by different algorithms. The algorithms have very similar implications for the correlations between different variables. Larger differences are observed for (i) the unconditional means and standard deviations of individual variables, (ii) the behavior of individual agents during particularly bad times, (iii) the volatility of the per capita capital stock, and (iv) the behavior of the higher-order moments of the cross-sectional distribution. For example, the two algorithms that differ the most from each other generate individual consumption series that have an average (maximum) difference of 1.63% (11.4%).
Concise description of Krusell and Smith (1998) model can be found in the introduction to the JEDC Krusell-Smith comparison project.  It would seem the JEDC Krusell-Smith comparison project is a good place to start thinking about how to implement the Krusell-Smith algorithm in Python.  The above paper suggests that implementation details matter and can substantially impact the accuracy of solution.  Wouter den Haan provides code for JECD comparison project.  Maybe start by implementing the den Haan and Rendahl (2009) algorithm in Python? Followed by Reiter (2009). Given that different algorithms can arrive at different solutions, checking the accuracy of a given solution method against alternatives is important.  Slides on the checking accuracy of the above algorithms.

Other Krusell-Smith related links:
  • Anthony Smith's original Fortran implementation of Krusell-Smith.  Code looks completely impenetrable! Not much in the way of comments or documentation.  Probably not worth working out how the code works.
  • Sergei Mailar's MatLab code for Krusell-Smith (Mailar provides code for other interesting projects as well!).
  • Fortran code for Krusell and Smith (2009).
  • Wouter den Haan's slides on additional applications of the Krusell-Smith approach (includes  monetary models with consumer heterogeneity, models with entrepreneurs, turning KS into a matching model, portfolio problem).

No comments:

Post a Comment