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

'

&
$
%
Quantitative Macroeconomics
and Numerical Methods
Prof. Harald Uhlig
Humboldt Universitat Berlin

uhlig@wiwi.hu-berlin.de, January 31, 2003
http://www.wiwi.hu-berlin.de/wpol/
Copyright: Prof. H. Uhlig.
Do not copy without authors permission
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Hansens Model:
Explaining the solution strategy via an example

HU Berlin 1
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
The solution strategy
The solution strategy for a model works as follows:
1. Find the rst order necessary conditions
2. Calculate the steady state
3. Loglinearize around the steady state
4. Solve for the recursive law of motion
5. Calculate impulse responses and
(HP-ltered) moments
We will execute this strategy, using Hansens real business cycle model as
particular example.

HU Berlin 2
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Hansens benchmark Real Business Cycle Model
max E
_

t=0

t
(log c
t
An
t
)
_
s.t.
c
t
+k
t
= e
z
t
k

t1
n
1
t
+ (1 )k
t1
and
z
t
= z
t1
+
t
,
t
N(0,
2
) i.i.d.
where c
t
is consumption, n
t
is labor, k
t
is capital,
t
= e
z
t
is total
factor productivity (TFP).

HU Berlin 3
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Hansens benchmark Real Business Cycle Model
Dene, for convenience;
output: y
t
= e
z
t
k

t1
n
1
t
return: R
t
=
y
t
k
t1
+ 1
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.

HU Berlin 4
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Rational expectations
We assume that the social planner chooses c
t
, k
t
, n
t
etc., using all
available information at date t, and forming rational expectations
about the future.

Rational expectations are the mathematical


expectations, using all available information
Rational expectations only live in a model, in which the stochastic
nature of all variables is clearly spelled out.

HU Berlin 5
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Rational expectations
Example: dice role.
Dice 1, date t: X
t
. Dice 2, date t + 1: Y
t+1
. Sum: S
t+1
= X
t
+Y
t+1
.
E
t1
[S
t+1
] = 7. E
t
[S
t+1
] = 3.5 +X
t
. E
t+1
[S
t+1
] = X
t
+Y
t+1
.
E.g. X
t
= 2, Y
t+1
= 1. Then E
t1
[S
t+1
] = 7, E
t
[S
t+1
] = 5.5,
E
t+1
[S
t+1
] = 3.
Example: AR(1)
z
t+1
= z
t
+
t+1
, E
t
[
t+1
] = 0.
Then: E
t
[z
t+1
] = z
t
.

HU Berlin 6
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Labor lotteries and labor supply
We assume a very elastic labor supply for aggregate labor n
t
,
u
t
= log(c
t
) An
t
... which turns out to be needed in order to quantitatively explain
observed employment uctuations.
However, we typically imagine individual labor elasticity to be small.
This can be true simultaneously by considering labor lotteries.
Source: Richard Rogerson, Indivisible Labor, Lotteries and Equilibrium,
Journal of Monetary Economics; 21(1), January 1988, 3-16.

HU Berlin 7
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Labor lotteries and labor supply
Individual labor supply n
t
may be based on some utility function u(c
t
) +
v( n
t
).
Suppose that
labor is indivisible: agents either have a job or do not, n
t
= 0 or
n
t
= n

.
Agents are assigned to jobs according to a lottery, with probability
t
.
Shirking, moral hazard etc. are not possible. Unemployment insurance
is perfect, and consumption c
t
is independent of job status.
Total labor supplied: n
t
=
t
n

Normalization: v(0) = 0, v(n

)/n

=: A < 0.
Expected utility:
E[u(c
t
) +v( n
t
)] = u(c
t
) +
t
v(n

) = u(c
t
) An
t

HU Berlin 8
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Step 1:
Find the rst-order necessary conditions (FONCS)
Form the Lagrangian
L = max E
_

t=0

t
((log c
t
An
t
)

t
_
c
t
+k
t
e
z
t
k

t1
n
1
t
(1 )k
t1
_
)


HU Berlin 9
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Find the rst-order necessary conditions...
Dierentiate:
L
c
t
:
1
c
t
=
t
L
n
t
: A =
t
(1 )
y
t
n
t
L

t
: c
t
+k
t
= e
z
t
k

t1
n
1
t
+ (1 )k
t1
L
k
t
:
t
= E
t
[
t+1
R
t+1
]
The last equation needs explanation.

HU Berlin 10
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Dierentiating with respect to k
t
Write out the objective at date t: for the future, one can only form
conditional expectations E
t
[]. Telescope out the Lagrangian:
L = . . . +
t
((log c
t
An
t
)

t
_
c
t
+k
t
e
z
t
k

t1
n
1
t
(1 )k
t1
__
+E
t
_

t+1
((log c
t+1
An
t+1
)

t+1
_
c
t+1
+k
t+1
e
z
t+1
k

t
n
1
t+1
(1 )k
t
__
+. . .
Dierentiate with respect to k
t
:
0 =
t

t
E
t
_

t+1

t+1
_

y
t+1
k
t
+ 1
__

HU Berlin 11
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Dierentiating with respect to k
t
Sort terms and use
R
t+1
=
y
t+1
k
t
+ 1
to nd

t
= E
t
[
t+1
R
t+1
]
This equation is called an Euler equation and also the Lucas asset
pricing equation.

HU Berlin 12
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Collecting equations
1. First order conditions and a denition:
1
c
t
=
t
A =
t
(1 )
y
t
n
t
R
t
=
y
t
k
t1
+ 1

t
= E
t
[
t+1
R
t+1
]
2. Technology and Feasibility constraints:
y
t
= e
z
t
k

t1
n
1
t
c
t
+k
t
= y
t
+ (1 )k
t1
z
t
= z
t1
+
t
,
t
N(0,
2
) i.i.d.

HU Berlin 13
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Step 2: Calculate the steady state
At the steady state, all variables are constant.

HU Berlin 14
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Take all equations ...
1. First order conditions and a denition:
1
c
t
=
t
A =
t
(1 )
y
t
n
t
R
t
=
y
t
k
t1
+ 1

t
= E
t
[
t+1
R
t+1
]
2. Technology and Feasibility constraints:
y
t
= e
z
t
k

t1
n
1
t
c
t
+k
t
= y
t
+ (1 )k
t1
z
t
= z
t1
+
t
,
t
N(0,
2
) i.i.d.

HU Berlin 15
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
... and drop the time subscripts.
1. First order conditions and a denition:
1
c
=

A =

(1 )
y
n

R =
y

k
+ 1

R
2. Technology and Feasibility constraints:
y = e
z

n
1
c +

k = y + (1 )

k
z = z

HU Berlin 16
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Parameters
1. Calibration: = 0.4, = 0.012, = 0.95,

= 0.007, = 0.987,
= 1, A so that n = 1/3 (see Cooley, Frontiers...).
2. Estimation:
(a) GMM: mimics calibration, see Christiano and Eichenbaum,
Current Real-Business Cycle Theories and Aggregate Labor Market
Fluctuations, American Economic Review, vol 82, no. 3, 430 - 450.
(b) Maximum Likelihood: see e.g. Leeper and Sims, Toward a
Modern Macroeconomic Model Usable for Policy Analysis, NBER
Macroeconomics Annual, 1994, 81 - 177.
With numbers for the parameters, the steady state can be calculated
explicitely.

HU Berlin 17
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Explicit calculation
From the production function,
y = e
z

n
1
we get
y =
_
e
z
_
y

k
_

_
1
1
n

HU Berlin 18
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Explicit calculation: n given, solve for A.
1.

R =
1

5. c = y

k
2.
y

k
=

R1+

6.

=
1
c
3. y =
_
e
z
_
y

k
_

_
1
1
n 7. A =

(1 )
y
n
4.

k =
_
y

k
_
1
y

HU Berlin 19
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Explicit calculation alternative: A given, solve for n.
1.

R =
1

5.
c

k
=
y

2.
y

k
=

R1+

6. c =
1

3.
y
n
=
_
e
z
_
y

k
_

_
1
1
7.

k =
c
(
c

k
)
4.

=
A
(1)
(
y
n
)
8. y =
_
y

k
_

k

HU Berlin 20
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Step 3: Loglinearize around the steady state
Replace the dynamic nonlinear equations by dynamic linear equations.
Interpretation and calculation are made easier, if the equations are linear
in percent deviations from the steady state.

HU Berlin 21
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
The Principle of Loglinearization
For x 0,
e
x
1 +x
For x
t
, let x
t
= log(x
t
/ x) be the log-deviation of x
t
from its steady state.
Thus, 100 x
t
is (approximately) the percent deviation of x
t
from x. Then,
x
t
= xe
x
t
x(1 + x
t
)
Application: The equation
x
t
+c
t
= y
t
together with its steady state version
x + c = y
deliver the dynamic relationship
x x
t
+ c c
t
= y y
t

HU Berlin 22
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Example: RBC
Do it slowly for two equations:
The resource constraint:
c
t
+k
t
= y
t
+ (1 )k
t1
ce
c
t
+

ke

k
t
= ye
y
t
+ (1 )

ke

k
t1
c(1 + c
t
) +

k(1 +

k
t
) y(1 + y
t
) + (1 )

k(1 +

k
t1
)
(Note: c +

k = y)
c c
t
+

k

k
t
y y
t
+ (1 )

k
t1

HU Berlin 23
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Example: RBC
The asset pricing equation:

t
= E
t
[
t+1
R
t+1
]

t
= E
t
_

Re

t+1
+

R
t+1
_
1 +

t


RE
t
_
1 +

t+1
+

R
t+1
_
( Note: 1 =

R)

t
E
t
_

t+1
+

R
t+1
_
On ignored Jensen terms: can also assume joint normality of
logdeviations insteady. This changes the steady state, not the
dynamics.

HU Berlin 24
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
All loglinearized equations
# Equation Loglinearized
(i)
1
c
t
=
t
0 = c
t
+

t
(ii) A =
t
(1 )
y
t
n
t
0 =

t
+ y
t
n
t
(iii) R
t
=
y
t
k
t1
+ 1 0 =

R
t
+
y

k
_
y
t

k
t1
_
(iv) y
t
= e
z
t
k

t1
n
1
t
0 = y
t
+z
t
+

k
t1
+ (1 ) n
t
(v) c
t
+k
t
= y
t
+ (1 )k
t1
0 = c c
t

k
t
+ y y
t
+ (1 )

k
t1
(vi)
t
= E
t
[
t+1
R
t+1
] 0 =

t
+E
t
[

t+1
+

R
t+1
]
(vii) z
t+1
= z
t
+
t+1
z
t+1
= z
t
+
t+1

HU Berlin 25
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Step 4: Solve for the recursive law of motion
The structure of the problem. There is an endogenous state
vector x
t
, size m 1, a list of other endogenous variables y
t
, size n 1,
and a list of exogenous stochastic processes z
t
, size k 1. The equilibrium
relationships between these variables are
0 = Ax
t
+Bx
t1
+Cy
t
+Dz
t
(1)
0 = E
t
[Fx
t+1
+Gx
t
+Hx
t1
+Jy
t+1
+Ky
t
+Lz
t+1
+Mz
t
]
z
t+1
= Nz
t
+
t+1
; E
t
[
t+1
] = 0,
where it is assumed that C is of size l n, l n and of rank n, that F is
of size (m+n l) n, and that N has only stable eigenvalues.

HU Berlin 26
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Example: RBC
Variables:
x
t
= [capital] = [

k
t
], y
t
=
_

_
Lagrangian
consumption
output
labor
interest
_

_
=
_

t
c
t
y
t
n
t

R
t
_

_
and
z
t
= [technology] = [z
t
]

HU Berlin 27
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Example: RBC
Matrices:
A =
_

_
0
0
0
0

k
_

_
, B =
_

_
0
0

(1 )

k
_

_
, C =
_

_
1 1 0 0 0
1 0 1 1 0
0 0
y

k
0

R
0 0 1 (1 ) 0
0 c y 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 = []

HU Berlin 28
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Recursivity
State variables are: k
t1
, z
t
.
The dynamics of the model should be describable by recursive laws of
motion,

t
= f
()
(k
t1
, z
t
)
k
t
= f
(k)
(k
t1
, z
t
)
y
t
= f
(y)
(k
t1
, z
t
)
etc.

HU Berlin 29
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Recursivity
We shall assume these laws to be linear in log-deviations

t
=
k

k
t1
+
z
z
t

k
t
=
kk

k
t1
+
kz
z
t
y
t
=
yk

k
t1
+
yz
z
t
etc. for coecients
k
,
z
, etc.
To make life simpler here, we shall try to reduce the system to only k
and (one doesnt have to).

HU Berlin 30
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Simplify:
Note:
y
t
=
1

z
t
+

k
t1
+
1

t
Abbreviations:

1
=
y

k
+ (1 )

2
=
c

k
+
1

3
=
y

4
= 0

5
= 1 + (1 )
y

6
=
y

k

HU Berlin 31
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Obtaining the solution
We obtain the following rst-order two-dimensional stochastic
dierence equation:
0 =

k
t
+
1

k
t1
+
2

t
+
3
z
t
(2)
0 = E
t
[

t
+
4
k
t
+
5

t+1
+
6
z
t+1
] (3)
z
t
= z
t1
+
t
(4)
where z
t
is an exogenous stochastic process.

HU Berlin 32
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Obtaining the solution
Compare to the following rst-order two-dimensional stochastic dierence
equation to be studied in the lecture on dierence equations:
0 = x
t
+
1
x
t1
+
2
y
t
+
3
z
t
(5)
0 = E
t
[y
t
+
4
x
t
+
5
y
t+1
+
6
z
t+1
] (6)
z
t
= z
t1
+
t
(7)
They are the same with x
t
=

k
t
, y
t
=

t
.

HU Berlin 33
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
The Method of Undetermined Coecients
Postulate the recursive law of motion

t
=
k

k
t1
+
z
z
t
(8)

k
t
=
kk

k
t1
+
kz
z
t
(9)
Plug this into equations (2) once and (3) twice and exploit E
t
[z
t+1
] = z
t
,
so that only the date-t-states

k
t1
and z
t
remain,
0 = (
kk
+
1
+
2

k
)

k
t1
+ (
kz
+
2

z
+
3
) z
t
0 = (
k
+
4

kk
+
5

kk
)

k
t1
+ (
z
+
4

kz
+
5

kz
+ (
5

z
+
6
) ) z
t
Compare coecients

HU Berlin 34
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
On plugging in twice...
Plugging

t
=
k

k
t1
+
z
z
t
,

k
t
=
kk

k
t1
+
kz
z
t
z
t
= E
t
[z
t+1
]
twice into
0 = E
t
[

t
+
4

k
t
+
5

t+1
+
6
z
t+1
]
= E
t
[(
k

k
t1
+
z
z
t
) +
4
(
kk

k
t1
+
kz
z
t
)
+
5
(
k

k
t
+
z
z
t+1
) +
6
z
t+1
]
= E
t
[
k

k
t1

z
z
t
+
4

kk

k
t1
+
4

kz
z
t
)
+
5

k
(
kk

k
t1
+
kz
z
t
) + (
5

z
+
6
)z
t+1
]
= (
k
+
4

kk
+
5

kk
)

k
t1
+(
z
+
4

kz
+
5

kz
+ (
5

z
+
6
) ) z
t

HU Berlin 35
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Comparing coecients
On

k
t1
:
0 =
kk
+
1
+
2

k
0 =
k
+
4

kk
+
5

kk
One gets the characteristic quadratic equation
0 = p(
kk
) =
2
kk

4
+
1

5
_

kk
+

1

5
(10)

HU Berlin 36
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Solving the characteristic equation
Solutions:

kk
=
1
2
__

4
+
1

5
_
(11)

4
+
1

5
_
2
4

5
_
_
Choose the stable root |
kk
|< 1. There is at most one stable root, if
|
kk,1

kk,2
|=|

1

5
|> 1
With
kk
, calculate

k
=

2

HU Berlin 37
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Comparing coecients
On z
t
:
0 =
kz
+
2

z
+
3
0 =
z
+
4

kz
+
5

kz
+ (
5

z
+
6
)
Solution:

z
=

4

3
+
5

3
+
6

1
4

kz
=
2

z
+
3

HU Berlin 38
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Step 5: Calculate impulse responses
and (HP-ltered) moments
Impulse responses: will be explained now.
HP-ltered moments: will be discussed later.

HU Berlin 39
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Impulse Response Functions: response to a shock in z
t
1. Set z
0
= 0,
1
= 1,
t
= 0, t > 1
2. Calculate z
t
=
t
3. Set

k
0
= 0.
4. Calculate recursively

k
t
=
kk

k
t1
+
kz
z
t
5. With that, calculate

t
=
k

k
t1
+
z
z
t

HU Berlin 40
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Results: Impulse Responses to shocks
2 0 2 4 6 8
0.5
0
0.5
1
1.5
2
Impulse responses to a shock in technology
Years after shock
P
e
r
c
e
n
t

d
e
v
i
a
t
i
o
n

f
r
o
m

s
t
e
a
d
y

s
t
a
t
e
capital
consumption
output
labor
interest
technology

HU Berlin 41
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Impulse Response Functions: response to an initial
deviation of the state k
t
from its steady state.
1. Set z
t
= 0, t 1
2. Set

k
0
= 1.
3. Calculate recursively

k
t
=
kk

k
t1
4. With that, calculate

t
=
k

k
t1

HU Berlin 42
QMacro&NumMeth, lec 2 Prof. H. Uhlig
'
&
$
%
Results: Impulse Responses to capital deviations
2 0 2 4 6 8
0.5
0
0.5
1
Impulse responses to a one percent deviation in capital
Years after shock
P
e
r
c
e
n
t

d
e
v
i
a
t
i
o
n

f
r
o
m

s
t
e
a
d
y

s
t
a
t
e
capital
consumption
output
labor
interest

HU Berlin 43

You might also like