Dynamic Optimization
Dynamic Optimization
Dynamic Optimization
short version
SAKAMOTO, Eiji1
1 I’m grateful to all the past lecturers for sharing their slides. All errors are my own.
1 / 61
Before start
Introduction
1 / 61
Before the class
Introduction (myself)
1st year student of Doctoral degree in UTGSE
research topics: macroeconomics (Political Economics, Financial Crisis,
Econometrics, and so on...).
I was a TA for Core Econometrics II and Core Macro 1.
If you have a question, please speak up, or send email to me.
my address: [Link](at)[Link]
If you want to talk with me in person, please come to my lab after
sending me an email.
715, 7F, International Academic Research Building
2 / 61
Message
3 / 61
Before start
Introduction
3 / 61
Introduction
4 / 61
Motivating Example 1
5 / 61
Motivating Example 1
This problem is written as
s.t. x0 + x1 = w0 , xt ≥ 0 (t = 0, 1)
6 / 61
Motivating Example 1
This problem is written as
s.t. x0 + x1 = w0 , xt ≥ 0 (t = 0, 1)
6 / 61
Motivating Example 1
What does 1/x (or u′ (x)) in (∗) mean economically?
Consider a linear approximation2 of log x (or u(x)) around x = X.
1
log x ≈ log X + (x − X)
X
(or u(x) ≈ u(X) + u′ (X)(x − X))
Let x = X + 1.
1
log (X + 1) − log X ≈
X
(or u(X + 1) − u(X) ≈ u′ (X))
2 Recall Taylor expansion learned in the Day 1! This is so called 1st order Taylor
expansion around X.
7 / 61
Motivating Example 1
Suppose you try to increase the amount of cake slightly at date 0, then the
equation (∗) says
marginal utility gain today 1/x0 (= u′ (x0 ))
=
discounted marginal utility cost tomorrow β × 1/x1 (= βu′ (x1 ))
Therefore, at the optimum, the benefit and cost of a marginal change in the
amount of cakes are balanced.
8 / 61
Lesson from this example
One’s decision about today’s action affects her utility tomorrow, and
thus,
decision maker faces a trade-off b/w today’s & future payoff.
Many economic problems have this dynamic nature:
Households decide how much to consume today and how much to save
for the future.
If a worker accepts a job offer and start working today, she loses
chances to get a better job in the future.
But there are many economic situations which we cannot describe only
with two-period model.
Therefore, it is important to study the ways to solve general dynamic
optimization problems!
9 / 61
Today’s Contents
10 / 61
Today’s Contents
Today’s goal:
1. Understand how to solve Dynamic Optimization in discrete time.
2. Especially, study a new approach: Dynamic Programming (DP)
Why DP?
1. Easy to solve (in some sense)
2. Because DP is everywhere!
▶ Micro: Repeated Games, Decision Theory
▶ Macro: Growth, Asset Pricing, DSGE model
▶ Metrics: Structural Estimation
11 / 61
Useful References
12 / 61
Before start
Introduction
12 / 61
Dynamic Optimization in Discrete Time
13 / 61
How to Solve the Problem?
14 / 61
Before start
Introduction
14 / 61
Classical Approach
1. Set up the Lagrangian L:
∞
X
L := β t {u(ct ) + λt [f (kt ) − kt+1 − ct ]}
t=0
∂L
= β t [u′ (ct ) − λt ] = 0
∂ct
∂L
= β t [−λt + βλt+1 f ′ (kt+1 )] = 0
∂kt+1
15 / 61
Euler Equation
Intuition:
The Euler equation describes the optimal relation between any two
periods (remember the cake example!).
LHS u′ (ct ) : marginal utility loss of increasing saving today
RHS βu′ (ct+1 ) : discounted marginal utility gain
× f ′ (kt+1 ) : marginal income gain tomorrow due to saving
That is, the benefit and cost of a marginal change in consumption and
saving are balanced at the optimum !
16 / 61
Transversality Condition
17 / 61
Transversality Condition
18 / 61
Classical Approach
19 / 61
Exercise
Revisit the cake-eating problem, but now, consider an infinite time horizon
case: t = 0, 1, 2, · · · .
You have w0 cake at period 0.
Flow utility is given by u(x) := ln x and future utility is discounted by β.
Of course, the amount of cake is always non-negative.
Questions.
1. Formulate sequential problem.
2. Set up Lagrangian
3. Derive Euler equation
4. Solve EE with respect to xt given x0
5. Solve the budget constraint with respect to wt given x0
6. Find one x0 to satisfy TVC
7. Solve xt and wt only with t, β, and w0
20 / 61
Solution Example I
1. Formulate sequential problem.
∞
X
max β t ln(xt )
{xt }t=0 ,{wt+1 }∞
∞
t=0
t=0
s.t. wt+1 = wt − xt , xt ≥ 0, wt+1 ≥ 0 (t = 0, 1, · · · )
w0 ; given
2. Set up Lagrangian
∞
X
L := β t {ln(xt ) + λt [wt+1 − wt + xt ]}
t=0
21 / 61
Solution Example II
4. Solve EE with respect to xt given x0
xt = β t x0
wt+1 = wt − β t x0
1 1
∴ wt = w0 − x0 + β t x0
1−β 1−β
22 / 61
Solution Example III
xt = β t (1 − β)w0
wt = β t w0
23 / 61
Before start
Introduction
23 / 61
Introduction to Dynamic Programming
24 / 61
re:Sequential problem
25 / 61
Recursive Structure
∞
X
v (k0 ) = max β t u (f (kt ) − kt+1 )
{kt+1 }∞ ,k
t=0 0
given t=0
∞
( " #)
X
t−1
= max u (f (k0 ) − k1 ) + β max β u (f (kt ) − kt+1 )
k1 {kt+1 }∞ ,k
t=1 1
given t=1
It looks much easier, because you should choose only one variable k1 !
but now, we don’t know a form of function w...
26 / 61
What ’solving the recursive problem’ means
In sequential problem, the way to solve is to find infinite sequence.
Here, the problem is recursive.
27 / 61
Terminology of Recursive Formulation
The equation (1) is called functional equation (FE) or, Bellman
equation:
28 / 61
Terminology of Recursive Formulation
The equation (1) is called functional equation (FE) or, Bellman
equation:
28 / 61
Before start
Introduction
28 / 61
General Form
Before formal discussions, we generalize both SP and FE:
Sequential Problem (SP)
∞
X
w(x0 ) = max∞ β t F (xt , xt+1 )
{xt+1 }t=0
t=0
s.t. xt+1 ∈ Γ(xt ) (t = 0, 1, · · · ), x0 ∈ X; given
29 / 61
Relation between SP & FE
What you derive is completely different:
in SP optimal infinite sequence {x∗t+1 }∞
t=0
Intuition of solution:
in SP you choose a time path, or schedule of the amount of cake you eat
from today to the future, given the initial condition.
in FE you choose an optimal strategy of cake-eating: for any given amount of
cake, how much you eat today and save the rest.
30 / 61
Questions about FE
31 / 61
Principle of Optimality
32 / 61
Existence & Uniqueness of solution to FE
33 / 61
Before start
Introduction
33 / 61
Contraction Mapping
∀x, y ∈ S d (T x, T y) ≤ βd (x, y) .
34 / 61
Contraction Mapping Theorem
35 / 61
Metric Space
36 / 61
Convergence of Sequences
Def. Convergence of sequences
Let (S, d) be a metric space. A sequence {xn }∞
n=1 in S converges to x ∈ S if for
every ε > 0, there exists a natural number N = N (ε) such that n ≥ N (ε) implies
d(xn , x) < ε. In this case, we write limn→∞ xn = x or xn → x as n → ∞
A sequence that converges to some point is called convergent.
Def. Cauchy sequences
Let (S, d) be a metric space. A sequence {xn }∞ n=1 in S is a Cauchy sequence in
(S, d), if for every ε > 0, there exists a natural number M = M (ε) such that
n, m ≥ M (ε) imply d(xn , xm ) < ε.
Intuitively, if we choose sufficiently large n and m, the distance b/w two
points xn and xm can be arbitrary small.
A convergent is always a Cauchy, but the converse does not hold.
(e.g.) Let S = (0, 1] and d1 (x, y) = |x − y| for x, y ∈ S. Consider a
sequence {1/n}n∈N . This is a Cauchy sequence, but does not converge to
any point in S.
37 / 61
Complete Metric Spaces
Def. Completeness
A metric space (S, d) is complete if every Cauchy sequence in S is
convergent.
The significance of completeness is that when searching for the solution
to a problem, it sometimes is the case that we are able to construct a
Cauchy sequence whose limit would be a solution if it actually exists.
In a complete metric space, we can be sure that our solution does exist
as a well-defined element of the space.
38 / 61
Contraction Mapping
∀x, y ∈ S d (T x, T y) ≤ βd (x, y) .
39 / 61
Fixed Point
40 / 61
Contraction Mapping Theorem
41 / 61
CMT to FE
42 / 61
CMT to FE
43 / 61
Blackwell’s Sufficient Conditions
44 / 61
CMT to FE
45 / 61
Property of value function
Thm. Envelope theorem (Benveniste & Scheinkman thm)
Let (X, F, β, Γ) satisfy technical conditions and let v be the unique fixed
point of T (= solution to FE) and g the associated policy function.
If x0 ∈ int(X) and g(x0 ) ∈ int(Γ(x0 )), then v is continuously differentiable
at x0 with derivatives given by
46 / 61
Property of value function
proof.
Consider
v(x) = max (F (x, y) + βv(y))
y
Now, let k = kt , g(k) = kt+1 and f (k) − g(k) = ct , then above equations
are
u′ (ct ) = βv ′ (kt+1 )
v ′ (kt+1 ) = u′ (ct+1 )f ′ (kt+1 )
48 / 61
Before start
Introduction
48 / 61
How to solve FE?
49 / 61
How to Solve FE?
50 / 61
Guess & Verify
Consider a cake-eating problem:
ln w′ − w + βv(w′ )
v(w) = max
′
0≤w ≤w
1. Guess the value function as v(w) = A + B ln w with some constant A, B.
2. solve the maximization in the RHS given this guess:
ln w − w′ + β(A + B ln w′ )
max
′
0≤w ≤w
51 / 61
Guess & Verify
Finally, we obtain the value function and the optimal policy function as
follows:
v(w) = A + B ln w
ln(1 − β) β ln β 1
= + + ln w
1−β (1 − β)2 1−β
βB
w′ = g(w) = w
1 + βB
= βw
Exercise: Derive the value function and associated policy function for the
following FE using Guess & Verify of value function:
52 / 61
Solution Example
53 / 61
Value Function Iteration
54 / 61
Value Function Iteration
Example: Suppose we start from a zero function as an initial guess
(v0 (k) = 0)
v1 (k) is given by
v1 (k) = ln(k α − 0) = α ln k
v2 (k) is given by
55 / 61
56 / 61
Review Questions
57 / 61
Exercise
Consider the following sequential problem:
∞
X
max β t ln(ct )
{ct }t=0 ,{kt+1 }∞
∞
t=0
t=0
s.t. kt+1 = A1−α ktα − ct , ct ≥ 0, kt+1 ≥ 0 (t = 0, 1, · · · )
k0 , A > 0; given
Qestions.
1. Set up the recursive formulation of this problem.
2. Derive the Euler equation.
3. Derive the policy function using ”Guess & Verify” of the policy
function.
*Hint for (3): Guess the functional form of the policy function and verify it
satisfies the Euler equation. A natural candidate of the guess is
c = h(k) = γA1−α kα and k′ = g(k) = δA1−α kα for some constants γ, δ > 0.
58 / 61
Solution Example
1. Set up the recursive formulation:
ln A1−α kα − k′ + βv(k′ )
v(k) = max
0≤k′ ≤A1−α kα
2. FOC w.r.t. k′ is
1
= βv ′ (k′ )
A1−α kα − k′
Evaluate k′ at g(k) and apply the envelope theorem:
αA1−α g(k)α−1
v ′ (g(k)) =
− g(g(k))
A1−α g(k)α
Note that the optimal consumption is c = h(k) = A1−α kα − g(k). Thus,
combining above equations, we obtain
1 αβA1−α g(k)α−1
=
h(k) h(g(k))
or, under the notations of SP;
α−1
1 αβA1−α kt+1
=
ct ct+1
(where, kt = k, kt+1 = g(k), ct = h(k), ct+1 = h(g(k)).)
59 / 61
Solution Example (cont’d)
3. Guess the policy functions of consumption and saving as
h(k) = γA1−α kα , g(k) = δA1−α kα for some constants γ, δ > 0.
(1) Given the guess and the resource constraint, we have δ = 1 − γ.
(2) Substitute the guess into the Euler equation:
1 αβA1−α g(k)α−1
=
γA1−α kα γA1−α g(k)α
αβ
=
γg(k)
αβ
=
γ(1 − γ)A1−α kα
(3) By comparing the coefficients, we have
γ(1 − γ)
γ=
αβ
∴ γ = 1 − αβ
Therefore, the policy functions are
c = h(k) = (1 − αβ)A1−α kα , k′ = g(k) = αβA1−α kα
60 / 61
Final Message
61 / 61