11.09.2014 Views

Macro Theory B Dynamic Programming 1 Dynamic optimization with ...

Macro Theory B Dynamic Programming 1 Dynamic optimization with ...

Macro Theory B Dynamic Programming 1 Dynamic optimization with ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Macro</strong> <strong>Theory</strong> B<br />

<strong>Dynamic</strong> <strong>Programming</strong><br />

Ofer Setty ∗<br />

The Eitan Berglas School of Economics<br />

Tel Aviv University<br />

March 7, 2013<br />

1 <strong>Dynamic</strong> <strong>optimization</strong> <strong>with</strong> finite horizon<br />

The economy has a social planner whose horizon is finite, T.<br />

The planner’s problem is:<br />

Max {ct,kt+1 } T U(c ∑<br />

0, c 1 ...c T ) = T β t u(c t ), 0 < β < 1,<br />

t=0<br />

t=0<br />

subject to c t + k t+1 ≤ f(k t ) + (1 − δ)k t ,<br />

k 0 given,<br />

c t ≥ 0, t = 0, 1, ..., T,<br />

k t+1 ≥ 0, t = 0, 1, ..., T.<br />

We assume:<br />

∗ These notes are heavily based on the notes used by Zvi Hercowitz in Semester Bet 2010. I thank Zvi<br />

for allowing me to use those notes.<br />

1


1. Time-separability of preferences - so, for example, there are no habits or durable<br />

goods.<br />

2. u 1 (c) > 0, u 11 < 0, lim c→∞ u 1 (c) = 0, lim c→0 u 1 (c) = ∞. The latter assumption<br />

implies that c will never be zero. Hence the non-negativity constraint for consumption<br />

will never bind and can be omitted.<br />

3. f 1 (k) > 0, f 11 < 0, lim k→∞ f 1 (k) = 0, lim k→0 f 1 (k) = ∞. The latter assumption<br />

implies that k t > 0, t = 1, ...T, and hence the restriction for t = 1, ..T − 1 can be omitted.<br />

However, we still need the restriction k T +1 ≥ 0, otherwise, the planner will let k T +1 go to<br />

−∞. We expect k T +1 to be 0.<br />

4. There are no financial assets, only physical investment. This corresponds to a<br />

planning problem in a closed economy.<br />

The Lagrangian function is:<br />

∑<br />

L = T β t {u(c t ) + λ t [f(k t ) + (1 − δ)k t − c t − k t+1 ]} + µ T β T k T +1 ,<br />

t=0<br />

See below for the interpretation of µ T .<br />

The first-order conditions are:<br />

∂L<br />

= β t [u 1 (c t ) − λ t ] = 0,<br />

∂c t<br />

t = 0, 1, ..., T, (1)<br />

∂L<br />

= −β t λ t + β t+1 λ t+1 [f 1 (k t+1 ) + 1 − δ] = 0,<br />

∂k t+1<br />

t = 0, 1..., T − 1, (2)<br />

∂L<br />

= β T (−λ T + µ<br />

∂k T ) = 0.<br />

T +1<br />

(3)<br />

Optimality conditions formulated as Kuhn-Tucker conditions. These are a generalization<br />

of the Lagrange multipliers method for nonlinear restrictions which may not bind.<br />

2


The Kuhn-Tucker conditions are the conditions above plus:<br />

λ t [f(k t ) + (1 − δ)k t − c t − k t+1 ] = 0, t = 0, 1, ..., T,<br />

λ t ≥ 0, t = 0, 1, ..., T,<br />

µ T β T k T +1 = 0,<br />

µ T ≥ 0.<br />

Discussion of the solution: Given that<br />

u 1 (c t ) > 0, t = 0, 1, ..., T,<br />

λ t > 0,<br />

t = 0, 1, ..., T<br />

from (1). This implies two things: (1) the resource constraints bind at all times, and (2)<br />

from (3), µ T > 0, which in turn implies that k T +1 = 0. Using (1) and (2), and replacing<br />

(1) into (2), the dynamic behavior is the solution to the system<br />

0 = −u 1 (f(k t ) + (1 − δ)k t − k t+1 )<br />

+ βu 1 (f(k t+1 ) + (1 − δ)k t+1 − k t+2 ) [f 1 (k t+1 ) + 1 − δ] ,<br />

for t = 0, 1, ..., T − 1,<br />

k 0 = given,<br />

0 = β T µ T k T +1<br />

The first is called the “Euler Equation,”the second is the initial condition, and the third<br />

is the “transversality”condition, or final condition.<br />

3


Interpretation of µ T : In general the constraint would be:<br />

k T +1 − χ ≥ 0, χ ≥ 0.<br />

Hence, µ T represents the marginal utility of lowering χ. I.e., how much we lose if we are<br />

required to leave some capital behind.<br />

The system is a second-order difference equation in k. These are T + 2 equations<br />

<strong>with</strong> T + 2 unknowns: k 0 , k 1 , ...k T +1 . The two equations for the initial and the terminal<br />

conditions directly solve for 2 of the unknowns, remaining the T Euler equations <strong>with</strong> T<br />

unknowns.<br />

Interpretation of the Euler equation:<br />

u 1 (c t ) = βu 1 (c t+1 ) [f 1 (k t+1 ) + 1 − δ] .<br />

Marginal utility cost of investment– in terms of forgone utility from consumption– equals<br />

discounted value of the physical return next period translated in utility terms.<br />

2 <strong>Dynamic</strong> <strong>optimization</strong> <strong>with</strong> infinite horizon<br />

The main reason for considering the infinite horizon is intergenerational altruism: parents<br />

care about their children, and know that they will care about their children, and so on.<br />

Max {ct,kt+1 } ∞ = ∑ ∞ β t u(c<br />

t=0 t ), 0 < β < 1,<br />

t=0<br />

subject to c t + k t+1 ≤ f(k t ) + (1 − δ)k t ,<br />

k 0 given,<br />

lim<br />

T →∞ βT u 1 (c T )k T = 0.<br />

4


The last equation is the “transversality condition”; a counterpart to the final condition<br />

in the finite-horizon case. In that case the final condition was β T u 1 (c T ) k T +1 = 0.<br />

The solution to the problem is the decision rule<br />

k t+1 = g (k t ) ,<br />

An optimal decision rule is a mapping of a state to decisions that maximizes some function.<br />

I.e., the optimal choice for any possible value of the state.<br />

We need to compute g(·) which solves the <strong>optimization</strong> problem.<br />

The Euler equation, as seen previously, is<br />

−u 1 (f (k) + (1 − δ)k − k ′ ) + βu 1 (f (k ′ ) + (1 − δ)k ′ − k ′′ ) (f 1 (k ′ ) + (1 − δ)) = 0.<br />

A prime indicates one period ahead, and a double prime two periods ahead.<br />

As mentioned earlier, this is a second order non-linear difference equation in k. Because<br />

of the infinite number of periods, the solution method used previously, solution of a set<br />

of equations <strong>with</strong> an equal number of unknowns, is not applicable now. Here, we solve<br />

the problem using a <strong>Dynamic</strong> <strong>Programming</strong> procedure.<br />

2.1 The Bellman equation<br />

Solution of the problem (decision rule):<br />

k ′ = g (k) .<br />

Infinite-horizon <strong>Dynamic</strong> <strong>Programming</strong> logic:<br />

First, because of the infinite horizon, the planning horizon is constant over time, and<br />

5


hence the decision rule is also constant over time. In particular, the decision rule this<br />

period is the same as the decision rule next period.<br />

Second. The feature above turns the dynamic problem– where the current decision<br />

depends on the future decision– into a functional equation in one functional unknown.<br />

Define the “value”function V (·) as the solution to our problem given the initial condition:<br />

∞∑<br />

V (k 0 ) = Max β t u(f(k t ) + (1 − δ)k t − k t+1 ).<br />

t=0<br />

The Bellman (Richard E.Bellman (1920—1984)) functional equation is<br />

V (k) = Max k ′ [u(f (k) + (1 − δ)k − k ′ ) + βV (k ′ )] . (4)<br />

V (k) is the solution to this equation. The first-order condition is:<br />

− u 1 (f (k) + (1 − δ)k − k ′ ) + βV 1 (k ′ ) = 0. (5)<br />

This equation is implicitly k ′ = g (k) . If we knew the function V we could solve for g.<br />

The only problem is that we’ll know V only when the problem is solved.<br />

Note that V (k 0 ) is the value function and that V (k) = Max k ′ [u(f (k) + (1 − δ)k − k ′ ) + βV (k ′ )]<br />

is the Bellman equation. Do not mix the two.<br />

2.2 The Envelope theorem and first order conditions<br />

Note that (5) should be identical to the original Euler equation. This can be shown as<br />

follows:<br />

Given (4), (the envelope theorem), V 1 (k) becomes<br />

V 1 (k) = u 1 (c) [f 1 (k) + (1 − δ)]<br />

6


Iterating forward and substituting into (5) yields:<br />

−u 1 (c) + βu 1 (c ′ ) [f 1 (k ′ ) + (1 − δ)] = 0,<br />

which is the Euler equation in the original form.<br />

2.3 Solution methods<br />

2.3.1 Value function iteration<br />

If we have no educated guess for the functional form of the value function then we start<br />

<strong>with</strong> any value. Under some regularity conditions a contraction mapping is guaranteed<br />

and we will end up <strong>with</strong> the optimal value.<br />

Practically, to solve the functional equation we conjecture a form for the function<br />

V (k), say V 1 (k), compute V 1<br />

1 (k ′ ), substitute into (5)<br />

This is one equation in k ′ . The solution:<br />

−u 1 (f (k) + (1 − δ)k − k ′ ) + βV 1<br />

1 (k ′ ) = 0<br />

k ′ = g 1 (k) .<br />

Substitute this into the Bellman equation to get the resulting value function:<br />

V 2 (k) = u(f (k) + (1 − δ)k − g 1 (k)) + βV 1 (g 1 (k)).<br />

If V 1 = V 2 , done. Otherwise, numerical methods can be used to approximate V by<br />

successive iterations until convergence. Note that convergence of V involves convergence<br />

of g.<br />

7


This example <strong>with</strong> δ = 1, f (k) = k a and u (c) = ln c can be actually solved by hand.<br />

V (k) = Max k ′ [ln(k a − k ′ ) + βV (k ′ )] . (6)<br />

Guess : V 1 (k) = 0. In this case choose optimally k ′ = 0. Then:<br />

V (k) = ln(k a ) = α ln (k) (7)<br />

Therefore: V 2 (k) = α ln (k) .<br />

V (k) = Max k ′ [ln(k a − k ′ ) + βα ln (k ′ )] . (8)<br />

The FOC is:<br />

1<br />

= βα<br />

k a − k ′ k ′<br />

k ′ = βαk a − βαk ′<br />

k ′ =<br />

βα<br />

1 + βα ka<br />

V 3 (k) = ln(k a − k ′ ) + βα ln (k ′ )<br />

= ln(k a − βα<br />

( ) βα<br />

1 + βα ka ) + βα ln<br />

1 + βα ka<br />

(<br />

= ln (k a ) + ln 1 − βα )<br />

( ) βα<br />

+ βα ln (k a ) + βα ln<br />

1 + βα<br />

1 + βα<br />

( ) ( )<br />

1<br />

βα<br />

= α (1 + αβ) ln (k) + ln + βα ln<br />

1 + βα<br />

1 + βα<br />

(9)<br />

Continue till:<br />

V (k) =<br />

α<br />

1 αβ<br />

1<br />

ln (k) + ln (αβ) + ln (1 − αβ) (10)<br />

1 − αβ 1 − β 1 − αβ 1 − β<br />

8


2.3.2 Guess and verify<br />

Since we already know the solution we will guess the functional form and find the parameters:<br />

V (k) = E + F ln (k)<br />

V (k) = Max k ′ [ln(k a − k ′ ) + β (E + F ln (k ′ ))]<br />

From the FOC:<br />

k ′ =<br />

βF ka<br />

1 + βF<br />

Substitute into the Bellman equation to get:<br />

F =<br />

E =<br />

α<br />

1 − βα<br />

αβ<br />

ln (1 − βα) + ln (αβ)<br />

1−βα<br />

1 − β<br />

2.3.3 Policy function iteration (Euler equation solution)<br />

The Euler equation can be written as<br />

u 1 (f (k) + (1 − δ)k − k ′ ) = βu 1 (f (k ′ ) + (1 − δ)k ′ − g (k ′ )) [f 1 (k ′ ) + (1 − δ)] ,<br />

which also an implicitly k ′ = g (k) . It also can be expressed as functional equation in g(.),<br />

similarly as the Bellman equation is in V (.):<br />

u 1 (f (k) + (1 − δ)k − g (k)) = βu 1 (f (k ′ ) + (1 − δ)k ′ − g (k ′ )) [f 1 (k ′ ) + (1 − δ)] .<br />

9


Practically, we conjecture the solution g 1 (k):<br />

u 1 (f (k) + (1 − δ)k − k ′ ) = βu 1<br />

(<br />

f (k ′ ) + (1 − δ)k ′ − g 1 (k ′ ) ) [f 1 (k ′ ) + (1 − δ)]<br />

This is one equation in k ′ . The solution is:<br />

k ′ = g 2 (k)<br />

If g 1 = g 2 , done. Otherwise, numerical methods can be used to approximate g by successive<br />

iterations until convergence.<br />

2.3.4 Euler-equation linearization<br />

The <strong>Dynamic</strong> <strong>Programming</strong> procedures above yield closed-form solutions for the value<br />

function and the decision rule only in a few special cases (one of these comes later). In<br />

general, there is no exact solution, and the solution is an approximation. One type of<br />

approximation is discretizing the state space and iterating numerically. Another one can<br />

be done by approximating the equations. Such approximation is obtained by:<br />

1. Linearization of the FOCs. This amounts to treating second derivatives as constant<br />

(third derivatives are assumed to be zero). This procedure is good for a range around<br />

steady state for which linearity of first derivatives is reasonable.<br />

2. Application of the DP method to the linearized model.<br />

The model is linearized around the steady state. Hence, the first step is to compute<br />

the steady state. The Euler equation and the resource constraint in this case have the<br />

form:<br />

10


1<br />

β = f 1 (k ∗ ) + 1 − δ,<br />

c ∗ = f (k ∗ ) − δk ∗ .<br />

Notes<br />

• Around the steady state c t = c t+1 = c ∗ , and similarly k t = k t+1 = k ∗ .<br />

• The first equation is implied by the Euler equation. We know that if βR = 1 then<br />

consumption is constant. Here we go in the opposite direction.<br />

These are two equations for k ∗ and c ∗ . Let’s define:<br />

u 1 ≡ u 1 (c ∗ ),<br />

u 11 ≡ u 11 (c ∗ ),<br />

f 1 ≡ f 1 (k ∗ ),<br />

f 11 ≡ f 11 (k ∗ ).<br />

We turn now to the linearization around the steady state of<br />

u 1 (c) − βu 1 (c ′ ) [f 1 (k ′ ) + (1 − δ)] = 0<br />

c = f (k) + (1 − δ)k − k ′<br />

c ′ = f (k ′ ) + (1 − δ)k ′ − k ′′<br />

Using the first order Taylor expansion, the FOC can be written as:<br />

11


u 11 dc − β [u 11 dc ′ (f 1 + 1 − δ) + u 1 f 11 dk ′ ] = 0, or<br />

u 11 dc − u 11 dc ′ − βu 1 f 11 dk ′ = 0,<br />

Using the same methodology, the resource constraint is:<br />

dc = (f 1 + 1 − δ) dk − dk ′ = 1 β dk − dk′ ,<br />

The resource constraint iterated forward is:<br />

dc ′ = (f 1 + 1 − δ) dk ′ − dk ′′ = 1 β dk′ − dk ′′ .<br />

Substituting dc, dc ′ into the Euler equation yields:<br />

(<br />

1<br />

u 11<br />

β dk − u 11 1 + 1 β + β u )<br />

1<br />

f 11 dk ′ + u 11 dk ′′ = 0,<br />

u 11<br />

where we used (β(f 1 + 1 − δ) = 1) .<br />

Dividing through by u 11 k, and defining ˆx ≡ dx/x :<br />

(<br />

1<br />

β ˆk − 1 + 1 β + β u )<br />

1<br />

f 11<br />

ˆk ′ +<br />

u ˆk ′′ = 0. (11)<br />

11<br />

As the original non-linear equation, this is a second-order difference equation in k.<br />

The procedure is to solve it by the method of undetermined coeffi cients, subject to the<br />

transversality condition.<br />

12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!