A Child's Guide to Optimal Control Theory

10
ECON7020: MACROECONOMIC THEORY I Martin Boileau A CHILD'S GUIDE TO OPTIMAL CONTROL THEORY 1. Introduction This is a simple guide to optimal control theory. In what follows, I borrow freely from Kamien and Shwartz (1981) and King (1986). 2. The Finite Horizon Problem Optimal control theory is useful to solve continuous time optimization problems of the following form: max Z T 0 F (x(t); u(t);t) dt (P ) subject to _ x i = Q i (x(t); u(t);t); i =1;:::;n; (1) x i (0) = x i0 ; i =1;:::;n; (2) x i (T ) ¸ 0; i =1;:::;n; (3) u(t) 2 ¨; ¨ 2 IR m : (4) where, x(t) is a n-vector of state variables (x i (t)). These describes the state of the system at any point in time. Also, note that dx i =dt =_ x i . u(t) is a m-vector of control variables. These are the choice variables in the optimization problem. F (¢) is a twice continuously di®erentiable objective function. Throughout, we assume that this function is time additive. Q i (¢) are twice continuously di®erentiable transition functions for each state variable. 1

Transcript of A Child's Guide to Optimal Control Theory

Page 1: A Child's Guide to Optimal Control Theory

ECON7020: MACROECONOMIC THEORY I Martin Boileau

A CHILD'S GUIDE TO OPTIMAL CONTROL THEORY

1. Introduction

This is a simple guide to optimal control theory. In what follows, I borrow freely from

Kamien and Shwartz (1981) and King (1986).

2. The Finite Horizon Problem

Optimal control theory is useful to solve continuous time optimization problems of the

following form:

max

Z T

0

F (x(t);u(t); t) dt (P )

subject to

_xi = Qi(x(t);u(t); t); i = 1; : : : ; n; (1)

xi(0) = xi0; i = 1; : : : ; n; (2)

xi(T ) ¸ 0; i = 1; : : : ; n; (3)

u(t) 2 ¨; ¨ 2 IRm: (4)

where,

x(t) is a n-vector of state variables (xi(t)). These describes the state of the system at any

point in time. Also, note that dxi=dt = _xi.

u(t) is a m-vector of control variables. These are the choice variables in the optimization

problem.

F (¢) is a twice continuously di®erentiable objective function. Throughout, we assume that

this function is time additive.

Qi(¢) are twice continuously di®erentiable transition functions for each state variable.

1

Page 2: A Child's Guide to Optimal Control Theory

The di®erent constraints are:

i. Equation (1) de¯nes the transition equations for each state variables. It describes how

the state variables evolve over time.

ii. Equation (2) show the initial conditions for each state variable. In this, xi0 are

constants.

iii. Equation (3) show the terminal conditions for each state variable.

iv. Equation (4) de¯nes the feasible set for control variables.

We can now discuss the Pontryagin maximum principle. This principle says that we

can solve the optimization problem P using a Hamiltonian function H over one period. A

version of the Theorem is (see Kamien and Schwartz):

Theorem In order that x¤(t), u¤(t) be optimal for the problem P , it is necessary that

there exist a constant ¸0 and continuous functions ¤(t) = (¸1(t); : : : ; ¸n(t) ), where for all

0 · t · T we have ¸0 6= 0 and ¤(t) 6= 0 such that for every 0 · t · T

H (x¤(t);u;¤(t); t) · H (x¤(t);u¤(t);¤(t); t) ;

where the Hamiltonian function H is de¯ned by

H (x;u;¤; t) = ¸0F (x;u; t) +nX

i=1

¸iQi(x;u; t):

Except at points of discontinuity of u¤t ,

@H(¢)@xi

= ¡ _̧i(t); i = 1; : : : ; n:

Furthermore, ¸0 = 0 or ¸0 = 1 and, ¯nally, the following transversality conditions are

satis¯ed:

¸i(T ) ¸ 0; ¸i(T )x¤i (T ) = 0; i = 1; : : : ; n:

3. The Present Value Hamiltonian

The previous theorem suggests that one can solve problem P by simply setting up the

following present value Hamiltonian:

H (x;u;¤; t) = F (x;u; t) +nX

i=1

¸iQi(x;u; t):

2

Page 3: A Child's Guide to Optimal Control Theory

In the above, we call ¸i(t) co-state variables. They are analogous to Lagrange multipliers.

The necessary conditions for a maximum are:

@H(¢)@uk

= 0; k = 1; : : : ; m;

@H(¢)@xi

= ¡ _̧i(t); i = 1; : : : ; n;

¸i(T ) ¸ 0; ¸i(T )x¤i (T ) = 0; i = 1; : : : ; n:

The su±cient conditions for a maximum are that the Hamiltonian function be concave in

x and u.

Finally, in some cases, our optimization problem will also include other constraints:

max

Z T

0

F (x(t);u(t); t) dt (P1)

subject to_xi = Qi(x(t);u(t); t); i = 1; : : : ; n;

Gj(x(t);u(t); t) ¸ 0; j = 1; : : : ; q;

xi(0) = xi0; i = 1; : : : ; n;

xi(T ) ¸ 0; i = 1; : : : ; n;

u(t) 2 ¨; ¨ 2 IRm:

In that case, we can write problem P1 as a Lagrangian:

L(x;u;¤; ©; t) = H(x;u;¤; t) +

qX

j=1

ÁjGj(x;u; t)

= F (x;u; t) +nX

i=1

¸iQi(x;u; t) +

qX

j=1

ÁjGj(x;u; t);

where © = (Á1; : : : ; Áq ). In this case, the necessary conditions for a maximum are:

@L(¢)@uk

= 0; k = 1; : : : ;m;

@L(¢)@xi

= ¡ _̧i(t); i = 1; : : : ; n;

¸i(T ) ¸ 0; ¸i(T )x¤i (T ) = 0; i = 1; : : : ; n:

Áj(t) ¸ 0; Áj(t)Q(x(t);u(t); t) = 0; j = 1; : : : ; q:

The su±cient conditions are as before.

3

Page 4: A Child's Guide to Optimal Control Theory

4. An Economic Example

Consider the following problem:

max

Z T

0

e¡½tu (c(t)) dt

subject to_a(t) = ra(t) ¡ c(t);

a(0) = a0;

a(T ) ¸ aT :

The present value Hamiltonian is

H(a; c; ¸; t) = e¡½tu (c) + ¸ [ra ¡ c] :

The ¯rst-order conditions are

@H

@c= 0 =) e¡½tu0 (c(t)) ¡ ¸(t) = 0;

@H

@a= ¡ _̧ (t) =) ¸(t)r = ¡ _̧ (t);

¸(T ) ¸ 0; ¸(T )a(T ) = 0:

A simple interpretation of these ¯rst-order conditions is to relate the growth rate of

consumption, gc(t), to the elasticity of intertemporal substitution, ¾(c(t)), and the market

and subjective discount rates, r and ½. To do this, ¯rst note that

_̧ (t) = ¡r¸(t) = ¡re¡½tu0(c(t)):

Then, totally di®erentiating the ¯rst ¯rst-order condition yields

¡½e¡½tu0 (c(t)) + e¡½tu00 (c(t)) _c(t) ¡ _̧ (t) = 0:

De¯ne the growth rate of consumption as gc = (1=c)dc=dt:

gc(t) =_c(t)

c(t)= ¡(r ¡ ½)

u0(c(t))c(t)u00(c(t))

;

such that

gc(t) = ¾(c(t))(r ¡ ½);

where ¾(c(t)) = ¡u0(c(t))=[c(t)u00(c(t))] > 0. Thus, consumption grows whenever the

market discount rate is larger than the subjective discount rate. In that case, the consumer

is less impatient than the market.

4

Page 5: A Child's Guide to Optimal Control Theory

5. The In¯nite Horizon Problem

In this section we consider an extension of the ¯nite horizon problem to the case of in¯nite

horizon. To simplify the exposition, we will focus our attention to stationary problems.

The assumption of stationarity implies that the main functions of the problem are

time invariant:F (x(t);u(t); t) = F (x(t);u(t));

Gi(x(t);u(t); t) = Gi(x(t);u(t));

Qj(x(t);u(t); t) = Qj(x(t);u(t)):

In general, to obtain an interior solution to our optimization problem, we require the

objective function to be bounded away from in¯nity. One way to achieve boundedness is

to assume discounting. However, the existence of a discount factor is neither necessary nor

su±cient to ensure boundedness. Thus, we de¯ne

F (x(t);u(t)) = e¡½tf(x(t);u(t)):

Our general problem becomes:

max

Z 1

0

e¡½tf (x(t);u(t)) dt (P2)

subject to

_xi = Qi(x(t);u(t)); i = 1; : : : ; n; (1)

Gj(x(t);u(t)) ¸ 0; j = 1; : : : ; q;

xi(0) = xi0; i = 1; : : : ; n; (2)

The present value Hamiltonian is

H (x;u;¤) = e¡½tf(x;u) +nX

i=1

¸iQi(x;u):

The Lagrangian is

L(x;u;¤;©) = e¡½tf(x;u) +nX

i=1

¸iQi(x;u) +

qX

j=1

ÁjGj(x;u):

The ¯rst-order conditions are:

@L(¢)@uk

= 0; k = 1; : : : ;m;

@L(¢)@xi

= ¡ _̧i(t); i = 1; : : : ; n;

limT!1

¸i(T ) ¸ 0; limT!1

¸i(T )x¤i (T ) = 0; i = 1; : : : ; n:

Áj(t) ¸ 0; Áj(t)Q(x(t);u(t)) = 0; j = 1; : : : ; q:

5

Page 6: A Child's Guide to Optimal Control Theory

The su±cient conditions are as before.

6. The Current Value Hamiltonian

Any discounted optimal control problem can be solved using both a present value Hamil-

tonian or a current value Hamiltonian. We sometime prefer the current value Hamiltonian

for its simplicity.

We obtain the current value Hamiltonian as follows:

H(x;u; ª) = e½tH(x;u;¤);

where Ãi = e½t¸i. The current value Hamiltonian is thus

H (x;u; ª) = f(x;u) +nX

i=1

ÃiQi(x;u):

The transformation from present value to current value a®ects the ¯rst-order condi-

tions. To see this, let us restate our problem P2 using the current value Hamiltonian. The

problem is

max

Z 1

0

e¡½tf (x(t);u(t)) dt (P2)

subject to

_xi = Qi(x(t);u(t)); i = 1; : : : ; n; (1)

Gj(x;u) ¸ 0; j = 1; : : : ; q;

xi(0) = xi0; i = 1; : : : ; n; (2)

The current value Hamiltonian is

H (x;u; ª) = f(x;u) +nX

i=1

ÃiQi(x;u):

The Lagrangian is

L(x;u;ª; ©) = f(x;u) +nX

i=1

ÃiQi(x;u) +

qX

j=1

ÁjGj(x;u):

6

Page 7: A Child's Guide to Optimal Control Theory

The ¯rst-order conditions are:

@L(¢)@uk

= 0; k = 1; : : : ;m;

@L(¢)@xi

= ¡h

_Ãi(t) ¡ ½Ãi(t)i; i = 1; : : : ; n;

limT!1

e¡½T Ãi(T ) ¸ 0; limT!1

e¡½T Ãi(T )x¤i (T ) = 0; i = 1; : : : ; n:

Áj(t) ¸ 0; Áj(t)Q(x(t);u(t)) = 0; j = 1; : : : ; q:

The su±cient conditions are as before.

7. The Economic Example in In¯nite Horizon

Consider the following problem:

max

Z 1

0

e¡½tu (c(t)) dt

subject to_a(t) = ra(t) ¡ c(t);

a(0) = a0:

Abstracting from the time subscript, the current value Hamiltonian is

H(a; c; Ã) = u(c) + Ã [ra ¡ c] :

Its ¯rst-order conditions are

@H

@c= 0 =) u0(c) ¡ Ã = 0;

@H

@a= ¡

h_à ¡ ½Ã

i=) Ãr = ¡

h_à ¡ ½Ã

i;

limT!1

e¡½tÃ(T ) ¸ 0; limT!1

e¡½tÃ(T )a(T ) = 0:

Once again, the interpretation of these ¯rst-order conditions relates consumption

growth to the elasticity of intertemporal substitution, the market discount rate, and the

subjective discount rate, r and ½. To show this, ¯rst note that

_Ã = ¡(r ¡ ½)Ã = ¡(r ¡ ½)u0(c):

Then, totally di®erentiating the ¯rst ¯rst-order condition yields

u00(c) _c = _Ã = ¡(r ¡ ½)u0(c);

7

Page 8: A Child's Guide to Optimal Control Theory

such that

gc(t) =_c(t)

c(t)= ¡(r ¡ ½)

u0(c(t))c(t)u00(c(t))

or

gc(t) = ¾(c(t))(r ¡ ½);

where ¾(c(t)) = ¡u0(c(t))=[c(t)u00(c(t))] > 0. Thus, consumption grows whenever the mar-

ket discount rate is larger than the subjective discount factor. In that case, the consumer

is less impatient than the market.

8

Page 9: A Child's Guide to Optimal Control Theory

8. Summary

To summarize, here is the simple cookbook. Assume that you face the following problem:

max

Z 1

0

e¡½tf (x(t);u(t)) dt

subject to_xi = Qi(x(t);u(t)); i = 1; : : : ; n;

xi(0) = xi0; i = 1; : : : ; n:

There are two ways to proceed:

1. Present Value Hamiltonian

Step 1 Write the present value Hamiltonian:

H (x;u;¤) = e¡½tf(x;u) +nX

i=1

¸iQi(x;u):

Step 2 Find the ¯rst-order conditions:

@H(¢)@uk

= 0; k = 1; : : : ; m;

@H(¢)@xi

= ¡ _̧i(t); i = 1; : : : ; n;

limT!1

¸i(T ) ¸ 0; limT!1

¸i(T )x¤i (T ) = 0; i = 1; : : : ; n:

2. Current Value Hamiltonian

Step 1 Write the current value Hamiltonian:

H (x;u;ª) = f(x;u) +nX

i=1

ÃiQi(x;u):

Step 2 Find the ¯rst-order conditions:

@H(¢)@uk

= 0; k = 1; : : : ;m;

@H(¢)@xi

= ¡h

_Ãi(t) ¡ ½Ãi(t)i; i = 1; : : : ; n;

limT!1

e¡½T Ãi(T ) ¸ 0; limT!1

e¡½T Ãi(T )x¤i (T ) = 0; i = 1; : : : ; n:

9

Page 10: A Child's Guide to Optimal Control Theory

References

Kamien, Morton I. and Nancy L. Schwartz, 1981, Dynamic Optimization: The Calculus

of Variations and Optimal Control in Economics and Management, New York: North

Holland.

King, Ian P., 1986, A Cranker's Guide to Optimal Control Theory, mimeo Queen's Uni-

versity.

10