Hands-On Heterogeneous Agent Macroeconomics Using the Econ-ARK/HARK Toolkit
Syllabus for Hands-On Heterogeneous Agent Macroeconomics
BI Business School/University of Oslo
Spring, 2020
Because Representative Agent (‘RA’) models were not useful for understanding much of what happened in the Great Recession, policymakers including Larry Summers (2011), Fed Chair Janet Yellen (2016), former IMF Chief Economist Olivier Blanchard (2016), ECB Governing Board Member Benoit Coeure (2013), and Bank of England Chief Economist Andy Haldane (2016) have suggested that incorporation of heterogeneity (for example, across borrowers and lenders) must be an essential part of the agenda in developing new and better models. In confirmation of that intuition, a number of recent papers, most notably Kaplan, Moll, and Violante (2018) and Krueger, Mitman, and Perri (2016), have developed models that include a realistic description of microeconomic heterogeneity, and have shown that such models can generate more sensible macroeconomic implications than RA models for important questions like the operation of fiscal and monetary policy.
This course will provide a hands-on introduction to the construction of models with ‘serious’ heterogeneity (that is, heterogeneity that matches the microeconomic facts that theory suggests should matter for macroeconomic outcomes like consumption dynamics); why such heterogeneous agent (‘HA’) models have implications different from those of RA models; and how existing HA models can be adapted to new questions. (‘Hands-On’ means that students with their own laptops will run the and experiment with the code that solves these models in class.)
The course will have two main elements: Lectures explaining the conceptual foundations of the models work; and hands-on demonstrations of live working versions of such models using the open-source Econ-ARK/HARK toolkit.
Students should bring a laptop on which they have permissions to install and run new software. Prior to class, on that laptop, students should have installed the anaconda3 stack, which is a distribution of python 3 that includes a robust set of extra tools that are useful for doing computational work. A good guide to installing anaconda is here.
(In “readings” below, starred readings are strongly suggested)
- Install Anaconda: https://docs.anaconda.com/anaconda/install
- Get Git
- Get the command-line tool: https://atlassian.com/git/tutorials/install-git
- Get a GitHub Account
- Download the GitHub Desktop App
- And connect it to your online GitHub account
- Install HARK: Go to “Quick Start” in the README.md
- Follow the instructions for installing HARK for Anaconda
- Clone the DemARK and REMARK repos
- Using python from the command line:
- pip install nose
- python -c import HARK ; print(HARK.__file__)
- cd [root directory for HARK]
- python -m nose
Models with serious microfoundations yield fundamentally different conclusions than RA models about core questions in macroeconomics.
- How monetary policy works
- HA channels account for most of the mechanism of monetary transmission
- Whether fiscal policy works
- ‘serious’ HA models are consistent with evidence of MPC’s of 0.5
- What made the Great Recession Great
- RA models: Mostly a supply shock
- HA models: Mostly a demand shock
Slides:
Readings:
- Ahn et al (2017), Introduction, Conclusion
- Compact and well written discussion of the state and progress of HA macro.
- Carroll and Crawley (2017), Sections 1, 2, and 4
- This discussion of that paper puts the relationship of HA to RA models in context.
The course will assume that students are familiar with standard quantitative tools for solving RA models, like DYNARE. The bulk of the “hands-on” part of the course will therefore involve learning and using tools for solving micro problems with ‘serious’ microfoundations.
Absolute, Return, and Growth Impatience
Notes:
- Notes: A Tractable Model of Buffer Stock Saving
- Notebook: Interactive Demo
Readings
- Carroll (2001)
Under CRRA utility, without labor income risk:
- The consumption function is linear
- An increase in risk reduces consumption and the MPC
Notes: Consumption out of Risky Assets
Consumption With Portfolio Choice
Origins: Merton (1969), Samuelson (1969)
Notes:
Here we will explain how to begin using the Econ-ARK toolkit for heterogeneous agent macro modeling. Students will be taught how to use the toolkit to solve increasingly sophisticated models, starting with partial equilibrium perfect foresight models and ending with some exercises using a full general equilibrium micro-macro model with idiosyncratic and aggregate risks.
This section builds our first simple models using the toolkit
Notebook: A Gentle Introduction to HARK - Perfect Foresight
Notebook: A Gentle Introduction to Buffer Stock Saving
- The Growth Impatience Condition
- Liquidity Constraints and Precautionary Saving
- Impatience and Target Wealth
Notebook: BufferStockTheory Problems
Notebook: Micro-and-Macro-Implications-of-Very-Impatient-HHs-Problems
References: Carroll, Slacalek, Tokuoka, and White (2017)
For an economy in steady state (that is, with constant factor prices like interest rates and wages), models with ‘serious’ income heterogeneity have been solvable in partial equilibrium since about 1990 (Zeldes (1989), Deaton (1991)). Calculating an equilibrium distribution of wealth that results from those policy functions and matching it to the total amount of observed wealth (and a corresponding interest rate) was first done by Hubbard, Skinner, and Zeldes (1994) using a supercomputer. Aiyagari (1994) proposed a radically simple model that did not attempt to match the distributions of wealth and income, but could be solved without a supercomputer.
In a rational expectations steady state, there are no expected changes in interest rates, wages, or the distribution. Aggregate fluctuations make calculation of an RE equilibrium massively more difficult, because:
- Meaningful aggregate fluctuations will change the distribution of wealth and income
- The amount of aggregate saving depends on how aggregate wealth and income are distributed
- The amount of saving determines future factor prices
- In principle, RE therefore requires that everyone know the entire distribution of wealth, income, and any other state variables in the population
The problem therefore suffers from a severe case of the “curse of dimensionality.” (That is, it’s really hard!). The first paper to tackle the problem was Krusell and Smith (1998). Work by Bayer and Luetticke (2018) builds on all of the prior work to construct a reasonable HANK model that can be solved in a few minutes on a laptop. The key contribution of Krusell and Smith (1998) was to discover that, in practice, highly accurate predictions of future aggregate states could be made using only the mean of the current aggregate capital stock
Notebook: KrusellSmith.ipynb
A problem with solving methods using the original Krusell Smith method is that the computational challenge was so great that only the simplest such models could be solved, and the ability to construct standard tools like impulse response functions to aggregate shocks was very limited.
Reiter (2009) showed how to solve such problems several orders of magnitude faster; the essence of his idea was to solve the micro problem for the steady-state distribution, and then capture business cycle fluctuations by figuring out how to perturb the decision rules and the distribution appropriately.
Building on his work, the last few years have seen great further strides in speed and power of such tools.
References:
- Reiter (2009)
- Boppart, Krusell, and Mitman (2018)
- Ahn, Kaplan, Moll, Winberry, and Wolf (2017)
- Bayer and Luetticke (2018)
References:
- Monetary Policy Transmission with Many Agents, Crawley and Lee (2019)
- Macroprudential Policies in a Heterogeneous Agent Model of Housing Default, Khan (2019)
- Redistribution, risk premia, and the macroeconomy, Kekre and Lenel (2019)
- The Missing Intercept: A Sufficient Statistics Approach to General Equilibrium Effects, Wolf (2019)
ahn, sehyoun, greg kaplan, benjamin moll, thomas winberry, and christian wolf (2017): “When Inequality Matters for Macro and Macro Matters for Inequality,” NBER Macroeconomics Annual, 32.
aiyagari, s. rao (1994): “Uninsured Idiosyncratic Risk and Aggregate Saving,” Quarterly Journal of Economics, 109, 659–684.
bayer, christian, and ralph luetticke (2018): “Solving Heterogeneous Agent Models In Discrete Time With Many Idiosyncratic States By Perturbation Methods,” Centre for Economic Policy Research, Discussion Paper 13071.
blanchard, olivier (2016): “Do DSGE Models Have a Future?,” Discussion paper, Petersen Institute for International Economics, Available at https://piie.com/system/files/documents/pb16-11.pdf.
boppart, timo, per krusell, and kurt mitman (2018): “Exploiting MIT Shocks in Heterogeneous-Agent Economies: The Impulse Response as a Numerical Derivative,” Journal of Economic Dynamics and Control, 89(C), 68–92.
carroll, christopher d. (2001): “Death to the Log-Linearized Consumption Euler Equation! (And Very Poor Health to the Second-Order Approximation),” Advances in Macroeconomics, 1(1), Article 6, https://www.econ2.jhu.edu/people/ccarroll/death.pdf.
carroll, christopher d., and edmund crawley (2017): “Discussion of ‘When Inequality Matters for Macro and Macro Matters for Inequality’,” Discussion paper, NBER.
carroll, christopher d., jiri slacalek, kiichi tokuoka, and matthew n. white (2017): “The Distribution of Wealth and the Marginal Propensity to Consume,” Quantitative Economics, 8, 977–1020, At https://www.econ2.jhu.edu/people/ccarroll/papers/cstwMPC.
coeure, benoit (2013): “The relevance of household-level data for monetary policy and financial stability analysis,” .
crawley, edmund (2019): “Intro to Monetary Policy with Heterogeneity,” Slides Presented at JHU “Computational Methods in Economics”.
crawley, edmund, and andreas kuchler (2018): “Consumption Heterogeneity: Micro Drivers and Macro Implications,” working paper 129, Danmarks Nationalbank.
crawley, edmund, and seungcheol lee (2019): “Monetary Policy Transmission with Many Agents,” Manuscript, Johns Hopkins University.
deaton, angus s. (1991): “Saving and Liquidity Constraints,” Econometrica, 59, 1221–1248, http://www.jstor.org/stable/2938366.
haldane, andy (2016): “The Dappled World,” Discussion paper, Bank of England, Available at http://www.bankofengland.co.uk/publications/Pages/speeches/2016/937.aspx.
hubbard, r. glenn, jonathan s. skinner, and stephen p. zeldes (1994): “The Importance of Precautionary Motives for Explaining Individual and Aggregate Saving,” in The Carnegie-Rochester Conference Series on Public Policy, ed. by Allan H. Meltzer, and Charles I. Plosser, vol. 40, pp. 59–126.
kaplan, greg, benjamin moll, and giovanni l. violante (2018): “Monetary Policy According to HANK,” American Economic Review, 108(3), 697–743.
kekre, rohan, and moritz lenel (2019): “Redistribution, risk premia, and the macroeconomy,” Slides Presented at NBER ‘Micro to Macro’ Working Group.
khan, shujaat (2019): “Macroprudential Policies in a Heterogeneous Agent Model of Housing Default,” Department of Economics, Johns Hopkins University.
krueger, dirk, kurt mitman, and fabrizio perri (2016): “Macroeconomics and Household Heterogeneity,” Handbook of Macroeconomics, 2, 843–921.
krusell, per, and anthony a. smith (1998): “Income and Wealth Heterogeneity in the Macroeconomy,” Journal of Political Economy, 106(5), 867–896.
merton, robert c. (1969): “Lifetime Portfolio Selection under Uncertainty: The Continuous Time Case,” Review of Economics and Statistics, 51, 247–257.
reiter, michael (2009): “Solving heterogeneous-agent models by projection and perturbation,” Journal of Economic Dynamics and Control, 33(3), 649–665.
samuelson, paul a. (1969): “Lifetime Portfolio Selection by Dynamic Stochastic Programming,” Review of Economics and Statistics, 51, 239–46.
summers, lawrence h. (2011): “Larry Summers and Martin Wolf on New Economic Thinking,” Financial Times interview, http://larrysummers.com/commentary/speeches/brenton-woods-speech/.
wolf, christian (2019): “The Missing Intercept: A Sufficient Statistics Approach to General Equilibrium Effects,” Slides Presented at NBER ‘Micro to Macro’ Working Group.
yellen, janet (2016): “Macroeconomic Research After the Crisis,” Available at https://www.federalreserve.gov/newsevents/speech/yellen20161014a.htm.
zeldes, stephen p. (1989): “Optimal Consumption with Stochastic Income: Deviations from Certainty Equivalence,” Quarterly Journal of Economics, 104(2), 275–298.