Download as pdf or txt
Download as pdf or txt
You are on page 1of 208

Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods

Solving and Estimating


Heterogeneous Agent Models
with Aggregate Uncertainty
by Perturbation Methods
Short Course CEMFI

R. Luetticke
UCL, CEPR & CfM

March 2021
1/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods

Heterogeneous agents models with aggregate uncertainty

These models are computational demanding to solve


I The original Krusell and Smith (1997, 1998) algorithm is notoriously slow
I Therefore, many papers study transitions
I or are restricted to relatively simple household decisions

2/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods

Heterogeneous agents models with aggregate uncertainty

These models are computational demanding to solve


I The original Krusell and Smith (1997, 1998) algorithm is notoriously slow
I Therefore, many papers study transitions
I or are restricted to relatively simple household decisions

I We depart from the Reiter (2002, 2009) perturbation method


I And (try to) provide an accessible algorithm that can deal with high-dimensional
heterogeneity

2/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods

Reiter (2002): Solve by perturbation

I Models can be written as a non-linear difference equation:


EF(Xt , Xt+1 , Yt , Yt+1 , ε t+1 ) = 0

The heterogeneous agent model:


I that is function valued and
I needs to be linearized around the stationary equilibrium (StE)

3/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods

Reiter (2002): Solve by perturbation

I Models can be written as a non-linear difference equation:


EF(Xt , Xt+1 , Yt , Yt+1 , ε t+1 ) = 0

The heterogeneous agent model:


I that is function valued and
I needs to be linearized around the stationary equilibrium (StE)

I Functions need to be approximated by finite dimensional objects (e.g. coefficients of


polynomials, splines, etc.)
I We show how to do this in a smart efficient way

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

Solving SIM by perturbation


I Our reduction method
I Application: Solving the Krusell&Smith model
I Comparison to MIT shock solution

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

Heterogeneous agents models with aggregate uncertainty


Available codes:
I Perturbation vs MIT shock for KS model (Matlab)
https://github.com/ralphluet/KS_Perturbation_vs_MIT

I Perturbation with our reduction for KS and HANK models (Matlab)


https://github.com/ralphluet/perturbation_codes

I Perturbation with our reduction for HANK models (Python)


https://github.com/econ-ark/BayerLuetticke

I Perturbation with our reduction for estimating HANK models (Julia)


https://github.com/BenjaminBorn/HANK_BusinessCycleAndInequality

6/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods

Literature - Academic articles

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

I An excellent quantitative econ source (for Python and Julia though):


lectures.quantecon.org by Tom Sargent et al.
8/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM

SIM
Model Setup

9/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM

Recursive Dynamic Planning Problem

Consider a household problem in presence of aggregate and idiosyncratic risk


I St is an (exogenous) aggregate state
I sit is a partly endogenous idiosyncratic state
I µt is the distribution over s

I Bellman equation:

ν(sit , St , µt ) = max u(sit , x) + βEν(sit+1 (x, sit ), St+1 , µt+1 )


x∈Γ(sit ,Pt )

10/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM

Recursive Dynamic Planning Problem

Consider a household problem in presence of aggregate and idiosyncratic risk


I St is an (exogenous) aggregate state
I sit is a partly endogenous idiosyncratic state
I µt is the distribution over s

I Euler equation:

u0 [x(sit , St , µt )] = βR(St , µt )Eu0 [x(sit+1 , St+1 , µt+1 )],

10/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM

No aggregate risk

Recall how to solve for a stationary equlibrium:

I Discretize the state space (vectorized)

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

I Discretized Bellman equation

ν̄ = ūh̄ + βΠh̄ ν̄ (1)

holds for optimal policy (assuming a linear interpolant for the continuation value)

I and for the law of motion for the distribution (histograms)

dµ̄ = dµ̄Πh̄ (2)

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)

This can be solved for efficiently


I dµ̄ is vector corresponding to the unit-eigenvalue of Πh̄
I Using fast solution techniques for the DP, e.g. EGM
I Using a root-finder to solve for P

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

r + δ = FK (K, L), w = FL (K, L)

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

r + δ = FK (K, L), w = FL (K, L)

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

I In a Huggett model, aggregate bond supply is zero and

K S (r) = 0

is the equilibrium condition.


14/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM

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

Excursus: Endogenous Grid Method

I Most solution methods involve root-finding.

16/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method

Excursus: Endogenous Grid Method

I Most solution methods involve root-finding.


I This is numerically intense.

16/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method

Excursus: Endogenous Grid Method

I Most solution methods involve root-finding.


I This is numerically intense.

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

Excursus: Endogenous Grid Method

I Most solution methods involve root-finding.


I This is numerically intense.

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

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

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

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

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

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

Endogenous Grid Method

I Consider the dynamic programming problem

V (s, ξ ) = max u (1 + r)s − s0 + ξ + βEV s0 , ξ 0 .


 
s0 ≥b

18/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method

Endogenous Grid Method

I Consider the dynamic programming problem

V (s, ξ ) = max u (1 + r)s − s0 + ξ + βEV s0 , ξ 0 .


 
s0 ≥b

I The first-order condition

u0 (1 + r)s − s0 + ξ = (1 + r) βEu0 ((1 + r)s0 − s00 + ξ 0 ) + λ



(3)

characterizes the optimal solution. Where λ = 0 if s0 > b

18/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method

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

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

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

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

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

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

Endogenous Grid Method

I Say c(n) is the policy function in iteration n. Then, we can be calculate the necessary
assets s as

(1 + r )s∗ (s0 , ξ ) = s0 − ξ + c∗ (s0 , ξ )


n h io
c∗ (s0 , ξ ) = u0−1 (1 + r) βEξ u0 c(n) (s0 , ξ 0 )

20/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method

Endogenous Grid Method

I Say c(n) is the policy function in iteration n. Then, we can be calculate the necessary
assets s as

(1 + r )s∗ (s0 , ξ ) = s0 − ξ + c∗ (s0 , ξ )


n h io
c∗ (s0 , ξ ) = u0−1 (1 + r) βEξ u0 c(n) (s0 , ξ 0 )

I For a given grid of points s0 , s∗ is typically off-grid!

20/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method

Endogenous Grid Method

I Say c(n) is the policy function in iteration n. Then, we can be calculate the necessary
assets s as

(1 + r )s∗ (s0 , ξ ) = s0 − ξ + c∗ (s0 , ξ )


n h io
c∗ (s0 , ξ ) = u0−1 (1 + r) βEξ u0 c(n) (s0 , ξ 0 )

I For a given grid of points s0 , s∗ is typically off-grid!


I However, we have solved a policy function for some asset levels:

(s∗ , ξ ) → c∗ (s0 , ξ )

20/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Endogenous Grid Method

Policy functions on a fixed grid

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

Policy functions on a fixed grid

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

Policy functions on a fixed grid

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

Policy functions on a fixed grid

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

EGM: Further issues

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

EGM: Further issues

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

EGM: Further issues

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

EGM: Further issues

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

Excursus: Policy functions inducing a Markov chain (Young’s method)

Suppose we have solved a dynamic programming problem

V (s, ξ ) = max u(s, s0 ) + βEξ 0 V (s0 , ξ 0 )


s0

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

Policy functions and indexes

Then, we have obtained a policy function

s∗ (s, ξ ) = arg max u(s, s0 ) + βEξ 0 V (s0 , ξ 0 ).


s0

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

Policy functions: Linear interpolation weights

s∗ −si∗
Define weights w(s, ξ ) = si∗ +1 −si∗ .
I then the linearly interpolated value function is given by

V (s, ξ ) = u [s, s∗ (s, ξ )] + [1 − w(s, ξ )] Eξ V (si∗ , ξ 0 ) + w(s, ξ )Eξ V (si∗ +1 , ξ 0 )

I Observe that V 0 is now only on grid in the s dimension!

25/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Policy functions as Markov Chains

Policy functions: Linear interpolation weights

Now assume the evolution of ξ is given by a discrete Markov chain.


I then the linearly interpolated value function is given by

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

I Observe that V 0 fully on grid!

26/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
SIM
Policy functions as Markov Chains

Policy functions: Linear interpolation weights

Moreover, we can reinterpret the weights


I Define  
if i0 = i∗ (i, j)

pjj0 1 − w(si , ξ j )

γ(i,j)→(i0 ,j0 ) = pjj0 w(si , ξ j ) if i0 = i∗ (i, j) + 1 (5)

0 else

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

Policy functions: Transition probability matrix

Why is this useful?


I We can reinterpret the linear interpolant:
The decision maker chooses only (fair) lotteries over on-grid points.

Vt = max u(s, s0 ) + βΓs0 Vt+1


s0

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

Introducing aggregate risk

With aggregate risk


I Prices and distributions change over time

Yet, for the household


I Only prices and continuation values matter
I Distributions do not influence the decisions directly

29/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Introducing aggregate risk

Redefining equilibrium (Reiter, 2002)


A sequential equilibrium with recursive individual planning
I A sequence of discretized Bellman equation, such that

νt = ūPt + βΠht νt+1 (6)

holds for optimal policy, ht (which results from νt+1 and Pt )


I and a sequence of histograms, such that

dµt+1 = dµt Πht (7)

holds given the optimal policy


I (Policy functions, ht , that are optimal given Pt , νt+1 )
I Prices, distributions and policies lead to market clearing

30/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Introducing aggregate risk

Compact notation (Schmitt-Grohé and Uribe, 2004)


The equilibrium conditions as a non-linear difference equation
I Controls: Yt = νt Pt ZYt and
 

I States: Xt = µt St ZX
 
t
where Zt are purely aggregate states/controls
I Define

F (dµt , St , dµt+1 , St+1 , νt , Pt , νt+1 , Pt+1 , ε t+1 ) (8)


dµt+1 − dµt Πht 
 
 νt − ūh + βΠh νt+1 
 t t 
= St+1 − H (St , dµt , ε t+1 )

 Φ(ht , dµt , Pt , St ) 
ε t+1
s.t.
ht (s) = arg max u(s, x) + βEνt+1 (s0 ) (9)
x∈Γ(s,Pt )
31/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Introducing aggregate risk

Compact notation (Schmitt-Grohé and Uribe, 2004)

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

Compact notation (Schmitt-Grohé and Uribe, 2004)

The equilibrium conditions as a non-linear difference equation


I Function-valued difference equation EF(Xt , Xt+1 , Yt , Yt+1 , ε t+1 ) = 0
I turns real-valued when we replace the functions by their discretized counterparts

I Standard techniques to solve by perturbation (Dynare etc)

33/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Perturbation References: General

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

Non-linear difference equation

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

I More generally, functional equations of the form:

H(d) = 0

for an unknown decision rule d.


I Perturbation solves the problem by specifying:
n
dn (x, θ ) = ∑ θi (x − x0 )i
i=0

I We use implicit-function theorems to find coefficients θi ’s


I Inherently local approximation.

36/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Motivation

I Many complicated mathematical problems have:


I either a particular case
I or a related problem
that is easy to solve.

I Often, we can use the solution of the simpler problem as a building block of the general
solution.

I Sometimes perturbation is known as asymptotic methods.

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 )

I Accuracy depends on how big e is

38/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Applications in economics

I Judd and Guu (1993) showed how to apply it to economic problems


I Recently, perturbation methods have been gaining much popularity
I In particular, second- and third-order approximations are easy to compute and notably
improve accuracy
I Perturbation theory is the generalization of the well-known linearization strategy
I Hence, we can use much of what we already know about linearization

39/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Regular versus singular perturbations

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.

I Example: excess demand function.


I Most problems in economics involve regular perturbations.
I Sometimes, however, we can have singularities.
Example: introducing a new asset in an incomplete market model.

40/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Perturbation methods

I Back to our economic model cast in the following form:

Et f (st+1 , st , ct+1 , ct ) = 0

where s are state and c are control variables.

I Rewrite f introducing a parameter for uncertainty :

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

st+1 = [H1 (st , σ ); H2 (st , σ )] + σηet+1

I with η = [0; Σ]

42/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Evolution of controls

I That ct is a control means that there is a function ct = G(st , σ)

I The goal is to solve for the unknown H1 and G.

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:

G(s, σ) = G(s∗ , σ∗ ) + Gs (s∗ , σ∗ )(s − s∗ ) + Gσ (s∗ , σ∗ )(σ − σ∗ )


+ 1/2Gss (s∗ , σ∗ )(s − s∗ )2 + Gsσ (s∗ , σ∗ )(s − s∗ )(σ − σ∗ )
+ 1/2Gσσ (s∗ , σ∗ )(σ − σ∗ )2 + ...

H (s, σ ) = H (s∗ , σ∗ ) + Hs (s∗ , σ∗ )(s − s∗ ) + Hσ (s∗ , σ∗ )(σ − σ∗ )


+ 1/2Hss (s∗ , σ∗ )(s − s∗ )2 + Hsσ (s∗ , σ∗ )(s − s∗ )(σ − σ∗ )
+ 1/2Hσσ (s∗ , σ∗ )(σ − σ∗ )2 + ...

44/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Local approximation

I Replace s and c in F:

F(s, σ ) ≡ Et f (H (st , σ ) + σηet+1 , st , G[H (st , σ ) + σηet+1 , σ], G(st , σ))


=0
I The goal is to solve for the unknown H1 and G.
I Local approximation means that we solve for H1 , G by taking a Taylor expansion of F
around the non-stochastic steady state s∗ , for which σ∗ = 0.

45/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Local approximation

I Define non-stochastic steady state as vectors (s∗ , c∗ ) :

f (s∗ , s∗ , c∗ , c∗ ) = 0

I c∗ = G(s∗ , 0) and s∗ = H (s∗ , 0)

I Note that if σ = 0, then Et f = f

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)

G(s, 0) = G(s∗ , 0) + Gs (s∗ , 0)(s − s∗ ) + Gσ (s∗ , 0)σ


H (s, 0) = H (s∗ , 0) + Hs (s∗ , 0)(s − s∗ ) + Hσ (s∗ , 0)σ

I G(s∗ , 0), H (s∗ , 0) identified by steady state values


I Remaining coefficients are identified by:

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

I Take derivative of F w.r.t. uncertainty :

Fσ (s∗ , 0) = Et fs0 (Hσ + ηe0 ) + fc0 [Gs (Hσ + ηe0 ) + Gσ ] + fc Gσ


= f s 0 H σ + f c 0 [ Gs H σ + G σ ] + f c G σ
=0
I This is a system of n equations:
 
 Hσ
f s 0 + f c 0 Gs fc0 + fc =0

I This equation is linear and homogeneous in Hσ , Gσ . Thus we have that Hσ = 0 and


Gσ = 0.

48/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Local approximation

Important theoretical result:


I In words, up to first order, we do not need to adjust the steady state solution when
changing aggregate risk σ.
I Expected values of st and ct are equal to their non-stochastic steady-state values.
I In a first order approximation the certainty equivalence principle holds, i.e., the policy
function is independent of the variance-covariance matrix of e.
I Interpretation: no precautionary behavior.

49/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Local approximation

I Differentiation w.r.t s yields:

Fs (s∗ , 0) = fs0 Hs + fs + fc0 Gs Hs + fc Gs = 0

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

I Let A = [fs0 fc0 ] and B = [fs fc ]


I Let ŝt ≡ st − s∗ , then postmultiply:
   
I I
A Hs ŝt = −B ŝ
Gs Gs t

I Consider a perfect foresight equilibrium. In this case, Hs ŝt = ŝt+1


   
I I
A ŝt+1 = −B ŝ
Gs Gs t

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 .

I Procedures to solve rational expectations models:


1. Blanchard and Kahn (1980).
2. Uhlig (1999).
3. Sims (2000).
4. Klein (2000).

52/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Local properties of the solution I

I Perturbation is a local method.

I It approximates the solution around the deterministic steady state of the problem.

I It is valid within a radius of convergence.

53/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Local properties of the solution II

I What is the radius of convergence of a power series around x? An r ∈ R∞


+ such that
∀x0 , |x0 − z0 | < r, the power series of x will converge.

I A Remarkable Result from Complex Analysis:


The radius of convergence is always equal to the distance from the center to the nearest
point where the decision rule has a (non-removable) singularity. If no such point exists
then the radius of convergence is infinite.

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

I Using an eigenvalue decomposition of Hs = PΛP−1 we obtain,

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

Alternative Solution: Time Iteration


I Rendahl (2018) extends linear time iteration
I Intuitive, robust, and easy to implement algorithm. Now x is vector of all controls and
states. Fn is transition matrix of states and controls.

I Rewrite difference equation in “end of last period” notation

Axt−1 + Bxt + Cxt+1 = 0


I Let Fn be a candidate solution:

Axt−1 + Bxt + CFn xt = 0


xt = −(B + CFn )−1 Axt−1
I Thus update guess Fn+1 as

Fn+1 = −(B + CFn )−1 A


57/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Higher order approximations

I Obtaining higher-order approximations to the solution of the non-linear system is a


sequential procedure.

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

I General trick from physics.


I An nth -rank tensor in a m-dimensional space is an operator that has n indices and mn
components and obeys certain transformation rules.
I [Fy ]iα is the (i, α) element of the derivative of F with respect to y:
1. The derivative of F with respect to y is an n x ny matrix.
2. Thus, [Fy ]iα is the element of this matrix located at the intersection of the i-th row and α-th
column.
n ∂Fi ∂Gα ∂H β
3. Thus, [Fy ]iα [Gx ]αβ [Hx ]j = ∑αy=1 ∑nβx=1 ∂y
β
α
∂xβ ∂xj
I [Fyy ]iαγ
1. Fiyy is a three dimensional array with n rows, ny columns, and ny pages.
2. [Fyy ]iαγ denotes the element at the intersection of row i, column α, and page γ

59/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Second order approximation

I Derivatives of F(s, σ):

[Fss (s∗ , 0)]ijk = 0


[Fσσ (s∗ , 0)]i = 0
[Fsσ (s∗ , 0)]ij = 0

60/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Second order approximation

I Cross derivatives are equal to zero when evaluated at (s∗ , 0):

[Fσs (s∗ , 0)]ij =[Fs0 ]iβ [Hσs ]j + [Fc0 ]iα [Gs ]αβ [Hσs ]j + [Fc0 ]iα [Gσs ]αγ [Hs ]jγ
β β

+ [Fc ]iα [Gσs ]jα = 0

I This is a system of n x ns equations in the n x ns unknowns given by the elements of Gσs


and Hσs .
I The system is homogeneous in the unknowns. Thus, if a unique solution exists, it is given
by Gσs = 0 and Hσs = 0.

61/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Second order approximation

Important theoretical result:


I The coefficients of the policy function on the terms that are linear in the state vector do
not depend on the size of the variance of the underlying shocks
I Uncertainty only affects the constant term in the policy function

62/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Second order approximation


I Approximation of G and H around the point (s, σ) = (s∗ , 0)

[G(s, σ)]i =[G(s∗ , 0)]i + [Gs (s∗ , 0)]ia [(s − s∗ )]a


1
+ [Gss (s∗ , 0)]iab [(s − s∗ )]a [(s − s∗ )]b
2
1
+ [Gσσ (s∗ , 0)]i [σ2 ]
2

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

Second order approximation

I Approximation of G and H around the point (s, σ) = (s∗ , 0) ctd

I The unknowns of this expansion are [Gss (s∗ , 0)]i , [Gσσ (s∗ , 0)]i , [Hss (s∗ , 0)]j , and
[Hσσ (s∗ , 0)]j

I Derivatives of F(s, σ) yield as many equations as we have unknowns. Perfectly identified


linear system!

64/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Second order approximation

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

Higher order approximations

I We can iterate this procedure as many times as we want.


I We can obtain n-th order approximations.
I Levintal (2017) uses tensor-unfolding to work with higher-order derivatives

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

Example: Simple RBC

67/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Stochastic neoclassical growth model



max E0 ∑ βt log ct
t=0
s.t. ct + kt+1 = ezt ktα
zt = ρzt−1 + σet , e ∼ N (0, 1)

I Note: full depreciation.


I Equilibrium conditions:

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

Solution and steady state


I Exact solution (found by ”guess and verify”):

ct =(1 − αβ)ezt ktα


kt =(αβ)ezt ktα

I Steady state is also easy to find:

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

I This is a system of functional equations (after substituting zt )


70/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

A perturbation solution

I Add perturbation parameter σ


I When σ = 0 deterministic case (with z0 = 0 and ezt = 1)
I When σ > 0 stochastic case

I Now we are searching for decision rules:

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

I We will build a local approximation around (k∗ , 0; 0)


I Given equilibrium conditions:

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α

I Take derivatives w.r.t. kt , zt , σ and evaluate them around (k∗ , 0; 0)

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:

F(kt , zt , σ ) = H(ct , ct+1 , kt , kt+1 , zt ; σ )


= H(c(kt , zt ; σ), c(k(kt , zt ; σ), zt ; σ), kt , k(kt , zt ; σ), zt ; σ)

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

I Take first-order derivatives of F(kt , zt , σ) around (k∗ , 0; 0)

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

I We substitute the coefficients that we already know.


I A linear system of 12 equations on 12 unknowns.
I Cross-terms on kσ and zσ are zero.
I More general result: all the terms in odd derivatives of σ are zero.
75/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Correction for risk

I We have the term 1/2cσσ (k, 0; 0)

I Captures precautionary behavior.

I We do not have certainty equivalence any more!

I Important advantage of second order approximation.

I Changes ergodic distribution of states.

76/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Higher-order terms

I We can continue the iteration for as long as we want.

I Great advantage of procedure: it is recursive!

I Often, a few iterations will be enough.

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

Excursus: Automatic differentiation

I Modern computer languages like Julia offer easy to implement automatic differentiation
libraries.

I Automatic differentiation is neither:


I Symbolic differentiation
I Inefficient code
I nor Numerical differentiation (the method of finite differences)
I If you make h too small, then your accuracy gets killed by floating point roundoff
I If h is too big, then approximation errors start ballooning
I AD avoids these problems: it calculates exact derivatives, so your accuracy is only limited
by floating point error.

79/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Excursus: Automatic differentiation


I AD applies the chain rule to your function
I Any complicated function f can be rewritten as the composition of a sequence of primitive
functions
I Let f (x, y) = cos x sin y + xy

80/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Excursus: Automatic differentiation

Df = Dw7 = D(w5 + w6 ) = Dw5 + Dw6


w1 w Dw − w Dw
Dw6 = D = 1 2 2 2 1
w2 w2
Dw5 = Dw3 w4 = w3 Dw4 + w4 Dw3
Dw4 = D sin w2 = cos w2 · Dw2
Dw3 = D cos w1 = − sin w1 · Dw1
Dw2 = Dy
Dw1 = Dx
81/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

Excursus: Automatic differentiation

I AD is implemented by a nonstandard interpretation of the program in which real numbers


are replaced by dual numbers and the numeric primitives are lifted to operate on dual
numbers.
I Dual numbers: Replace every number x with the number x + x0 ε, where x0 is a real
number, but ε is an abstract number with the property ε2 = 0

I Julia does this for you!


I ForwardDiff Package: www.juliadiff.org/
I Examples: www.juliadiff.org/ForwardDiff.jl/stable/user/advanced.html

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

Back to heterogeneous agent model


The equilibrium conditions as a non-linear difference equation
I Controls: Yt = νt Pt ZYt and
 

I States: Xt = µt St ZX
 
t
where Zt are purely aggregate states/controls
I Define

F (dµt , St , dµt+1 , St+1 , νt , Pt , νt+1 , Pt+1 , ε t+1 ) (10)


dµt+1 − dµt Πht 
 
 νt − ūh + βΠh νt+1 
 t t 
= St+1 − H (St , dµt , ε t+1 )

 Φ(ht , dµt , Pt , St ) 
ε t+1
s.t.
ht (s) = arg max u(s, x) + βEνt+1 (s0 ) (11)
x∈Γ(s,Pt )
84/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Perturbation

So, is all solved?

The dimensionality of the system F is still an issue


I With high dimensional idiosyncratic states, discretized value functions and distributions
become large objects
I For example:
4 income states (grid points)
× 100 illiquid asset states
× 100 liquid asset states
=⇒ ≥ 40, 000 control variables in F
I Same number of state variables

85/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method

Our Reduction Method

86/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method

Reiter (2009): Reduce dimensionality ex ante

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

Winberry (2016) extends this to the distribution functions

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

1.) Apply compression techniques as in video encoding


I Apply a discrete cosine transformation to all value/policy functions (Chebycheff
polynomials on roots grid)
I Define as reference “frame”: the StE value/policy function
I Write fluctuations as differences from this reference frame
I Assume all coefficients of the DCT from the StE close to zero do not change after shock

89/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method

Our idea

2.) Transform joint-distribution µ into copula and marginals


I Calculate the Copula, Ξ̄ of µ in the StE
I Perturb the marginal distributions
I Approximate changes in the Copula (via DCT) or use fixed Copula to calculate an
approximate joint distribution from marginals

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

1.) Apply compression techniques as in video encoding


I DCT yields the coefficients of the fitted (multi-dimensional) Chebyshev polynomial, where
the polynomial is constructed such that the tensor grid for s is mapped to the Chebyshev
knots.
See Ahmed et al. (1974) for the seminal contribution.
I Importantly, the absolute value of the coefficients has an interpretation in terms of the R2
contribution of the corresponding polynomial in fitting the data.
I This allows us to order and select the polynomial terms based on their importance.

92/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method

Excursus: Global polynomial


I Express a function by the coefficients ψ of a polynomial
n
f̂ (x) = ∑ ψj cj (x)
j=1

where ci (x) are known basis functions such as cj (x) = xj .


I Better than ordinary polynomials are usually Chebyshev polynomials of which the baseline
functions are
cj (x) = cos (j arccos x)
I These are orthogonal on [-1,1], i.e.
Z 1
1
ci ( x ) cj ( x ) √ dx = 0∀i 6= j
−1 1 − x2

93/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method

Excursus: Global polynomial

I Since the evaluation points xi are known (“grid”), we can compute


C = [cj (xi )]i=1...M,j=1...n
I The vector of function values f̂ = [f̂ (xi )]i=1...M is then given by

f̂ = Cψ

I Therefore, we can obtain an optimal (minimal MSE) as

ψ ∗ = (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

Excursus: Global polynomial: issues

I Runge’s Phenomenon: Since polynomials tend to infinity as x → ∞ it is not true that


the overall fit of a global polynomial gets better, if more grid points and higher order
polynomials are used (oscillating behavior).

I Choosing Chebyshev polynomials as basis functions and


−1 ) for i = 1 . . . N of these polynomials minimizes
I grid points as the roots xi = cos( 2i2N
approximation error.

95/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method

Excursus: Discrete Cosine Transforms


A first observation
I Suppose Chebychev root grid-points are not suitable for our problem.
I Then, we can write f (x) = f (g(y)) and
I generate the grid xi by applying g to the Chebyshev nodes yi ,
I with basis functions cj (x) = cos j arccos g−1 (x)


Discrete Cosine Transform (DCT) and lossy compression


I In particular, if we do not intend to evaluate off-grid, we do not need to know g but just
 
the nodes yi = cos 2i2N−1 π and grid values x
i
I and obtain an equivalent representation of fi in terms of coefficients.
I Shrinking ≈ 0-coefficients to 0 leaves f̂i close to unchanged.
I In addition C0 C = I.
96/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method

Details

1.) Apply compression techniques as in video encoding


I Let Θ̄ = dct(ν̄) be the coefficients obtained from the DCT of the value function in StE

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

1.) Apply compression techniques as in video encoding


I Define an index set I that contains the x percent largest (i.e. most important) elements
from Θ̄
I Let θ be a sparse vector with non-zero entries only for elements i ∈ I
(
Θ̄(i) + θt (i) i ∈ I
I Define Θ̃(θt ) =
Θ̄(i) else

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

2) Analogously for the distribution function


I Define µt as Ξt (µ̄1t , . . . , µ̄nt ) for n being the dimensionality of the idiosyncratic states
I The StE distribution is obtained when µ = Ξ̄(µ̄1 , . . . , µ̄n )

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

2) Analogously for the distribution function


I Typically prices are only influenced through the marginal distributions
I The approach ensures that changes in the mass of one dimension, say wealth, are
distributed in a sensible way across the other dimensions
I The implied distributions look “similar” to the StE one

101/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method

Obtaining the copula function of the StE

To obtain an estimate of the Copula of the StE:


1. Accumulate the histogram along every dimension to obtain CDF estimate, M.
2. Add a leading zero to the CDF matrix, M, along every dimension.
3. Calculate marginal distributions, mi , from the CDF (summing out other dims)
4. Obtain the Copula estimate as an interpolant of M on {m1 , . . . , mn }

Ξ̄ = 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 )

has too many equations


I Use only difference in marginals and the differences on I

103/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Our reduction method

Quality of approximation

I David Childers (2018), ”Automated Solution of Heterogeneous Agent Models”:


I Under some regularity conditions the solution algorithm is guaranteed to converge to the
first derivative of the true infinite dimensional solution as the discretization is refined.
I Convergence rates for the approximation are provided as well, depending on the choices of
interpolation method including polynomials, splines, histograms, and wavelets.

104/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model

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

Incomplete Markets and TFP


I Household productivity can be high or low
I No contingent claims
I Households save in capital goods (which they rent out)
I Households supply labor (disutility) and consume (utility)
I Aggregate productivity (TFP) follows a log AR-1 process
I Cobb-Douglas production function

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

Different levels of “compression”


Individual consumption policies
1.5

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

Different levels of “compression”


Individual consumption policies
1.5

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

Different levels of “compression”


Individual policy response to a 20%TFP shock
1.5

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

Different levels of “compression”


Individual policy response to a 20%TFP shock
1.5

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

Different levels of “compression”


Aggregate response to a 20%TFP shock
60
Investment
50 Capital
Output
Consumption
40
Percent

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

Different levels of “compression”


Aggregate response to a 20%TFP shock
60
Investment
50 Capital
Output
Consumption
40
Percent

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

(a) Simulation (b) Simulation close-up


35.4 1.01
Reiter-Reduction
Reiter-Reduction
Reiter-Full
35.2 Reiter-Full
Krusell-Smith
1.005 Krusell-Smith

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

Table: Den Haan errors

Absolute error (in %) for capital Kt


Reiter-Reduction Reiter-Full K-S

Mean 0.0119 0.0119 0.1237


Max 0.0152 0.0152 0.3491

Notes: Differences in percent between the simulation of the linearized solutions


of the model and simulations in which we solve for the intratemporal equilibrium
prices in every period and track the full histogram over time for t = {1, ..., 1000};
see Den Haan (2010)
113/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model

Computing time

Table: Run time for Krusell & Smith model

StE K&S Reiter-Reduction Reiter-Full

in seconds 6.28 49.85 0.43 0.91

Notes: Run time in seconds on a Dell laptop with an Intel i7-


7500U CPU @ 2.70GHz x 4. Model calibration and number
of grid points as in Den Haan et al. (2010). Code in Matlab.

114/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Krusell-Smith model
Comparison to MIT

MIT shock solution

I See Kurt Mitman’s slides.

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

Application: Estimating HANK models

119/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models

Bayer, Born, Luetticke (2020): Shocks, Frictions, and Inequality in US


Business Cycles

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

Overview of the model


Workers Production Sector Government

Produce and Differentiate Monetary Authority,


Trade Assets Obtain Income
Consumption Goods Fiscal Authority

Intermediate goods producers Policy Rules:


Rent capital & labor
Wages set by unions • Monetary authority sets
s.t. Rotemberg wage
nominal interest rate
Bonds, b>B; adjustment costs
-> Taylor rule
(Idiosyncratic Income Risk)
Competitive Market
and
for Intermediate Goods • Fiscal authority supplies
Interest
government debt,
Illiquid Assets
consumes goods, taxes
(trading friction) Dividends
labor income and profits
Profits Entrepreneurs -> Spending rule
Monopolistic resellers s.t. Rotemberg
price adjustment costs

121/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models

Introducing more macro structure

Linearization techniques easily allow for more structure


I Say, we want to add price stickiness, monetary, and fiscal policy.
I This requires additional extra state variables.
I This is numerical cheap when linearizing.

122/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models

Recap: Reiter’s method(s)


The starting point is the following observation:
I For the household, current prices and a sequence of value functions suffices to describe the
decision problem. In discretized form this is

νt = ūht + βΓht νt+1 (13)

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

Recap: Compact notation (Schmitt-Grohé and Uribe, 2004)


Allows to write equilibrium as non-linear difference equation
I Add Pt and St , purely aggregate controls and states, respectively.
I Define “market-clearing” conditions Φ(ht , µt , Pt , St )
I and a mapping Ξ(St , Pt , σΣε t+1 ) of controls to t + 1 states
I Define

F (µt , St , µt+1 , St+1 , νt , Pt , νt+1 , Pt+1 , ε t+1 ) (15)


µ t + 1 − µ t Γ ht
 
St+1 − Ξ(St , Pt , σΣε t+1 )
  
=  νt − ūht + βΓht νt+1 

 Φ(ht , µt , Pt , St ) 
ε t+1
s.t.
ht (s) = arg max u(s, x) + βEνt+1 (s0 ) (16)
x∈Γ(s,Pt )
124/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.

I Modular: Micro and Macro block: F (. . . ) = [F1 , F2 ]0

 dΞ̄(µ̄t , . . . , µ̄t ) − dΞ̄(µ̄t , . . . , µ̄t )Γt 


1 n 1 n
 
F1 =
dct idct(Θ̃(θt )) − ūht + βΓt idct(Θ̃(θt+1 ))
St+1 − Ξ(St , Pt )
 
F2 =
Φ(ht , µt , Pt , St )

125/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models

Fusing incomplete markets and price stickiness

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

Extending the household sector


1. Assume GHH preferences (for business cycles reasonable)
 1+ γ
 1− ξ
c − h n1+γ
u(c, n) =
1−ξ

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

Modeling portfolio choice: easy version


I All households hold the same bonds-to-capital ratio.
I All assets can be traded without any friction.
I Choice is over total wealth.
I For first order approximation: Returns must equal in expectations, i.e. define a safe return
on bonds Rt , prices of capital goods qt and rental rates of capital rt , then
rt+1 + qt+1
Et = Rt+1
qt

128/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models

Equilibrium conditions (idiosyncratic part)


This leaves us with the following equilibrium conditions:
(A) idiosyncratic part, using linear interpolations in micro problem:
1. Recursive planning. For the vectors of marginal utilities uc,t :

uc,t = βRt+1 Γt (uc,t+1 + λt+1 )


| {z }
one EGM backwards step

with Γt induced by optimal policies,


I given future marginal utils uc,t+1 , and expected returns Rt+1
I and current incomes determined through wages wt , dividends rt , profits πt , and capital
prices qt .
2. Law of motion for distribution of capital

µ t+1 = µ t Γ t

129/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models

Equilibrium conditions (summary variables)

(B) summary variables, model free:


j
1. It is useful to introduce an aggregate control that summarize µt : Kt := ∑j kj µt where kj is
the capital grid.
Bt
2. Let φt := Kt be the bonds-to-capital ratio entering period t.
3. For any unit of capital households hold, they have rt + qt + φt Rt resources for
consumption.
4. Every unit of capital for next period sells at qt + φt+1

130/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models

Equilibrium conditions (macro model)


(C) prices:
1. Factor prices as controls from FOCs of firms
 α   1− α
Kt Nt
wt = (1 − α)mct Zt , rt = αmct Zt − δ,
Nt Kt

prices of undifferentiated goods, mct , and total profits accordingly


 
π̂t = βEt π̂t+1 + κ mct−1 − µ̄

Πt = (1 − mct )Yt − adjustment costs/profits


2. Returns on government bonds from Taylor rule (state variable)
ρ (1− ρR ) θ π (1− ρR ) θY
Rt+1 = Rt R π̂t Ŷt

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

Equilibrium conditions (macro model)


(D) aggregate quantities:
1. Labor supply
(1 − τ )wt = Ntγ
2. Production of capital goods (ignore externality)
Kt+1 − Kt
qt = 1 + φ
Kt
3. Total output and components

Yt = Zt Ktα Nt1−α , Ct = Yt − Gt − Kt+1 + (1 − δ)Kt

4. A fiscal rule (spending adjusts, Bt is a state, Gt a control)


γ γ
Ĝt = (B̂t R̂t /π̂t )ρB π̂t π Ŷt Y , Bt+1 = Gt + Bt Rt /πt − τwt Nt

5. Goods market clearing is residual.


132/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models

2 asset models

HANK models have more action with more assets


I The literature has highlighted the role of wealthy hand-to-mouth consumers (Kaplan
et al., 2014).
I HANK models with more assets feature asset substitution as in the older Keynesian
literature (see e.g. Tobin, 1969), which is supported by the data (see Bayer et al., 2019;
Luetticke, 2020).
A tractable structure
I For many applications it suffices to assume that capital can only be traded from time to
time randomly (Calvo shock).

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

I Marginal value of illiquid assets results from usual envelop condition

Vk (h, b, k|adjust) = (q + r)uac

when trade is possible and from the marginal value of the dividend payment plus
discounted marginal value if no trade is possible

Vk (h, b, k|not) = runc + βEVk0 (h0 , b0 , k)

I Thus, Vk (h, b, k) = λ(q + r)uac + (1 − λ)(runc + βEVk0 (h0 , b0 , k))


I Optimal asset choices require qEVb (h0 , b0 , k0 ) = EVk (h0 , b0 , k0 ) which allows us to trace
out potentially optimal (b0 , k0 )(h) pairs
134/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models

Computational aspects of HANK-2

I requires both assets (100 points each)


I 22 income states
I uses both value functions and consumption policies as controls
I Full set would have > 600, 000 variables
I Reduction to 219 distribution states and ca 700 controls for value functions and policies

135/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Estimating HANK models

Exercise 6: Krusell-Smith-model with nominal rigidity

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

New in the incomplete markets model


I idiosyncratic income risk
I tax progressivity

137/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation

Solution and Estimation

138/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation

Solution method

I The distribution Θ over b, k, h is a state variable

I First-order perturbation of the non-linear difference equation EF(xt , xt+1 , et ) = 0 around


the stationary equilibrium to obtain a local approximation to the solution

I We approximate the policy functions as sparse polynomials around their stationary


equilibrium values and approximate the distribution functions by histograms of their
marginals and a time-varying Copula as in Bayer and Luetticke (2020).

139/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation

Estimation: Overview

I i.e., method linearizes the resulting non-linear difference equation


I Write as Axt = Bxt+1 and solve using standard methods
I State-space representation of the model solution

I Use Kalman filter to evaluate likelihood


I Maximize posterior likelihood
I Draw from posterior

140/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation

Estimation: Numerical details

For each new draw of the parameter vector:

1 Update of Jacobian of F[.] (less then 1sec )

2 Solve linear state space model


I State&Control vector has roughly 1000 entries
I Klein’s method via schur decomposition (ca. 5sec)

3 Run Kalman Filter to obtain log-likelihood (ca. 1sec)

141/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation

Estimation: Update of Jacobian


Changing parameters does not mean we have to update everything
I Since estimated parameters do not directly show up in household problem, they change
only small parts of A, B during estimation.
I This means that writing F (. . . ) = [F1 , F2 ]0 ,

 dΞ̄(µ̄t , . . . , µ̄t ) − dΞ̄(µ̄t , . . . , µ̄t )Γt 


1 n 1 n
 
F1 =
dct idct(Θ̃(θt )) − ūht + βΓt idct(Θ̃(θt+1 ))
St+1 − Ξ(St , Pt )
 
F2 =
Φ(ht , µt , Pt , St )
implies we only need to update the Jacobian of F2 when changing model parameters and
Φ(ht , dµt , Pt , St ) = Φ̄(Pt , St ) except for summary equation.

I Number of derivatives to be calculated same as in RANK


I Convenient also in terms of coding: Only dynare-like macro model block needs to be
edited to change the macro model. 142/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation

Estimation: Solve linear state space model

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

Estimation: Solve linear state space model

Alternative: Speed up Linear Time Iteration (Papp&Reiter, 2020)


I Fn+1 = −(B + CFn )−1 A
I F need not be initialized to zero if an estimate of F is available from an earlier calculation
with similar parameter values.
I The linear equation system can be solved making use of a variant of the
Sherman-Morrison-Woodbury formula (blockwise matrix inversion).
I Computational complexity only depends on number of states (and not controls)!

144/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Estimation

Estimation: Kalman filter

Similar to An and Schorfheide (2007) and Fernández-Villaverde (2010)

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

Estimation: Kalman filter

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

I Random Walk Metropolis Hastings algorithm to draw from posterior


I Standard to draw 200k times to recover the posterior distribution

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

Gaussian State Space


I Solution to linearized model takes state space form, which can be written as
iid
xt+1 = Gxt + wt+1 , wt+1 ∼ N (0, Q) (17)
iid
yt = Hxt + νt , νt ∼ N (0, R) (18)
I G, H, Q, R are functions of the model parameters θ
I xt is an nx × 1 vector of states
I yt is an ny × 1 vector of observables
I wt is a p × 1 vector of structural errors
I νt a vector of measurement errors
I Assumption: wt and νt are orthogonal
Et (wt+1 νs ) = 0 ∀ t + 1 and s ≥ 0
148/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Excursus: Kalman Filter

Fundamental Problem: Unobserved States


I This implies that
yt = H (Gxt−1 + wt ) + νt (19)
I Thus, yt is normally distributed:

yt ∼ N (HGxt−1 , HQH + R) (20)

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

Kalman Filter: Summary


At time t, given x̂t|t−1 , Σt|t−1 and observing yt
1. Compute the forecast error in the observations using

at = yt − Hx̂t|t−1 (21)

2. Compute the Kalman Gain Kt using


  −1
Kt = GΣt|t−1 H 0 HΣt|t−1 H 0 + R (22)

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)

4. Update the covariance matrix

Σt+1|t = (G − Kt H ) Σt|t−1 (G − Kt H )0 + Q + Kt RKt 0 (24)


150/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Excursus: Kalman Filter

Kalman Filter: Initialization


I How to initialize filter at t = 0 where no observations are available?
→ start with unconditional mean E(x) and Variance Σ
I Given covariance stationarity, the unconditional mean is

E(x) = Ext+1 = E(Gxt + wt+1 ) = GE(x) ⇒ (I − G)E(x) = 0

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 )

I Return the values {θ0 , . . . , θN }


I After the chain has passed the transient stage and the effect of the starting values has
subsided, the subsequent draws can be considered draws from the posterior

⇒ burnin required that assures remaining chain has converged

152/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Excursus: Kalman Filter

The Random-Walk Metropolis Hastings Algorithm

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)

and qRW is a multivariate density


I The candidate θ̃ is thus given by the old value θ plus a random variable increment

θ̃ = θ + z, z ∼ qRW (27)

153/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Bayer, Born, Luetticke (2020)

Estimation: Two-step procedure

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

Quarterly US data from 1954Q1 – 2019Q4

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

All demeaned and without measurement error.

155/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Application: Bayer, Born, Luetticke (2020)

Observables

Further data non-quarterly availability

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)

All in log-levels, demeaned and with measurement error.

156/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results

Estimated model variants

Data
Aggregate Data + Cross-sectional Data
Shocks

Aggregate Shocks HANK (vs RANK) HANKX

+ Cross-sectional Shocks HANKX+

157/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results

Wealth Inequality in the US

(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

Shocks and Frictions in


US Business Cycles

159/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results

Variance decomposition: GDP and components

RANK
RANK

HANK
HANK

HANKX
HANKX

0 20 40 60 80 100 0 20 40 60 80 100

Growth of output Yt Growth of consumption Ct

160/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results

US business cycles: Summary

HANK and RANK models give only a somewhat different view

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

Shocks and Frictions in


US Inequality

162/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results

Shock decomposition: Income share of top 10%

163/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results

Shock decomposition: Wealth share of top 10%

164/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results

Contribution of shocks to US inequality 1985-2019


Shock Top 10% Income Top 10% Wealth

TFP, eZ -0.38 2.63


Inv.-spec. tech., eΨ -0.17 3.26
Price markup, eµY 11.69 4.3
Wage markup, eµW 5.82 0.87
Risk premium, eA -0.62 2.07
Income risk, eσ 2.57 -0.14
Monetary policy, eR 1.30 1.98
Structural deficit, eG -0.05 1.60
Tax progressivity, τ P 1.54 0.67
Sum of shocks 21.55 16.79
165/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results

US inequality: Summary

Business cycle shocks are important drivers of inequality dynamics

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

Policy counterfactual: Inequality

I How important are the estimated policy coefficients for the evolution of inequality?

I Run estimated shock sequence with counterfactually set policy parameters


I Hawkish monetary policy (double inflation response, θπ )
I Dovish monetary policy (double output response, θY )

168/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results

Counterfactual evolution of inequality: Monetary policy

Top 10% income share Top 10% wealth share Output

Log point deviations from baseline. Black: Hawkish; Red: Dovish

169/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results

Policy counterfactual: Summary

Effect of monetary policy depends on supply vs demand shocks

Hawkish monetary policy (triple θπ )


I Higher inequality in the 70s as markup (cost-push) shocks are important

Dovish monetary policy (triple θY )


I Lower inequality in the 70s and aftermath of the Great Recession

Very persistent effect on wealth inequality.

170/178
Solving and Estimating Heterogeneous Agent Models with Aggregate Uncertainty by Perturbation Methods
Results

Summary: Bayer et al. (2020)

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

You might also like