Sie sind auf Seite 1von 28

Solving for portfolios in DSGE models using

perturbation methods
Joe Steinberg
August 8, 2011
Overview

Standard perturbation methods dont work for portfolio problems.

Curse of dimensionality makes global methods impractical for more


than a few agents and assets.

Present alternative algorithms of Devereux and Sutherland that are


based on local methods and dont have this problem.

Applicable to wide range of portfolio problems: arbitrary number of


agents, assets and shocks.
Devereux and Sutherland papers

Country Portfolios in Open Economy Macro Models (JEEA 2011).

Country Portfolio Dynamics (JEDC 2010).

Links on my website plus link to their example code (required to run


my example).
A simple two-country Lucas tree model

Two countries, foreign variables have stars.

Each country has one Lucas tree. Bear same kind of fruit.
Endowment process
_
log y
t
log y

t
_
= N
_
log y
t1
log y

t1
_
+
_

t
_

Fraction of each countrys endowment is capital income that


accrues to holder of Lucas tree. Other 1 is labor income.

Representative agent in each country can trade claims to Lucas


trees. No other asset trade.
Agents problem

Choose shares in Lucas trees {


h,t
,
f ,t
}

t=0
to maximize lifetime
utility E
0

t=0

t
u(c
t
).

Home countrys budget constraint:


c
t
+p
t

h,t
+p

f ,t
= (1)y
t
+
h,t1
(p
t
+y
t
) +
f ,t1
(p

t
+y

t
)

Similar for foreign country:


c

t
+p

h,t
+p
t

f ,t
= (1)y

t
+

h,t1
(p

t
+y

t
) +

f ,t1
(p
t
+y
t
)
Equilibrium

First order conditions:


p
t
u

(c
t
) = E
t
_
u

(c
t+1
)(p
t+1
+ y
t+1
)

t
u

(c
t
) = E
t
_
u

(c
t+1
)(p

t+1
+ y

t+1
)

p
t
u

(c

t
) = E
t
_
u

(c

t+1
)(p
t+1
+ y
t+1
)

t
u

(c

t
) = E
t
_
u

(c

t+1
)(p

t+1
+ y

t+1
)

Market clearing:
c
t
+ c

t
+ y
t
+ y

t
,
h,t
+

f ,t
= 1,
f ,t
+

h,t
= 1
Accounting change

Before, neither agent had claim to Lucas tree income by default.


Positive net supply of shares.

Now, change it so each country gets Lucas tree income by deault.


Zero net supply of shares.

New budget constraints:


c
t
+ p
t

h,t
+ p

f ,t
= y
t
+
h,t1
(p
t
+ y
t
) +
f ,t1
(p

t
+ y

t
)
c

t
+ p

h,t
+ p
t

f ,t
= y

t
+

h,t1
(p

t
+ y

t
) +

f ,t1
(p
t
+ y
t
)
Change of variables

Let
h,t
and
f ,t
denote value of domestic agents holdings of
domestic and foreign stock at end of period t:

h,t
= p
t

h,t
,
f ,t
= p

f ,t

Similar for foreign agent:

h,t
= p

h,t
,

f ,t
= p
t

f ,t

Market clearing:
h,t
+

f ,t
= 0,
f ,t
+

h,t
= 0.

Let w
t
=
h,t
+
f ,t
and w

t
=

h,t
+

f ,t
denote total wealth at
end of period t.

Market clearing: w
t
+ w

t
= 0.
Reframe maximization problem

Choose total wealth w


t
(w

t
) and value of domestic shares
h,t
(

f ,t
).

Budget constraints again:


c
t
+ w
t
= (R
t
R

t
)
h,t1
+ R

t
w
t1
(1)
c

t
+ w

t
= (R
t
R

t
)

f ,t1
+ R

t
w

t1
(2)

Stock returns
R
t
=
p
t
+ y
t
p
t
R

t
=
p

t
+ y

t
p

t
Equilibrium

First order conditions:


u

(c
t
) = E
t
_
u

(c
t+1
)R

(3)
u

(c

t
) = E
t
_
u

(c

t+1
)R

(4)
E
t
_
u

(c
t+1
)R
t

= E
t
_
u

(c
t+1
)R

(5)
E
t
_
u

(c

t+1
)R
t

= E
t
_
u

(c

t+1
)R

(6)

Market clearing:
w
t
+ w

t
= 0,
h,t
+

f ,t
= 0
First-order local approximation

Standard problem: nd a rst-order accurate solution in the


neighborhood of the non-stochastic steady state.

Two steps:
1. Find the non-stochastic steady state. Trivial in most models, dicult
task here.
2. Approximate the models dynamics using a Taylor expansion of the
equilibrium conditions around the steady state. Generally pretty easy,
very dicult task here.
Why is the non-stochastic steady state nontrivial?

Normally, we just back out the steady state values from the
non-stochastic versions of the equilibrium conditions.

Non-stochastic versions of (5) and (6):

R =

R

R =

R

Two linearly dependent (identical!) equations indeterminacy.

Intiution: Both assets pay same non-stochastic return, so all feasible


values of
h
and

f
are equally good.

Continuum of non-stochastic steady states. We need to gure out


which one is right.
Why are rst-order dynamics hard?

Similar problem. Linearized versions of (5) and (6):


E
t
[

R
t
] = E
t
[

t
]
E
t
[

R
t
] = E
t
[

t
]

Again, two identical equations. State-space matrix is singular.


Inderminacy.

Inuition: Both assets have same expected return. Thats all that
matters in a rst-order model, so all feasible values of
h,t
and
f ,t
are equally good.

Again, continuum of rst-order accurate dynamics. Which one is


right?
Steady state portfolios

Samuelson (1970) shows that we need to use a second-order


accurate solution to the model to solve for zero-order (steady state)
portfolios.

Nonstochastic steady state we are looking for can be thought of as


the limit of stochastic model steady states as volatility goes to zero.

Outline of strategy:
1. Find a second-order condition that is sucient to tie down steady
state.
2. Exploit some properties of this equation that allow us to use a
rst-order approximation to the non-portfolio model to evaluate
sucient condition.
3. Find a closed-form solution for the steady state.
Second-order approximation of portfolio choice equations

Dene

R
x,t
=

R
t


R

t
. Assume u(c) = c
1
/1 .

Home country:
E
t
_

R
x,t+1
+
1
2
(

R
2
t+1


R
2
t+1
) c
t+1

R
x,t+1
_
= 0

Foreign country:
E
t
_

R
x,t+1
+
1
2
(

R
2
t+1


R
2
t+1
) c

t+1

R
x,t+1
_
= 0

Add together:
E
t
_
( c
t+1
c

t+1
)

R
x,t+1
_
= 0 (7)

Notice: Only products. Only need rst-order terms to evaluate


products to second-order accuracy!
First-order approximation of budget constraint

Foreign countrys is redundant. Just need home countrys:


c c
t
+ w
t
=
1

R
x,t
+
1

w
t1
+ y y
t

Notice: Only steady state value


h
shows up. No
h,t1
.


h,t
doesnt show up in any other equations. So rst-order portfolio
dynamics dont aect rst-order behavior of c
t
, w
t
and

R
x,t
.

This means we can solve for rst-order dynamics of non-portfolio


part of model without worrying about
h,t
.
Solving for
h

Key facts:
1. Only need 1st-order accurate dynamics for ( c
t
, c

t
,

R
x,t
) to evaluate
sucient condition (7).
2. Only need to know
h
to solve for 1st-order accurate dynamics for
( c
t
, c

t
,

R
x,t
).

Need to nd
h
such that 1st-order dynamics of non-portfolio model
satisfy sucient condition (7).

Brute-force method: Guess


h
, solve for ( c
t
, c

t
,

R
x,t
), check
whether (7) is satised, update
h
as necessary.

Cleaner method: Find analytical solution.


Solving for
h

E
t
[

R
t
] = E
t
[

t
] E
t
[

R
x,t
] = 0.


R
x,t
is iid and mean zero.

Replace
1

R
x,t
in budget constraint with temporary exogenous
iid variable
t
:
c c
t
+ w
t
=
t
+
1

w
t1
+ y y
t

Solve for 1st-order non-portfolio dynamics then back out


h
.

Get laws of motion for



R
x,t
, c
D
t
= c
t
c

t
:

R
x,t
= X
1

t
+ X
2

t
c
D
t
= D
1

t
+ D
2

t
+ D
3
z
t
where z
t
= [exo states
t
, endo states
t+1
]

. X
1
, D
1
are scalars, X
2
and D
2
are 2 1 and D
3
is #z
t
1.
Solving for
h

Now substitute in identity


t
=
h

R
x,t
where
h
=
1


h
:

R
x,t
=

X
2

t
c
D
t
=

D
2

t
+ D
3
z
t
where

X
2
=
X
2
1 X
1

h

D
2
=
D
1

h
1 X
1

h
X
2
+ D
2
Solving for
h

Substitute these into (7):


E
t
_

D
2

t+1
+ D
3
z
t+1
)

X
2

t+1
_
= 0

Since
t+1
is iid and mean zero,
E
t
[

t+1
z
t+1
] = 0
E
t
[

t+1

t+1
] =

Reduces to

X
2

2
= 0
Solving for
h

Now plug in denitions of



X
2
and

D
2
:
_
X
2
1 X
1

_

_
D
1

1 X
1

X
2
+ D
2
_

Solve for :
=
_
X
2
D

2
X
1
D
1
X
2
X

1
X
2
D

And we have our answer:



h
=
First-order portfolio dynamics

Basic idea similar to solving for steady state but a lot more involved.

Samuelson again: Need a 3rd order approximation to pin down


rst-order accurate portfolio dynamics.

Strategy also similar: Find a sucient 3rd-order condition and use


2nd-order approximation to non-portfolio model to evaluate it.
Third-order approximation of portfolio choice equations

Home:
0 = E
t

R
x,t+1
+
1
2
(

R
2
t+1


R
2
t+1
) c
t+1

R
x,t+1
+
1
6
(

R
3
t+1


R
3
t+1
)

2
2
c
2
t+1

R
x,t+1


2
c
t+1
(

R
2
t+1


R
2
t+1
)

Foreign:
0 = E
t

R
x,t+1
+
1
2
(

R
2
t+1


R
2
t+1
) c

t+1

R
x,t+1
+
1
6
(

R
3
t+1


R
3
t+1
)

2
2
c
2
t+1

R
x,t+1


2
c

t+1
(

R
2
t+1


R
2
t+1
)

Sucient 3rd-order condition for 1st-order portfolio


dynamics

Subtract foreign from home to get 3rd-order sucient condition:


0 = E
t

( c
t+1
c

t+1
)

R
x,t+1
+

2
2
( c
2
t+1
c
2
t+1
)

R
x,t+1


2
( c
t+1
c

t+1
)(

R
2
t+1


R
2
t+1
)

(8)

Add them to get a condition for expected excess returns:


E
t
[

R
x,t
] = E
t

1
2
(

R
2
t+1


R
2
t+1
)
1
6
(

R
3
t+1


R
3
t+1
) +( c
t+1
+ c

t+1
)

R
x,t+1


2
2
( c
2
t+1
+ c
2
t+1
)

R
x,t+1
+

2
( c
t+1
+ c

t+1
)(

R
2
t+1


R
2
t+1
)

(9)

Note we only have products of two and three terms, so we only need
1st and 2nd-order accurate terms to evaluate them to 3rd-order
accuracy.
Second-order approximation of excess portfolio returns

2nd-order approximation of term


h,t1

R
x,t
in budget constraint:

h,t1

R
x,t

1

R
x,t
+

2
(

R
2
t+1

t+1
) +
1


h,t1

R
x,t

Similar to before, term


1


h,t1

R
x,t
is also iid and mean zero.

This is because its a product, so we only need 1st-order accurate


values for
x,t1
and

R
x,t
to evaluate it and

R
x,t
is iid and mean
zero up to 1st-order accuracy.

So the strategy is very similar to before: we will replace


1


h,t1

R
x,t
with a temporary iid mean zero exogenous variable
t
in the
budget constraint.
Solving for

We are looking for a vector that captures the law of motion for
portfolio dynamics of the form
h,t
=

z
t+1
, where
z
t+1
= [exo states
t
, endo states
t+1
]

In other words,
h,t
is function of exogenous state in period t and
the choice of tomorrows endogenous state (made in period t).

Need to nd that satises (8) for all possible states of the world.

Brute force method here is practically impossible. Fortunately, DS


save the day with another closed-form solution.
Solving for

The tensor algebra is very messy. If you really want to see it read
the paper.

To make a long story short, we rst solve for the coecients for
2nd-order laws of motion for ( c
t
, c

t
,

R
t
,

R

t
,

R
x,t
).

Then we plug these into (8) to get an equation that is homogeneous


in E
t
[z
f
t+1
] (the conditional expected value of the rst-order part of
z
t+1
).

This property implies that we only need to solve one equation to


nd rather than an uncountable number of them.

End up with closed-form solution for .


Fin

Example code on my website solves for steady state and 1st-order


dynamics in Lucas tree model used above.

Includes script based on Schmidt-Grohe and Uribe (JEDC 2004)


that uses MATLABs symbolic toolbox to analytically dierentiate
user-supplied system of nonlinear equilbrium conditions and
generates 1st and 2nd-order state-space matrices compatible with
DS code.

Let me know if you want to apply this method and need some help.

Das könnte Ihnen auch gefallen