Professional Documents
Culture Documents
Slides Luetticke
Slides Luetticke
R. Luetticke
UCL, CEPR & CfM
March 2021
1/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
2/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
2/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
3/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
3/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Course outline
Basics
I Standard incomplete markets model
I Perturbation approach
HANK models
I Application: Estimation of HANK models
4/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Resources
I Lecture slides
I Coding exercises
I I provide templates for their solution in MATLAB or Julia.
5/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
6/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation:
I Reiter (2002, 2009), Ahn et al. (2018), Bayer and Luetticke (2020), and Bayer et al.
(2019)
I ...
MIT shock:
I Boppart et al. (2018) and Auclert et al. (2019)
I ...
Global:
I Carroll (2006) and Hintermaier and Koeniger (2010)
I ...
7/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Literature - Textbooks
I Heer, B. and A. Maussner (2009), ”Dynamic General Equilibrium Modelling”, 2nd edition,
Springer, Berlin.
Getting started: Ch. 1, 4, 7, 8
I Adda, J. and R. Cooper (2004): ”Dynamic Economics”, MIT Press, Cambridge.
Partial Equilibrium only, Many Applications with Non-Convex Budget Sets.
I Ljungqvist, L. und T. Sargent (2012): ”Recursive Macroeconomic Theory”, 3rd ed., MIT
press, Cambridge.
Economic Theory Background
I Stockey, N.L. and Lucas, R.E. with E.C. Prescott (1989): ”Recursive Methods in
Economic Dynamics”, Chapters 4 and 9, Havard University Press, Cambridge.
Mathematical Background to Dynamic Programming
SIM
Model Setup
9/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
I Bellman equation:
10/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
I Euler equation:
10/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
No aggregate risk
I Optimal policy h̄(sit ; P) induces flow utility ūh̄ and transition probability matrix Πh̄
11/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
No aggregate risk
holds for optimal policy (assuming a linear interpolant for the continuation value)
12/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
No aggregate risk
Equilibrium requires
I h̄ is the optimal policy given P and ν (being a linear interpolant)
I ν̄ and dµ̄ solve (1) and (2)
I Markets clear (some joint requirement on h̄, µ, P, denoted as Φ(h̄, µ, P) = 0)
13/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Equilibrium
I Market clearing depends on the specific model
14/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Equilibrium
I Market clearing depends on the specific model
I In an Aiyagari model, we require that
where in the most simple case aggregate labor supply is exogenously given. Then, prices
are only a function of K and the equilibrium condition is simply
KS (P(K)) = K
14/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Equilibrium
I Market clearing depends on the specific model
I In an Aiyagari model, we require that
where in the most simple case aggregate labor supply is exogenously given. Then, prices
are only a function of K and the equilibrium condition is simply
KS (P(K)) = K
K S (r) = 0
Computer Exercise 1
Aiyagari model
Exercise
Solve the Aiyagari model as spelled out in Bayer and Luetticke (2020). The production
function is
F (K, N ) = Kα N1−α ,
where N = ni is common across households (GHH preferences)
Solve the steady state using the EGM and Young’s method.
15/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
16/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
16/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I Carroll (2006) proposes a method to solve dynamic optimization problems without relying
on root-solving.
16/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I Carroll (2006) proposes a method to solve dynamic optimization problems without relying
on root-solving.
I This method makes the grid and not the policy “endogenous”.
16/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I The idea is akin to forward induction: “Given the state I am in now, what must have been
the state I was in before, if I behaved rational”.
17/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I The idea is akin to forward induction: “Given the state I am in now, what must have been
the state I was in before, if I behaved rational”.
I The method deals with occasionally binding constraints, but requires
17/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I The idea is akin to forward induction: “Given the state I am in now, what must have been
the state I was in before, if I behaved rational”.
I The method deals with occasionally binding constraints, but requires
I differentiability of the value function everywhere,
17/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I The idea is akin to forward induction: “Given the state I am in now, what must have been
the state I was in before, if I behaved rational”.
I The method deals with occasionally binding constraints, but requires
I differentiability of the value function everywhere,
I (in its basic form) first order conditions that are sufficient, and
17/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I The idea is akin to forward induction: “Given the state I am in now, what must have been
the state I was in before, if I behaved rational”.
I The method deals with occasionally binding constraints, but requires
I differentiability of the value function everywhere,
I (in its basic form) first order conditions that are sufficient, and
I monotone policy function (isomorphisms)
17/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
18/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
18/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
The algorithm works iteratively and solves for the policy function directly:
1. Start with a policy guess (for simplicity for consumption).
19/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
The algorithm works iteratively and solves for the policy function directly:
1. Start with a policy guess (for simplicity for consumption).
2. Thereby, obtain values for the RHS of (3) for each grid point.
19/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
The algorithm works iteratively and solves for the policy function directly:
1. Start with a policy guess (for simplicity for consumption).
2. Thereby, obtain values for the RHS of (3) for each grid point.
3. Then solve for the current state s such that (3) holds for each s0 .
19/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
The algorithm works iteratively and solves for the policy function directly:
1. Start with a policy guess (for simplicity for consumption).
2. Thereby, obtain values for the RHS of (3) for each grid point.
3. Then solve for the current state s such that (3) holds for each s0 .
4. This yields a set of inner solution pairs {s0 , (s, ξ )} to be inverted.
19/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
The algorithm works iteratively and solves for the policy function directly:
1. Start with a policy guess (for simplicity for consumption).
2. Thereby, obtain values for the RHS of (3) for each grid point.
3. Then solve for the current state s such that (3) holds for each s0 .
4. This yields a set of inner solution pairs {s0 , (s, ξ )} to be inverted.
5. It also identifies the current states s for which the constraint binds.
19/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
The algorithm works iteratively and solves for the policy function directly:
1. Start with a policy guess (for simplicity for consumption).
2. Thereby, obtain values for the RHS of (3) for each grid point.
3. Then solve for the current state s such that (3) holds for each s0 .
4. This yields a set of inner solution pairs {s0 , (s, ξ )} to be inverted.
5. It also identifies the current states s for which the constraint binds.
6. Go back to 2. and iterate until convergence.
19/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I Say c(n) is the policy function in iteration n. Then, we can be calculate the necessary
assets s as
20/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I Say c(n) is the policy function in iteration n. Then, we can be calculate the necessary
assets s as
20/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I Say c(n) is the policy function in iteration n. Then, we can be calculate the necessary
assets s as
(s∗ , ξ ) → c∗ (s0 , ξ )
20/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I For well behaved felicity functions u, s∗ and c∗ are monotone in s0 . This allows us to move
to the next iteration making use of the following two implications:
21/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I For well behaved felicity functions u, s∗ and c∗ are monotone in s0 . This allows us to move
to the next iteration making use of the following two implications:
I For a given ξ we can obtain consumption policies c(n+1) (s, ξ ) by interpolating c∗ at
s∗ (s10 = b, ξ ) ≤ s ≤ s∗ (sn0 , ξ ).
21/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I For well behaved felicity functions u, s∗ and c∗ are monotone in s0 . This allows us to move
to the next iteration making use of the following two implications:
I For a given ξ we can obtain consumption policies c(n+1) (s, ξ ) by interpolating c∗ at
s∗ (s10 = b, ξ ) ≤ s ≤ s∗ (sn0 , ξ ).
I For any s < s∗ (s10 , ξ ) households would like to choose assets lower than the borrowing limit.
Of course they cannot. Hence, we know their asset policy: s0 (s, ξ ) = b and their
consumption is c(n+1) (s, ξ ) = (1 + r)s + ξ − b.
21/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I For well behaved felicity functions u, s∗ and c∗ are monotone in s0 . This allows us to move
to the next iteration making use of the following two implications:
I For a given ξ we can obtain consumption policies c(n+1) (s, ξ ) by interpolating c∗ at
s∗ (s10 = b, ξ ) ≤ s ≤ s∗ (sn0 , ξ ).
I For any s < s∗ (s10 , ξ ) households would like to choose assets lower than the borrowing limit.
Of course they cannot. Hence, we know their asset policy: s0 (s, ξ ) = b and their
consumption is c(n+1) (s, ξ ) = (1 + r)s + ξ − b.
I We then iterate c(n) until convergence.
21/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I One important issue is how to choose starting guesses for c(0) . Here it is useful to recall
that the infite horizon planning problem can be viewed as the limit of a finite horizon
problem. Hence start with c(0) = (1 + r)s + ξ (if possible).
22/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I One important issue is how to choose starting guesses for c(0) . Here it is useful to recall
that the infite horizon planning problem can be viewed as the limit of a finite horizon
problem. Hence start with c(0) = (1 + r)s + ξ (if possible).
I There are extensions on
22/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I One important issue is how to choose starting guesses for c(0) . Here it is useful to recall
that the infite horizon planning problem can be viewed as the limit of a finite horizon
problem. Hence start with c(0) = (1 + r)s + ξ (if possible).
I There are extensions on
I How to deal with multiple assets (Hintermaier and Koeniger, 2010): Find the asset
combinations in t + 1 that can be optimal using FOCs, then map back from only these
optimal points.
22/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method
I One important issue is how to choose starting guesses for c(0) . Here it is useful to recall
that the infite horizon planning problem can be viewed as the limit of a finite horizon
problem. Hence start with c(0) = (1 + r)s + ξ (if possible).
I There are extensions on
I How to deal with multiple assets (Hintermaier and Koeniger, 2010): Find the asset
combinations in t + 1 that can be optimal using FOCs, then map back from only these
optimal points.
I How to deal with non-convex setups (Fella, 2015): Use the fact that FOCs are still
necessary and compare potential solutions.
22/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Policy functions as Markov Chains
at nodes (s, ξ ) ∈ S × Ξ by linearly interpolating V off nodes, where S and Ξ are indexed sets
S = {s1 , . . . , sn }, Ξ = {ξ i , . . . , ξ m }.
(For exposition we assume that S is one dimensional, but everything extends to higher
dimensional S.)
23/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Policy functions as Markov Chains
Now let i∗ (s, ξ ) be the index of the next smallest element in S relative to s∗ , i.e. s∗ ∈ [si , si+1 ).
24/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Policy functions as Markov Chains
s∗ −si∗
Define weights w(s, ξ ) = si∗ +1 −si∗ .
I then the linearly interpolated value function is given by
25/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Policy functions as Markov Chains
V (si , ξ j ) = u sh , s∗ (si , ξ j )
(4)
n o
+ ∑ pjj0
1 − w(si , ξ j ) V (si∗ , ξ j0 ) + w(si , ξ j )V (si∗ +1 , ξ j0 )
j0
26/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Policy functions as Markov Chains
h i(i0 ,j0 )
I Then Γ := γ(i,j)→(i0 ,j0 ) is a stochastic (transition) matrix
(i,j)
I of a DMC on the vectorized state space.
27/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Policy functions as Markov Chains
I This we can use to obtain the ergodic distribution of states the planning problem induces
without simulation and therefore fast.
I If an ergodic distribution exists, it is given by the left unit eigenvector of
j=1...N
Γ = [γ(i, j)]i=1...N , as
µt+1 = µt Γ.
28/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Introducing aggregate risk
29/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Introducing aggregate risk
30/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Introducing aggregate risk
I States: Xt = µt St ZX
t
where Zt are purely aggregate states/controls
I Define
In words
I First set of equations: Difference of one forward iteration of the distribution to assumed
value.
I Second set of equations: Difference of one backward iteration of the value function (or
policy functions in EGM) to assumed value.
I Last two sets of equations: Macro model.
32/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Introducing aggregate risk
33/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
I General:
1. A First Look at Perturbation Theory by James G. Simmonds and James E. Mann Jr.
2. Advanced Mathematical Methods for Scientists and Engineers: Asymptotic Methods
and Perturbation Theory by Carl M. Bender, Steven A. Orszag.
I This lecture:
1. “Perturbation Methods for General Dynamic Stochastic Models” by Hehui Jin and
Kenneth Judd.
2. “Computational Methods for Economists” by Jesus Fernandez-Villaverde.
3. “Solving Dynamic General Equilibrium Models Using a Second-Order Approximation to
the Policy Function” by Martin Uribe and Stephanie Schmitt-Grohe.
34/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
I A large class of economic models can be written as a set of non-linear difference equations
of the form
Et f (st+1 , st , ct+1 , ct ) = 0
where s are all state and c are all control variables now.
35/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Perturbation methods
H(d) = 0
36/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Motivation
I Often, we can use the solution of the simpler problem as a building block of the general
solution.
37/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
A simple example
√
I Imagine we want to compute 26 by hand
I Note that: √ √ √
26 = 25 ∗ 1.04 = 5 ∗ 25 ∗ 1.04 ≈ 5 ∗ 1.02 = 5.1
√
I Exact solution: 26 = 5.09902
I More generally:
√ q q
x = y2 ∗ ( 1 + e ) = y ∗ ( 1 + e ) ≈ y ∗ ( 1 + e )
38/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Applications in economics
39/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
I Regular perturbation: a small change in the problem induces a small change in the
solution.
I Singular perturbation: a small change in the problem induces a large change in the
solution.
40/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Perturbation methods
Et f (st+1 , st , ct+1 , ct ) = 0
E t f ( s t + 1 , s t , ct + 1 , ct ; σ ) = 0
41/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Evolution of states
I Dynamic stochastic general equilibrium models in addition have a structure where a subset
of state variables s1t are predetermined and endogenous while the remainder are
exogenously driven as
s2t+1 = H2 (s2t , σ ) + σΣet+1
where et+1 are i.i.d. with zero mean, unit covariance and bounded support.
I Stacking all state variables, we can write
I with η = [0; Σ]
42/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Evolution of controls
43/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Local approximation
I Take a Taylor series approximation of G and H:
44/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Local approximation
I Replace s and c in F:
45/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Local approximation
f (s∗ , s∗ , c∗ , c∗ ) = 0
46/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Local approximation
I Approximation of G and H around the point (s, σ) = (s∗ , 0)
Fs (s∗ , 0) = 0
Fσ (s∗ , 0) = 0
47/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Local approximation
48/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Local approximation
49/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Local approximation
I In matrix form:
I I
fs 0 fc 0 Hs = − fs fc
Gs Gs
50/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Local approximation
51/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Local approximation
I This leaves us with a system of quadratic equations that we need to solve for Hs , Gs .
52/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
I It approximates the solution around the deterministic steady state of the problem.
53/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
I Singularity here refers to poles, fractional powers, and other branch powers or
discontinuities of the functional or its derivatives.
54/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Solution
AZΛ = BZ Z = [I; Gs ]P
A = [∂Fs0 , ∂Fc0 ] B = −[Fs , Fc ]
which implies that the solution corresponds to a subset of the solutions to the generalized
eigenvalue problem
AXD = BX
I But which?
I If we have a stable system, then limt→∞ Hst = 0. Therefore, we are searching for the
exactly ns eigenvalues smaller than unity.
55/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Solution
I Splitting all solutions to the eigenvalue problem above and below eigenvalues of 1, we
obtain
X11 X21 D1 0 X11 X21
A =B
X12 X22 0 D2 X12 X22
and therefore
−1
Hs = X11 D1 X11
and
−1
Gs = X12 X11
56/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
I The coefficients of the ith term of the jth-order approximation are given by the coefficients
of the ith term of the ith order approximation, for j > 1 and i < j.
I More importantly, obtaining the coefficients of the ith order terms of the approximate
solution given all lower-order coefficients involves solving a linear system of equations.
58/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Notation: Tensors
59/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
60/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
[Fσs (s∗ , 0)]ij =[Fs0 ]iβ [Hσs ]j + [Fc0 ]iα [Gs ]αβ [Hσs ]j + [Fc0 ]iα [Gσs ]αγ [Hs ]jγ
β β
61/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
62/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
j
[H (s, σ)]j =[H (s∗ , 0)]j + [Hs (s∗ , 0)]a [(s − s∗ )]a
1 j
+ [Hss (s∗ , 0)]ab [(s − s∗ )]a [(s − s∗ )]b
2
1
+ [Hσσ (s∗ , 0)]j [σ2 ]
2
63/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
I The unknowns of this expansion are [Gss (s∗ , 0)]i , [Gσσ (s∗ , 0)]i , [Hss (s∗ , 0)]j , and
[Hσσ (s∗ , 0)]j
64/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
I System of nxns xns linear equations in the nxns xns unknowns given by the elements of Gss
and Hss .
65/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
I Problems:
1. Existence of higher order derivatives.
2. Numerical instabilities.
3. Computational costs.
66/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
67/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
1 1
= βEt αezt+1 ktα+−11
ct ct + 1
ct + kt+1 =ezt ktα
zt =ρzt−1 + σet
68/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
1
k =(αβ) 1−α
α 1
c =(αβ) 1−α − (αβ) 1−α
z =0
69/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
The goal
I We are searching for decision rules:
ct =c(kt , zt )
kt+1 =k(kt , zt )
I Then we have:
1 1
= βEt αezt+1 k(kt , zt )α−1
c(kt , zt ) c(k(kt , zt ), zt+1 )
c(kt , zt ) + k(kt , zt ) =ezt ktα
zt =ρzt−1 + σet
A perturbation solution
ct =c(kt , zt ; σ )
kt+1 =k(kt , zt ; σ )
71/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Taylor’s theorem
1 1
= βEt αeρzt +σet+1 k(kt , zt ; σ )α−1
c(kt , zt ; σ ) c(k(kt , zt ; σ), ρzt + σet+1 ; σ )
c(kt , zt ; σ ) + k(kt , zt ; σ ) = eρzt−1 +σet ktα
72/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Compact Notation
ρzt +σet+1 α −1
!
1 k(kt ,zt ;σ )
− βEt cαe 0
F(kt , zt , σ ) = Et c(kt ,zt ;σ ) (k(kt ,zt ;σ),ρzt +σet+1 ;σ) =
c(kt , zt ; σ ) + k(kt , zt ; σ) − eρzt−1 +σet ktα 0
I Note that:
I Because F(kt , zt , σ) must be equal to zero for any possible values of k , z , and σ, the
derivatives of any order of F must also be zero.
73/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
First-order approximation
Fk (k, 0; 0) = 0
Fz (k, 0; 0) = 0
Fσ (k, 0; 0) = 0
74/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Second-order approximation
I Take second-order derivatives of F(kt , zt , σ) around (k∗ , 0; 0)
Fkk (k, 0; 0) = 0
Fkz (k, 0; 0) = 0
Fkσ (k, 0; 0) = 0
Fzz (k, 0; 0) = 0
Fzσ (k, 0; 0) = 0
Fσσ (k, 0; 0) = 0
76/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Higher-order terms
I The level of accuracy depends on the goal of the exercise: e.g. Welfare analysis: Kim and
Kim (2001).
77/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Computer Exercise 2
Exercise
Solve the simple stochastic growth model using perturbation methods. For this purpose, first
write a function that calculates the Euler equation errors, errors from capital accumulation, and
the law of motion for productivity. Define consumption as control and capital and productivity
as states. Compare the first and second order perturbation of c(k, z, σ) to the true solution.
78/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
I Modern computer languages like Julia offer easy to implement automatic differentiation
libraries.
79/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
80/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
82/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
Excursus: Julia
I Julia combines three key features for highly intensive computing tasks as perhaps no other
contemporary programming language does: it is fast, easy to learn and use, and open
source.
I Introduction by Fernandez-VillaVerde:
www.sas.upenn.edu/~jesusfv/Chapter_HPC_8_Julia.pdf
I Introduction by QuantEcon:
https://lectures.quantecon.org/jl/
83/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation
I States: Xt = µt St ZX
t
where Zt are purely aggregate states/controls
I Define
85/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
86/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
Problem:
I Dimensionality of the difference equation is large
Proposal:
I Reduce dimensionality ex ante (before solving the StE)
I e.g. (sparse) splines to represent policy functions
I Then linearize
87/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
What we do
Proposal:
I Reduce dimensionality after StE, but before linearization
I Extract from the StE the important basis functions to represent individual policies (akin to
image compression)
I Perturb only those basis functions but use the StE as “reference frame” for the policies
(akin to video compression)
I Similarly for distributions (details later)
88/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
Our idea
89/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
Our idea
I Idea follows Krusell and Smith (1998) in that some moments of the distribution do not
matter for aggregate dynamics
90/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
Copula
A distribution of probabilities
A Copula is a joint distribution function of univariate marginal probabilities for a multivariate
stochastic variable. It maps [0, 1]n → [0, 1]
Sklar’s theorem
Every distribution function F can be represented by the marginal distribution functions Fi and a
Copula, Ξ, with F(x1 , . . . , xn ) = Ξ [F1 (x1 ), . . . , Fn (xn )].
91/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
Details
92/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
93/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
f̂ = Cψ
ψ ∗ = (C0 C ) −1 C0 f
I The big advantage of polynomials is that they can be integrated analytically and that
they are differentiable of any order.
94/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
95/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
Details
I A DCT expresses a finite sequence of data points in terms of sum of cosine functions at
different frequencies
I Linear, invertible function f = <N − > <N (equivalently: an invertible NxN matrix)
I xn is transformed to Xn according to:
N −1
Xk = ∑ xn cos [π/N (n + 1/2)k], k = 0, ..., N − 1
n=0
97/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
Details
98/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
Details
Decoding
I Now we reconstruct νt = ν(θt ) = idct(Θ̃(θt ))
I This means that in the StE the reduction step adds no additional approximation error as
ν(0) = ν̄ by construction
I Yet, it allows to reduce the number of derivatives that need to be calculated from the
outset
99/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
Details
I We can treat the copula as an interpolant defined on the grid of steady-state marginal
distributions, and also approximate Ξt as a sparse expansion around the steady-state
copula Ξ̄.
I The most extreme variant of this is to treat the copula as time fixed.
100/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
Details
101/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
Ξ̄ = griddedInterpolant({m1 , . . . , mn }, M)
102/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
Details
Too many equations
I The system
F {dµ1t , . . . , dµnt }, St , {dµ1t+1 , . . . , dµnt+1 }, St+1 , (12)
θt , Pt , θt+1 , Pt+1 ) =
Ξ̄ 1 , . . . , µ̄n ) − dΞ̄ ( µ̄1 , . . . , µ̄n ) Π
d ( µ̄ t t t t h t
dct idct(Θ̃(θt )) − ūh + βΠh idct(Θ̃(θt+1 ))
t t
St+1 − H (St , dµt )
Φ(ht , dµt , Pt , St )
103/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method
Quality of approximation
104/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
105/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
A simple KS economy
106/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
A simple KS economy
Numerical setup
I Asset grid has 100 points ( =⇒ a total grid size of 200)
I Policies solved by EGM (instead of VFI)
107/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
Consumption
0.5
Full grid, low income
Full grid, high income
Approximation, low income
Approximation, high income
0
0 5 10 15 20 25 30 35
Capital 108/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
Consumption
0.5
Full grid, low income
Full grid, high income
Approximation, low income
Approximation, high income
0
0 5 10 15 20 25 30 35
Capital 108/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
Consumption
0.5
Full grid, low income
Full grid, high income
low income, +20% TFP-Shock
high income, +20% TFP-Shock
0
0 5 10 15 20 25 30 35
Capital 109/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
Consumption
0.5
Full grid, low income
Full grid, high income
low income, +20% TFP-Shock
high income, +20% TFP-Shock
0
0 5 10 15 20 25 30 35
Capital 109/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
30
20
10
-10
0 10 20 30 40
Quarter 110/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
30
20
10
-10
0 10 20 30 40
Quarter 110/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
Taking stock
I When looking only at the StE policy function one concludes that roughly 50% of the
information is needed to reconstruct the policies well
I This is roughly level of state reduction Reiter (2009) approach would achieve
I Using the StE as reference one can achieve much higher reduction
I For the aggregate dynamics maintaining only 3-6% of the basis functions suffices
111/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
Simulation performance
Figure: Simulations of Krusell & Smith model
Percent deviations
35
Capital
1
34.8
0.995
34.6
34.4 0.99
34.2 0.985
0 200 400 600 800 1000 0 20 40 60 80 100
Quarter Quarter
Notes: Both panels show simulations of the Krusell & Smith (1998) model with TFP shocks
solved with (1) the Reiter method with our proposed state-space reduction, (2) the original 112/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
Error Statistics
Computing time
114/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
Comparison to MIT
115/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
Comparison to MIT
Computer Exercise 3
Exercise
Solve the Krusell-Smith model using first order perturbation. For this purpose, first solve the
steady state by either EGM or VFI. Then write a function that calculates the Euler equation
errors, errors from capital accumulation, and the law of motion for productivity.
116/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
Comparison to MIT
Computer Exercise 4
Exercise
Solve the Krusell-Smith model using MIT shock solution approach.
117/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
Comparison to MIT
Computer Exercise 5
Exercise
Solve the Krusell-Smith model using first order perturbation and dimensionality reduction
proposed by Bayer and Luetticke (2018). For this purpose, split the joint-distribution into
Copula and marginals and define the marginals as state. Apply the DCT transformation to the
policy function and keep only the most important basis functions as controls. Write the
corresponding non-linear difference equations as a function Fsys.
118/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
119/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
What we do
I Fuse two-asset HANK model with a Smets-Wouters-type medium scale DSGE model
I Estimate the model using (Bayesian) full-information approach
I IRF analysis and variance decompositions
I Research Question:
What shocks and frictions drive the US business cycle and US inequality?
120/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
121/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
122/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
I ht is the optimal policy given prices (or other aggregate controls) Pt and continuation
values νt
I This induces payoffs ūht and a transition matrix Γht
I and this transition matrix also induces the law of motion
µ t + 1 = µ t Γ ht (14)
I We can view (13) and (14) as the equation describing the idiosyncratic part of a
sequential equilibrium with recursive individual planning.
123/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
Observations
Changing the aggregate macro structure is easy
I As long as a change in the model does not affect what income is composed of and which
choices households can make given prices and incomes, but only how prices are formed, we
can change the aggregate part of the model without touching the micro part.
125/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
A HANK model
I Introduce price stickiness (NKPC),
I introduce a central bank (Taylor rule),
I introduce a fiscal authority (Expenditure rule),
I introduce capital goods producers (quadratic adjustment costs).
Issues:
I We need to deal with assigning monopoly rents.
I We need to deal with the portfolio problem (Bonds vs. Capital).
I We need to make labor supply endogenous
126/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
A HANK model
See Bayer et al., 2019
Scaling with productivity h allows for easy aggregation w.l.o.g. if taxes are linear.
2. Assign profits to either to (a) a group of households, (b) the government, or (c) a
profit-asset.
127/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
A HANK model
128/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
µ t+1 = µ t Γ t
129/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
130/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
Observe that adjustment costs are zero up to first order around stationary equilibrium. 131/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
2 asset models
133/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
2 asset models
2 marginal values of assets
I Marginal value of liquid assets results from usual envelop condition
Vb (h, b, k) = Ruc
when trade is possible and from the marginal value of the dividend payment plus
discounted marginal value if no trade is possible
135/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
Exercise
Take the setup from last exercise: and add a government that runs a central bank, a fiscal
authority and owns all profit incomes. Households have GHH preferences over labor and
consumption, but still unemployment shocks.
1. Solve for the steady state without aggregate risk.
2. Solve using Bayer and Luetticke’s refinement.
Assume the central bank only reacts to inflation and past interest rates ρR = 0.95 and
θπ = 1.25. The fiscal side only reacts to the level of debt ρB = −0.1. Assume steady state
profits are 10% and the Phillips Curve reflects price adjustment of roughly once a year if it was
from Calvo. Assume steady state labor taxes are 25%.
136/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
Sources of Fluctuations
Standard in complete markets model
I total factor productivity
I gov. bond spread (a.k.a. “risk premium”)
I price markup
I wage markup
I monetary policy
I government spending
137/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models
Sources of Fluctuations
Standard in complete markets model
I total factor productivity
I gov. bond spread (a.k.a. “risk premium”)
I price markup
I wage markup
I monetary policy
I government spending
137/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation
138/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation
Solution method
139/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation
Estimation: Overview
140/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation
141/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation
I Write as Axt = Bxt+1 and solve using Klein’s method to obtain G and H.
I Uses generalized Schur decomposition (computational efficiency)
I Algorithm cost O(n3 ) floating point operations
I We also experimented with the Anderson and Moore (1985) algorithm. While it is more
than twice as fast as Klein’s method for the HANK model with two assets in many cases,
it appears to produce less numerically stable results in a setting such as ours, where the
Jacobians are not very sparse.
143/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation
144/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation
1. Kalman filter to obtain the likelihood from the state-space representation of the model
solution.
2. Advantage of State-Space: Deal with mixed frequency and missing observations.
3. Roughly one evaluation of the Kalman filter every other second.
4. Maximize posterior likelihood
145/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation
I For a one-frequency data set without missing values, one can speed up the estimation by
employing so-called “Chandrasekhar recursions” for evaluating the likelihood.
I These recursions replace the costly updating of the state variance matrix by
multiplications involving matrices of much lower dimension (see Herbst, 2014, for details).
I This is especially relevant for the two-asset HANK model as the speed of evaluating the
likelihood is dominated by the updating of the state variance matrix, which involves the
multiplication of matrices that are quadratic in the number of states.
146/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation
Estimation: Posterior
Speed up:
I Run multiple chains
I Go sequential Monte Carlo (NY Fed has implemented this for our perturbation approach)
147/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Excursus: Kalman Filter
I If all states were observed, we could directly construct the likelihood f (yT , . . . , y1 |θ )
I We could then run optimizer over our estimated parameter set θ̃ ⊆ θ to get ML estimate
of θ̃
I Problem: we have unobserved states and cannot use equation (20)
I Solution: turn to Kalman filter to back out states from the observed data → Filtering
problem
149/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Excursus: Kalman Filter
at = yt − Hx̂t|t−1 (21)
3. Compute the state forecast for next period given today’s information
x̂t+1|t = Gx̂t|t−1 + Kt yt − Hx̂t|t−1 = Gx̂t|t−1 + Kt at (23)
hence, E(x) = 0
I For the covariance matrix, we have
h i
Σ = E (Gxt + wt ) (Gxt + wt )0
= E Gxt xt 0 G0 + wt wt 0
= GΣG0 + Q (25)
→ so-called Lyapunov-equation
151/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Excursus: Kalman Filter
Metropolis Hastings-Algorithm
I Start with a vector θ0
I Repeat for j = 1, . . . , N
I Generate θ̃ from q(θj−1 , ·) and u from U (0, 1)
I If θ̃ is valid parameter draw (steady state exists, Blanchard-Kahn conditions satisfied etc.)
and u < α(θ j−1 , θ j ) set θj = θ̃
I Otherwise, set θj = θj−1 (implies setting π (θ̃ ) = 0 if draw invalid )
152/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Excursus: Kalman Filter
I As long as the regularity conditions are satisfied, any proposal density will ultimately lead
to convergence to the invariant distribution
I However: speed of convergence may differ significantly
I In practice, people often use the Random-Walk Metropolis Hastings algorithm where
q θ, θ̃ = qRW θ̃ − θ (26)
θ̃ = θ + z, z ∼ qRW (27)
153/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Bayer, Born, Luetticke (2020)
I First, we calibrate or fix all parameters that affect the steady state of the model.
I Second, we estimate by full-information methods all parameters that only matter for the
dynamics of the model, i.e., the aggregate shocks, frictions, and policy rules.
I We set the priors for shocks, frictions, and policy rules to standard values from the
representative agent literature
154/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Bayer, Born, Luetticke (2020)
Observables
In first-differences
I GDP, Consumption, Investment
I the real wage
In log-levels
I GDP deflator based inflation rates
I Hours worked per capita
I the (shadow) federal funds rate
155/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Bayer, Born, Luetticke (2020)
Observables
I Measures of inequality:
I Wealth share of the top 10% (Piketty-Saez WID) (1954 – 2019)
I Income share of the top 10% (Piketty-Saez WID) (1954 – 2019)
156/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results
Data
Aggregate Data + Cross-sectional Data
Shocks
157/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results
(a) Top 10% income share (b) Top 10% wealth share
158/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results
159/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results
RANK
RANK
HANK
HANK
HANKX
HANKX
0 20 40 60 80 100 0 20 40 60 80 100
160/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results
Estimation results
I Key is the estimation that makes the dynamics of both models more similar
I Estimated HANK model features less nominal and real frictions than RANK
Decomposition results
I Investment-specific technology becomes less important because it induces wealth effects
on consumption via asset prices
I Risk premium, monetary, and wage markup shocks become more important
I Income risk shocks can partly replace risk premium shocks
161/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results
162/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results
163/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results
164/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results
US inequality: Summary
Income inequality
I Price and wage markups explain two-third of the increase since 1985
I Rising income risk and falling tax progressivity explain the remaining one-third
Wealth inequality
I Technology shocks via their effect on asset prices explain most of the increase since 1985
I The two markup shocks explain only one-third of this increase
I Monetary policy and fiscal deficit shocks are important as well
166/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results
Policy Counterfactuals
167/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results
I How important are the estimated policy coefficients for the evolution of inequality?
168/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results
169/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results
170/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results
Our HANK model can jointly explain the US business cycle and inequality
US business cycle
I Not a radically different view on the US business cycle
I HANK models stress the importance of portfolio choice for the transmission of aggregate
shocks
US inequality
I Business cycles are important to understand the evolution of US inequality.
I Business cycle shocks and policy responses can account for most of the increase in US
inequality since the 1980s.
171/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Conclusion
Conclusion
No excuse!
I Even when heterogeneity is high dimensional,
I our algorithm is an easy approach to these models
I It is a fast and simple to code
172/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Conclusion
Conclusion
No excuse!
I It requires knowledge of only two standard tools of macro:
1. Solving a recursive het. agent model for a StE
2. Linearizing a rep. agent model
3. (and a little twist in between)
I The fixed design for dimensionality reduction allows to employ the method to estimate
models with standard techniques
173/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Conclusion
Bibliography I
Ahmed, N., T. Natarajan, and K. R. Rao (1974). “Discrete cosine transform”. IEEE
Transactions on Computers C-23 (1), 90–93.
Ahn, SeHyoun, Greg Kaplan, Benjamin Moll, Thomas Winberry, and Christian Wolf (2018).
“When inequality matters for macro and macro matters for inequality”. NBER
Macroeconomics Annual 32 (1), 1–75.
An, Sungbae and Frank Schorfheide (2007). “Bayesian analysis of DSGE models”. Econometric
Reviews 26 (2-4), 113–172.
Anderson, Gary and George Moore (1985). “A linear algebraic procedure for solving linear
perfect foresight models”. Economics Letters 17 (3), 247–252.
Auclert, Adrien, Bence Bardóczy, Matthew Rognlie, and Ludwig Straub (2019). “Using the
sequence-space Jacobian to solve and estimate heterogeneous-agent models”. NBER
Working Paper 26123.
Bayer, Christian, Benjamin Born, and Ralph Luetticke (2020). “Shocks, Frictions, and
Inequality in US Business Cycles”. CEPR Discussion Paper 14364.
174/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Conclusion
Bibliography II
Bayer, Christian and Ralph Luetticke (2020). “Solving heterogeneous agent models in discrete
time with many idiosyncratic states by perturbation methods”. Quantitative Economics
forthcoming.
Bayer, Christian, Ralph Luetticke, Lien Pham-Dao, and Volker Tjaden (2019). “Precautionary
savings, illiquid assets, and the aggregate consequences of shocks to household income risk”.
Econometrica 87 (1), 255–290.
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, 68–92.
Carroll, C.D. (2006). “The method of endogenous gridpoints for solving dynamic stochastic
optimization problems”. Economics Letters 91 (3), 312–320.
Den Haan, Wouter J (2010). “Assessing the accuracy of the aggregate law of motion in models
with heterogeneous agents”. Journal of Economic Dynamics and Control 34 (1), 79–99.
175/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Conclusion
Bibliography III
Den Haan, Wouter J, Kenneth L Judd, and Michel Juillard (2010). “Computational suite of
models with heterogeneous agents: incomplete markets and aggregate uncertainty”. Journal
of Economic Dynamics and Control 34 (1), 1–3.
Fernández-Villaverde, Jesús (2010). “The econometrics of DSGE models”. SERIEs 1 (1), 3–49.
Herbst, Edward (2014). “Using the “Chandrasekhar Recursions” for likelihood evaluation of
DSGE models”. Computational Economics 45 (4), 693–705.
Hintermaier, T. and W. Koeniger (2010). “The method of endogenous gridpoints with
occasionally binding constraints among endogenous variables”. Journal of Economic
Dynamics and Control 34 (10), 2074–2088.
Kaplan, Greg, Giovanni L Violante, and Justin Weidner (2014). “The wealthy hand-to-mouth”.
NBER Working Paper No. 20073.
Krusell, Per and Anthony A. Smith (1998). “Income and wealth heterogeneity in the
macroeconomy”. Journal of Political Economy 106 (5), 867–896.
176/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Conclusion
Bibliography IV
Krusell, Per and Anthony A. Smith (1997). “Income and wealth heterogeneity, portfolio choice,
and equilibrium asset returns”. Macroeconomic Dynamics 1 (02), 387–422.
Luetticke, Ralph (2020). “Transmission of monetary policy with heterogeneity in household
portfolios”. American Economic Journal: Macroeconomics forthcoming.
Reiter, Michael (2002). “Recursive computation of heterogeneous agent models”. mimeo,
Universitat Pompeu Fabra.
(2009). “Solving heterogeneous-agent models by projection and perturbation”. Journal
of Economic Dynamics and Control 33 (3), 649–665.
Schmitt-Grohé, Stephanie and Martın Uribe (2004). “Solving dynamic general equilibrium
models using a second-order approximation to the policy function”. Journal of Economic
Dynamics and Control 28 (4), 755–775.
Tobin, James (1969). “A general equilibrium approach to monetary theory”. Journal of Money,
Credit and Banking 1 (1), 15–29.
177/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Conclusion
Bibliography V
Winberry, Thomas (2016). “A toolbox for solving and estimating heterogeneous agent macro
models”. mimeo, Chicago Booth.
178/178