Jesús Fernández-Villaverde
University of Pennsylvania
March 16, 2016
Jesús Fernández-Villaverde (PENN)
March 16, 2016 1 / 36
A large class of problems in macroeconomics search for a function d that solves a functional equation :
H ( d ) = 0
More formally:
1 Let J
1 and J
2 be two functional spaces and let operator between these two spaces.
H : J
1
!
J
2 be an
2
3
Let
Ω R l
.
Then, we need to …nd a function d :
Ω !
R m such that H ( d ) = 0 .
Notes:
1 Regular equations are particular examples of functional equations.
2 0 is the space zero, di¤erent in general that the zero in the reals.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 2 / 36
Let’s go back to our basic stochastic neoclassical growth model: c t max
E
0 t
∞
∑
= 0
β t u ( c t
, l t
)
+ k t + 1
= e z t Ak t
α l t
1
α + ( 1
δ
) k t
, 8 t > 0 z t
=
ρ z t 1
+
σε t
,
ε t
N ( 0 , 1 ) log
σ t
= ( 1
ρ
σ
) log
σ
+
ρ
σ log
σ t 1
+ 1
ρ
2
σ
1
2
η u t
The …rst order condition: u
0 ( c t
, l t
) =
β
E t u
0 ( c t + 1
, l t + 1
) 1 +
α e z t + 1 Ak t
α
1
+ 1 l t
1
α
+ 1
Where is the stochastic volatility?
δ
Jesús Fernández-Villaverde (PENN)
March 16, 2016 3 / 36
De…ne: x t
= ( k t
, z t 1
, log
σ t 1
,
ε t
, u t
)
There is a decision rule (a.k.a. policy function) that gives the optimal choice of consumption and capital tomorrow given the states today: d = d
1 d
2
( x t
) = l t
( x t
) = k t + 1
From these two choices, we can …nd: c t
= e z t Ak t
α d
1
( x t
)
1
α
+ ( 1
δ
) k t d
2
( x t
)
Jesús Fernández-Villaverde (PENN)
March 16, 2016 4 / 36
Then:
β
E t
(
H = u
0 c t
, d
1
( x t
)
1 +
α e z t + 1 u
0 c t + 1
, d
1
Ad
2 ( x t
)
( x t + 1
)
α 1 d
1 ( x t + 1
)
1 α
δ
)
= 0
If we …nd g , and a transversality condition is satis…ed, we are done!
Jesús Fernández-Villaverde (PENN)
March 16, 2016 5 / 36
There is a recursive problem associated with the previous sequential problem: c t
V ( x t
) = max k t + 1
, l t f u ( c t
, l t
) +
β
E t
V ( x t + 1
) g
+ k t + 1
= e z t Ak t
α l t
1
α + ( 1
δ
) k t
, 8 t > 0 z t
=
ρ z t 1
+
σε t
,
ε t
N ( 0 , 1 ) log
σ t
= ( 1
ρ
σ
) log
σ
+
ρ
σ log
σ t 1
+ 1
ρ
2
σ
1
2
η u t
Then: d ( x t
) = V ( x t
) and
H ( d ) = d ( x t
) max k t + 1
, l t f u ( c t
, l t
) +
β
E t d ( x t + 1
) g = 0
Jesús Fernández-Villaverde (PENN)
March 16, 2016 6 / 36
General idea: substitute d ( x ) by d n
( x ,
θ
) where
θ is an n dim vector of coe¢ cients to be determined.
Two Main Approaches:
1 Perturbation methods : d n
( x ,
θ
) = n
i = 0
θ i
( x x
0
) i
We use implicit-function theorems to …nd
θ i
.
2 Projection methods : d n
( x ,
θ
) = n
i = 0
θ i
Ψ i
( x )
We pick a basis f Ψ i
( x ) g
∞ i = 0 and “project” H ( ) against that basis.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 7 / 36
Linearization (or loglinearization): equivalent to a …rst-order perturbation.
Linear-quadratic approximation: equivalent (under certain conditions) to a …rst-order perturbation.
Parameterized expectations: a particular example of projection.
Value function iteration:it can be interpreted as an iterative procedure to solve a particular projection method. Nevertheless, I prefer to think about it as a di¤erent family of problems.
Policy function iteration: similar to VFI.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 8 / 36
Generality: abstract framework highlights commonalities across problems.
Large set of existing theoretical and numerical results in applied math.
It allows us to identify more clearly issue and challenges speci…c to economic problems (for example, importance of expectations).
It allows us to deal e¢ ciently with nonlinearities.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 9 / 36
Perturbation builds a Taylor-series approximation of the exact solution.
Very accurate around the point where the approximation is undertakes.
Often, surprisingly good global properties.
Only approach that handle models with dozens of state variables.
Relation between uncertainty shocks and the curse of dimensionality.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 10 / 36
General:
1
2
A First Look at Perturbation Theory by James G. Simmonds and
James E. Mann Jr .
Advanced Mathematical Methods for Scientists and Engineers:
Asymptotic Methods and Perturbation Theory by Carl M. Bender,
Steven A. Orszag .
Economics:
1 Perturbation Methods for General Dynamic Stochastic Models” by
Hehui Jin and Kenneth Judd .
2
3
Perturbation Methods with Nonlinear Changes of Variables” by
Kenneth Judd .
A gentle introduction: “Solving Dynamic General Equilibrium Models
Using a Second-Order Approximation to the Policy Function” by
Martín Uribe and Stephanie Schmitt-Grohe .
Jesús Fernández-Villaverde (PENN)
March 16, 2016 11 / 36
Let me come back to our RBC-SV model.
Three changes:
1
Eliminate labor supply and have a log utility function for consumption.
2 Full depreciation.
3 A = 1.
Why?
Jesús Fernández-Villaverde (PENN)
March 16, 2016 12 / 36
s.t.
c t max
E
0 t
∞
∑
= 0
β t log c t
+ k t + 1
= e z t k t
α , 8 t > 0 z t
=
ρ z t 1
+
σε t log
σ t
= ( 1
ρ
σ
) log
σ
+
ρ
σ log
σ t 1
+ 1
ρ
2
σ
1
2
η u t
Equilibrium conditions:
1 c t
=
β
E t c t
1 c t + 1
α e z t + 1 k t
α
1
+ 1
+ k t + 1
= e z t k t
α z t
=
ρ z t 1
+
σε t log
σ t
= ( 1
ρ
σ
) log
σ
+
ρ
σ log
σ t 1
+ 1
ρ
2
σ
1
2
η u t
Jesús Fernández-Villaverde (PENN)
March 16, 2016 13 / 36
Exact solution (found by “guess and verify”): c t
= ( 1
αβ
) e z t k t
α k t + 1
=
αβ e z t k t
α
Note that this solution is the same than in the model without stochastic volatility.
Intuition.
However, the dynamics of the model is a¤ected by the law of motion for z t
.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 14 / 36
Steady state is also easy to …nd: c k = (
αβ
) 1
1
α
= (
αβ
) 1
α
α
(
αβ
) 1
1
α z = 0 log
σ
= log
σ
Steady state in more general models.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 15 / 36
De…ne x t
= ( k t
, z t 1
, log
σ t 1
,
ε t
, u t
;
λ
) .
Role of
λ
: perturbation parameter.
We are searching for decision rules: d = c t k t + 1
= c ( x t
)
= k ( x t
)
Then, we have a system of functional equations:
1 c ( x t
)
=
β
E t c
1
( x t + 1
)
α e z t + 1 k ( x t
) α 1 c ( x t
) + k ( x t
) = e z t k t
α z t
=
ρ z t 1
+
σ t λε t log
σ t
= ( 1
ρ
σ
) log
σ
+
ρ
σ log
σ t 1
+ 1
ρ
2
σ
1
2
ηλ u t
Jesús Fernández-Villaverde (PENN)
March 16, 2016 16 / 36
We will build a local approximation around x = ( k , 0 , log
σ
, 0 , 0 ;
λ
) .
Given equilibrium conditions:
E t
1 c ( x t
)
β c
1
( x t + 1
)
α e z t + 1 k ( x t
) α
1 c ( x t
) + k ( x t
) e z t k t
α = 0
= 0
We will take derivatives with respect to evaluate them around x
( k , z , log
σ
,
ε
, u ;
λ
) and
= ( k , 0 , log
σ
, 0 , 0 ;
λ
) .
Why?
Apply Taylor’s theorem and a version of the implicit-function theorem.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 17 / 36
c t
= c ( k t
, z t 1
, log
σ t 1
,
ε t
, u t
; 1 ) j k , 0 , 0
= c ( x )
+ c k
( x ) ( k t k ) + c z
( x ) z t 1
+ c log σ
( x ) log
σ t 1
+
+ c
ε
( x )
ε t
+ c u
( x ) u t
+ c
λ
( x )
+
+
2
1
1 c kk
2
( x c k log
σ
) (
( x k t
) ( k t k )
2 k
+
)
1
2 log c kz
σ t
( x
1
) (
+ k t
...
k ) z t 1
+
Jesús Fernández-Villaverde (PENN)
March 16, 2016 18 / 36
k t
= k ( k t
, z t 1
, log
σ t 1
,
ε t
, u t
; 1 ) j k , 0 , 0
= k ( x )
+ k k
( x ) ( k t k ) + k z
( x ) z t 1
+ k log σ
( x ) log
σ t 1
+
+ k
ε
( x )
ε t
+ k u
( x ) u t
+ k
λ
( x )
+
+
2
1
1 k kk
2
( x k k log
σ
) (
( x k t
) ( k t k )
2 k
+
)
1
2 log k kz
σ t
( x
1
) (
+ k t
...
k ) z t 1
+
Jesús Fernández-Villaverde (PENN)
March 16, 2016 19 / 36
From now on, to save on notation, I will write
"
F ( x t
) =
E t c
1
( x t
) c
β c ( x t
1
+ 1
)
α e z t + 1 k
( x t
) + k ( x t
) e z t
( x t
) k t
α
α
1
#
=
0
0
I will take partial derivatives of F steady state
( x t
) and evaluate them at the
Do these derivatives exist?
Jesús Fernández-Villaverde (PENN)
March 16, 2016 20 / 36
We take …rst-order derivatives of F ( x t
) around x .
Thus, we get:
DF ( x ) = 0
A matrix quadratic system.
Why quadratic? Stable and unstable manifold.
However, it has a nice recursive structure that we can and should exploit.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 21 / 36
Procedures to solve quadratic systems:
1
Blanchard and Kahn (1980) .
2 Uhlig (1999) .
3 Sims (2000) .
4 Klein (2000) .
All of them equivalent.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 22 / 36
Coe¢ cients associated with
λ are zero.
Coe¢ cients associated with log
σ t 1 are zero.
Coe¢ cients associated with u t are zero.
In fact, up to …rst-order, stochastic volatility is irrelevant.
This result recovers traditional macroeconomic approach to
‡uctuations.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 23 / 36
No precautionary behavior.
Di¤erence between risk-aversion and precautionary behavior.
Leland
(1968) , Kimball (1990) .
Risk-aversion depends on the second derivative (concave utility).
Precautionary behavior depends on the third derivative (convex marginal utility).
Jesús Fernández-Villaverde (PENN)
March 16, 2016 24 / 36
We take …rst-order derivatives of F ( x t
) around x .
Thus, we get:
D
2
F ( x ) = 0
We substitute the coe¢ cients that we already know.
A matrix linear system.
It also has a recursive structure, but now it is less crucial to exploit it.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 25 / 36
Coe¢ cients associated with
λ are zero, but not coe¢ cients associated with
λ
2
.
Coe¢ cients associated with associated with
ε t log
σ t 1
.
( log
σ t 1
)
2 are zero, but not coe¢ cients
Coe¢ cients associated with u
2 t associated with
ε t u t
.
are zero, but not coe¢ cients
Thus, up to second-order, stochastic volatility matters.
However, we cannot compute impulse-response functions to volatility shocks.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 26 / 36
We take third-order derivatives of F ( x t
) around x .
Thus, we get:
D
3
F ( x ) = 0
We substitute the coe¢ cients that we already know.
Still a matrix linear system with a recursive structure.
Memory management considerations.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 27 / 36
In practice you do all this approximations with a computer:
1 First-,second-, and third- order: Dynare .
2 Higher order: Mathematica, Dynare++ .
Burden: analytical derivatives.
Why are numerical derivatives a bad idea?
Alternatives: automatic di¤erentiation?
Jesús Fernández-Villaverde (PENN)
March 16, 2016 28 / 36
Remember that we want to solve a functional equations of the form:
H ( d ) = 0 for an unknown decision rule d .
Projection methods solve the problem by specifying: d n
( x ,
θ
) = i n
∑
= 0
θ i
Ψ i
( x )
We pick a basis
…nd the
θ i
’s.
f Ψ i
( x ) g i
∞
= 0 and “project” H ( ) against that basis to
We work with linear combinations of basis functions because theory of nonlinear approximations is not as developed as the linear case.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 29 / 36
1
2
3
4
5
De…ne n known linearly independent functions
ψ i n < ∞
. We call the
ψ
0
( ) ,
ψ
2
( ) , ...,
ψ n
( ) the
: Ω ! < m , where basis functions .
De…ne a vector of coe¢ cients
θ
= [
θ 0
,
θ `
, ...,
θ n
] .
De…ne a combination of the basis functions and the
θ
’s: d n
( j
θ
) = i n
∑
= 0
θ i ψ n
( )
Plug d n
( j
θ
) into H ( ) to …nd the residual equation :
R ( j
θ
) = H ( d n
( j
θ
))
Find b that make the residual equation as close to 0 as possible given some objective function
ρ
: J 1 J 1 !
J 2 :
= arg min
θ
2< n
ρ
( R ( j
θ
) , 0 )
Jesús Fernández-Villaverde (PENN)
March 16, 2016 30 / 36
Obviously, we cannot review here all the literature on solution methods for models with heterogeneous agents.
Particular example of Bloom et al. (20012)
Based on Krusell and Smith (1998) and Kahn and Thomas (2008)
FOCs: w t m t
=
φ c t n ξ t c t
=
β c t + 1
Jesús Fernández-Villaverde (PENN)
March 16, 2016 31 / 36
Remember:
8
<
= max i , n
:
V k , n
1
, z ; A ,
σ
Z
,
σ
A
,
Φ y w A ,
σ
AC k
( k , k
0 )
Z
,
σ
A
,
Φ n i
AC n
+ E mV k
0
, n , z
0
; A
0
,
σ
Z 0
( n
1
, n )
,
σ
A 0
, Φ 0 s.t.
Φ 0
=
Γ
A ,
σ
Z
,
σ
A
,
Φ
9
=
;
Jesús Fernández-Villaverde (PENN)
March 16, 2016 32 / 36
Then, we can rewrite:
= max i , n
1 c e k , n
1
, z ; A ,
σ
Z
,
σ
A
,
Φ y
φ cn
1 +
ξ
+
β
E e i AC k
( k , k
0 ) AC n
0
, n , z
0
; A
0
,
σ
Z 0
,
σ
A 0
, Φ 0
( n
1
, n ) s.t.
Φ m 0
= Γ A ,
σ
Z
,
σ
A
, Φ where
=
1
V c
We can apply a version of K-S algorithm.
Jesús Fernández-Villaverde (PENN)
March 16, 2016 33 / 36
We approximate:
= max i , n
1 c e k , n
1
, z ; A ,
σ
Z
,
σ
A
,
Φ m y
φ cn
1 +
ξ
+
β
E e i AC k
( k , k
0 ) AC n
0
, n , z
0
; A
0
,
σ
Z 0
,
σ
A 0
, Φ m 0
( n
1
, n ) s.t.
Φ m 0
=
Γ
A ,
σ
Z
,
σ
A
,
Φ m
Forecasting rules for
1 c and
Γ
.
Since they are aggregate rules, a common guess is of the form: log
1 c log K
0
=
α 1
A ,
σ
Z
,
σ
A
+
α 2
A ,
σ
Z
,
σ
A
K
=
α 3
A ,
σ
Z
,
σ
A
+
α 4
A ,
σ
Z
,
σ
A
K
Jesús Fernández-Villaverde (PENN)
March 16, 2016 34 / 36
1
Guess initial values for f
α 1
,
α 2
,
α 3
,
α 4 g .
2
Given guessed forecasting rules, solve value function of an individual
…rm.
3
Simulate the economy for a large number of periods, computing and K
0
.
1 c
4 Use regression to update forecasting rules.
5 Iterate until convergence
Jesús Fernández-Villaverde (PENN)
March 16, 2016 35 / 36
I presented the plain vanilla K-S algorithm.
Many recent developments.
Check Algan, Allais, Den Haan, and Rendahl (2014).
Jesús Fernández-Villaverde (PENN)
March 16, 2016 36 / 36