(Didactic) - Solving DSGE Models Uhlig
(Didactic) - Solving DSGE Models Uhlig
Prof. H. Uhlig1
Winter 2006/07
Outline
1 The solution strategy
Overview
2 Hansens benchmark Real Business Cycle Model
The model
Rational expectations
Labor supply
3 The solution steps
Step 1: find the FONCs
Step 2: Calculate the steady state
Step 3: Loglinearize
Step 4: Solve for the RLOM
Step 5: Calculate impulse responses
4 Representations
Alternative representations
Prof. H. Uhlig IAMA: Lecture 5
The solution strategy
Hansens benchmark Real Business Cycle Model
Overview
The solution steps
Representations
Outline
1 The solution strategy
Overview
2 Hansens benchmark Real Business Cycle Model
The model
Rational expectations
Labor supply
3 The solution steps
Step 1: find the FONCs
Step 2: Calculate the steady state
Step 3: Loglinearize
Step 4: Solve for the RLOM
Step 5: Calculate impulse responses
4 Representations
Alternative representations
Prof. H. Uhlig IAMA: Lecture 5
The solution strategy
Hansens benchmark Real Business Cycle Model
Overview
The solution steps
Representations
Outline
1 The solution strategy
Overview
2 Hansens benchmark Real Business Cycle Model
The model
Rational expectations
Labor supply
3 The solution steps
Step 1: find the FONCs
Step 2: Calculate the steady state
Step 3: Loglinearize
Step 4: Solve for the RLOM
Step 5: Calculate impulse responses
4 Representations
Alternative representations
Prof. H. Uhlig IAMA: Lecture 5
The solution strategy
The model
Hansens benchmark Real Business Cycle Model
Rational expectations
The solution steps
Labor supply
Representations
" ∞
#
X
max E β t (log ct − Ant )
t=0
s.t.
ct + kt = γ̄ezt kt−1
θ
nt1−θ + (1 − δ)kt−1
and
zt = ρzt−1 + ǫt , ǫt ∼ N(0, σ 2 ) i.i.d.
where ct is consumption, nt is labor, kt is capital, γt = γ̄ezt is
total factor productivity (TFP).
See:
1 Hansen, G., “Indivisible Labor and the Business Cycle,”
Journal of Monetary Economics, 1985, 16, 309-27.
2 Cooley, editor, Frontiers of Business Cycle Research,
Princeton University Press, 1995.
Outline
1 The solution strategy
Overview
2 Hansens benchmark Real Business Cycle Model
The model
Rational expectations
Labor supply
3 The solution steps
Step 1: find the FONCs
Step 2: Calculate the steady state
Step 3: Loglinearize
Step 4: Solve for the RLOM
Step 5: Calculate impulse responses
4 Representations
Alternative representations
Prof. H. Uhlig IAMA: Lecture 5
The solution strategy
The model
Hansens benchmark Real Business Cycle Model
Rational expectations
The solution steps
Labor supply
Representations
Rational expectations
Rational expectations
Outline
1 The solution strategy
Overview
2 Hansens benchmark Real Business Cycle Model
The model
Rational expectations
Labor supply
3 The solution steps
Step 1: find the FONCs
Step 2: Calculate the steady state
Step 3: Loglinearize
Step 4: Solve for the RLOM
Step 5: Calculate impulse responses
4 Representations
Alternative representations
Prof. H. Uhlig IAMA: Lecture 5
The solution strategy
The model
Hansens benchmark Real Business Cycle Model
Rational expectations
The solution steps
Labor supply
Representations
Outline
1 The solution strategy
Overview
2 Hansens benchmark Real Business Cycle Model
The model
Rational expectations
Labor supply
3 The solution steps
Step 1: find the FONCs
Step 2: Calculate the steady state
Step 3: Loglinearize
Step 4: Solve for the RLOM
Step 5: Calculate impulse responses
4 Representations
Alternative representations
Prof. H. Uhlig IAMA: Lecture 5
Step 1: find the FONCs
The solution strategy
Step 2: Calculate the steady state
Hansens benchmark Real Business Cycle Model
Step 3: Loglinearize
The solution steps
Step 4: Solve for the RLOM
Representations
Step 5: Calculate impulse responses
Step 1:
Find the first-order necessary conditions (FONCS)
Differentiate:
∂L 1
: = λt
∂ct ct
∂L yt
: A = λt (1 − θ)
∂nt nt
∂L
: ct + kt = γ̄ezt kt−1
θ
nt1−θ + (1 − δ)kt−1
∂λt
∂L
: λt = βEt [λt+1 Rt+1 ]
∂kt
The last equation needs explanation.
Collecting equations
1 First order conditions and a definition:
1
= λt
ct
yt
A = λt (1 − θ)
nt
yt
Rt = θ +1−δ
kt−1
λt = βEt [λt+1 Rt+1 ]
2 Technology and Feasibility constraints:
yt = γ̄ezt kt−1
θ
nt1−θ
ct + kt = yt + (1 − δ)kt−1
zt = ρzt−1 + ǫt , ǫt ∼ N(0, σ 2 ) i.i.d.
Outline
1 The solution strategy
Overview
2 Hansens benchmark Real Business Cycle Model
The model
Rational expectations
Labor supply
3 The solution steps
Step 1: find the FONCs
Step 2: Calculate the steady state
Step 3: Loglinearize
Step 4: Solve for the RLOM
Step 5: Calculate impulse responses
4 Representations
Alternative representations
Prof. H. Uhlig IAMA: Lecture 5
Step 1: find the FONCs
The solution strategy
Step 2: Calculate the steady state
Hansens benchmark Real Business Cycle Model
Step 3: Loglinearize
The solution steps
Step 4: Solve for the RLOM
Representations
Step 5: Calculate impulse responses
Parameters
Explicit calculation
ȳ = γ̄ez̄ k̄ θ n̄1−θ
we get
1
−θ ! 1−θ
ȳ
z̄
ȳ = γ̄e n̄
k̄
1
1. R̄ = β
5. c̄ = ȳ − δ k̄
ȳ R̄−1+δ 1
2. k̄
= θ
6. λ̄ = c̄
1
−θ 1−θ
ȳ
3. ȳ = γ̄e z̄
k̄
n̄ 7. A = λ̄(1 − θ) ȳn̄
−1
ȳ
4. k̄ = k̄
ȳ
1 c̄ ȳ
1. R̄ = β
5. k̄
= k̄
−δ
ȳ R̄−1+δ 1
2. k̄
= θ
6. c̄ = λ̄
1
−θ 1−θ
ȳ ȳ c̄
3. = γ̄ez̄ 7. k̄ =
n̄ k̄ ( k̄c̄ )
A ȳ
4. λ̄ = (1−θ)( ȳn̄ )
8. ȳ = k̄
k̄
Outline
1 The solution strategy
Overview
2 Hansens benchmark Real Business Cycle Model
The model
Rational expectations
Labor supply
3 The solution steps
Step 1: find the FONCs
Step 2: Calculate the steady state
Step 3: Loglinearize
Step 4: Solve for the RLOM
Step 5: Calculate impulse responses
4 Representations
Alternative representations
Prof. H. Uhlig IAMA: Lecture 5
Step 1: find the FONCs
The solution strategy
Step 2: Calculate the steady state
Hansens benchmark Real Business Cycle Model
Step 3: Loglinearize
The solution steps
Step 4: Solve for the RLOM
Representations
Step 5: Calculate impulse responses
For x ≈ 0,
ex ≈ 1 + x
For xt , let x̂t = log(xt /x̄) be the log-deviation of xt from its
steady state. Thus, 100 ∗ x̂t is (approximately) the percent
deviation of xt from x̄. Then,
Application of Loglinearization
xt + ct = yt
x̄ + c̄ = ȳ
Example: RBC
ct + kt = yt + (1 − δ)kt−1
c̄eĉt + k̄ ek̂t = ȳ eŷt + (1 − δ)k̄ ek̂t−1
c̄(1 + ĉt ) + k̄ (1 + k̂t ) ≈ ȳ (1 + ŷt ) + (1 − δ)k̄ (1 + k̂t−1 )
(Note: c̄ + δ k̄ = ȳ )
c̄ ĉt + k̄ k̂t ≈ ȳ ŷt + (1 − δ)k̄ k̂t−1
Example: RBC
Outline
1 The solution strategy
Overview
2 Hansens benchmark Real Business Cycle Model
The model
Rational expectations
Labor supply
3 The solution steps
Step 1: find the FONCs
Step 2: Calculate the steady state
Step 3: Loglinearize
Step 4: Solve for the RLOM
Step 5: Calculate impulse responses
4 Representations
Alternative representations
Prof. H. Uhlig IAMA: Lecture 5
Step 1: find the FONCs
The solution strategy
Step 2: Calculate the steady state
Hansens benchmark Real Business Cycle Model
Step 3: Loglinearize
The solution steps
Step 4: Solve for the RLOM
Representations
Step 5: Calculate impulse responses
Recursivity
λt = f(λ) (kt−1 , zt )
kt = f(k ) (kt−1 , zt )
yt = f(y ) (kt−1 , zt )
etc.
Recursivity
Simplify:
Note: ŷt = 1θ zt + k̂t−1 + 1−θ
θ λ̂t
Abbreviations:
ȳ
α1 = + (1 − δ)
k̄
c̄ 1 − θ ȳ
α2 = +
k̄ θ k̄
ȳ
α3 =
θk̄
α4 = 0
ȳ
α5 = 1 + (1 − θ)
R̄ k̄
ȳ
α6 =
R̄ k̄
Prof. H. Uhlig IAMA: Lecture 5
Step 1: find the FONCs
The solution strategy
Step 2: Calculate the steady state
Hansens benchmark Real Business Cycle Model
Step 3: Loglinearize
The solution steps
Step 4: Solve for the RLOM
Representations
Step 5: Calculate impulse responses
On plugging in twice...
Plugging
λ̂t = ηλk k̂t−1 + ηλz zt , k̂t = ηkk k̂t−1 + ηkz zt ρzt = Et [zt+1 ]
twice into
Comparing coefficients
On k̂t−1 :
0 = −ηkk + α1 + α2 ηλk
0 = −ηλk + α4 ηkk + α5 ηλk ηkk
Choose the stable root | ηkk |< 1. There is at most one stable
root, if
α
| ηkk ,1 ηkk ,2 |=| 1 |> 1
α5
With ηkk , calculate
ηλλ − α1
ηλk =
α2
Prof. H. Uhlig IAMA: Lecture 5
Step 1: find the FONCs
The solution strategy
Step 2: Calculate the steady state
Hansens benchmark Real Business Cycle Model
Step 3: Loglinearize
The solution steps
Step 4: Solve for the RLOM
Representations
Step 5: Calculate impulse responses
Comparing coefficients
On zt :
0 = −ηkz + α2 ηλz + α3
0 = −ηλz + α4 ηkz + α5 ηλk ηkz + (α5 ηλz + α6 ) ρ
Solution:
α4 α3 + α5 ηλk α3 + α6 ρ
ηλz =
1 − α4 α2 − α5 ηλk α2 − α5 ρ
ηkz = α2 ηλz + α3
Outline
1 The solution strategy
Overview
2 Hansens benchmark Real Business Cycle Model
The model
Rational expectations
Labor supply
3 The solution steps
Step 1: find the FONCs
Step 2: Calculate the steady state
Step 3: Loglinearize
Step 4: Solve for the RLOM
Step 5: Calculate impulse responses
4 Representations
Alternative representations
Prof. H. Uhlig IAMA: Lecture 5
Step 1: find the FONCs
The solution strategy
Step 2: Calculate the steady state
Hansens benchmark Real Business Cycle Model
Step 3: Loglinearize
The solution steps
Step 4: Solve for the RLOM
Representations
Step 5: Calculate impulse responses
1 Set z0 = 0, ǫ1 = 1, ǫt = 0, t > 1
2 Calculate zt = ρt
3 Set k̂0 = 0.
4 Calculate recursively
1.5 labor
1 technology capital
consumption
0.5
0 interest
−0.5
−2 0 2 4 6 8
Years after shock
1 Set zt = 0, t ≥ 1
2 Set k̂0 = 1.
3 Calculate recursively
0.5 consumption
0
output
interest
−0.5 labor
−2 0 2 4 6 8
Years after shock
Outline
1 The solution strategy
Overview
2 Hansens benchmark Real Business Cycle Model
The model
Rational expectations
Labor supply
3 The solution steps
Step 1: find the FONCs
Step 2: Calculate the steady state
Step 3: Loglinearize
Step 4: Solve for the RLOM
Step 5: Calculate impulse responses
4 Representations
Alternative representations
Prof. H. Uhlig IAMA: Lecture 5
The solution strategy
Hansens benchmark Real Business Cycle Model
Alternative representations
The solution steps
Representations
Example: RBC
Variables:
Lagrangian λ̂t
consumption
ĉt
xt = [capital] = [k̂t ], yt =
output =
ŷt
labor n̂t
interest R̂t
and
zt = [technology] = [zt ]
Example: RBC
Matrices:
0 1 1 0 0 0
0
0 0 1 0 1 −1 0
−θ ȳk̄ 0 0 θ ȳk̄
A= 0
,B =
,C =
0 −R̄
0 θ 0 0 −1 (1 − θ) 0
−k̄ (1 − δ)k̄ 0 −c̄ ȳ 0 0
and
F = [0], G = [0], H = [0], J = [1, 0, 0, 0, 1],
K = [−1, 0, 0, 0, 0], L = [0], M = [0], N = [ρ]
Alternative representations 1
Alternative representations 2
Redefine the system as
xt 0
x̃t = yt , ǫ̃t = 0 ,
zt ǫt
0 0 0 A C D B 0 0
F̃ = F J L , G̃ = G K M , H̃ = H 0 0
0 0 0 0 0 −Ik 0 0 N
Alternative Representations 3
Various Representations 4