You are on page 1of 12

EMiDO: OLG model cont.

Krzysztof Makarski
http://akson.sgh.waw.pl/~kmakar/emido_lato2012/wyk07.pdf and code: http://akson.sgh.waw.pl/~kmakar/emido_lato2012/OLG.m

Three period OLG.

Introduction
We are going to see an example of how to solve OLG models. There are two issues:

 Finding a path starting from initial conditions.  Analyzing eects of policy changes.
They are quite related, we are going to show how to deal with both issues.

Households Agents live for three periods. In the rst period we call them young, in the second middle aged and in the third old. Agents can work one unit of time when young and middle aged and zero when old. Thus when they are young and middle aged they must save for their consumption when they become old. In each period there are three generations of agents: young, middle aged and old. The following table presents the structure of population in time

time of birth

-1 0 1 2 3 4 5 ...

1 o m y

2 o m y

time 3 4 o m y

...

o m y

o m y

The budget constraint of a young agent is


cy + sy = wt t t

where cy consumption of a young agent in period t, sy savings of the young agent in period t. The budget t t constraint of an middle aged agent is
cm + sm = wt+1 + (1 + rt+1 )sy t t+1 t+1

where cm consumption of a middle aged agent in period t + 1, sm savings of the middle aged agent in t+1 t+1 period t + 1. The budget constraint of an old agent is
co = (1 + rt+2 )sm t+2 t+1

where co consumption of an old agent in period t + 2. t+21 1

Solution Assume that agent solves her problem when young and commits to its solution. The problem of an agent born in period t 0 is
(cy ,cm ,co ,sy ,so ) t t+1 t+2 t t+1

max

log cy + log cm + 2 log co t t+1 t+2 cy + sy = wt t t cm + sm = wt+1 + (1 + rt+1 )sy t t+1 t+1 co = (1 + rt+2 )sm t+2 t+1

(1)

sb.to

Lagrangian
L = log cy + log cm + 2 log co t t+1 t+2 y (cy + sy wt ) t t t m cm + sm wt+1 (1 + rt+1 ) sy t t+1 t+1 t+1
o m o t+2 ct+2 (1 + rt+2 ) st+1

FOCs:
cy : t cm : t+1 sy : t sm : t
1 cy t 1 cm
t+1

= y t = m t+1 = o t+1 = (1 + rt+1 ) m t+1 = (1 + rt+2 ) o t+2

co : 2 co1 t+2 y t

t+2

m t+1

Simplifying
cm t+1 co t+2 = = (1 + rt+1 ) cy t (1 + rt+2 ) cm t+1

(2)

Since
cy + sy t t cm t+1 + sm t+1 co t+2 = wt = wt+1 + (1 + rt+1 )sy t = (1 + rt+2 )sm t+1

we have
cy + t

1 1 1 cm + co = wt + wt+1 t+1 t+2 (1 + rt+1 ) (1 + rt+1 )(1 + rt+2 ) (1 + rt+1 ) (1 + rt+1 ) cy (1 + rt+2 ) (1 + rt+1 ) cy wt+1 t t + = wt + (1 + rt+1 ) (1 + rt+1 )(1 + rt+2 ) (1 + rt+1 )

Substituting we get
cy + t

Finally,
cy t = 1 1 wt + wt+1 (1 + + 2 ) (1 + rt+1 )

Furthermore, since

co + (1 + rt+2 ) cm = (1 + rt+2 ) [wt+1 + (1 + rt+1 ) sy ] t t+2 t+1

Substituting for co = (1 + rt+2 ) cm we get t+2 t+1


cm t+1 sm t+1 = 1 [wt+1 + (1 + rt+1 ) sy ] t 1+ = wt+1 + (1 + rt+1 )sy cm t t+1

and from the budget constraint

co = (1 + rt+2 )sm t+2 t+1

Next, we need to deal with the initial middle aged and initial old (born in period 1 and 0). For simplicity we assume that they follow their plans, i.e.
cm 1 sm 1 co 2 1 [w1 + (1 + r1 ) sy ] 0 1+ y m = w1 + (1 + r1 )s0 c1 = = (1 + r2 ) sm 1

(3) (4) (5) (6)

and similarly the initial old follow their plans (although they would not have much of a choice anyway,
co = (1 + r1 ) sm 1 0

The size of the generation born in period t is Nt . Assume Nt = (1 + n)Nt1 where n is the growth rate of population.
Equations for matlab
For agents living in period t cy t sy t cm t sm t co t 1 1 wt + wt+1 2) (1 + + (1 + rt+1 ) = wt cy t 1 = wt + (1 + rt ) sy t1 1+ y m = wt + (1 + rt )st1 ct = = (1 + rt ) sm t1

The initial middle aged (the same formulas as above) cm 1 sm 1 co 2 and the initial old (the same as above) co = (1 + r1 ) sm 1 0 1 [w1 + (1 + r1 ) sy ] 0 1+ y m = w1 + (1 + r1 )s0 c1 = = (1 + r2 ) sm 1

Firms The production function is a Cobb-Douglas production function Yt = AKt L1 . Firms solve the followt ing problem
max
(Yt ,Kt ,Lt )

Yt wt Lt (rt + ) Kt
Yt = AKt L1 t

(7)

s.to

where Lt represents labor employment. For simplicity we assume that there is no technological progress. Note that if the return on capital rate is rt than the rental rate must be rt + .

Market clearing The asset market clearing condition is given by


Kt+1 = sy Nt + sm Nt1 t t

(8) (9)

The goods market clearing condition


Nt cy + Nt1 cm + Nt2 co + Kt+1 = Yt + (1 d)Kt t t t

where Nt represents the size of the generation born in period t. Since all young and middle aged people work thus
Lt = Nt + Nt1

(10)

Competitive equilibrium Denition 1. An equilibrium is an allocation {cy , cm , co , sy , sm , Kt , Yt , Lt } and prices {wt , rt } such t t t t t t=1 t=1 that for all t 1, given prices (cy , cm , co , sy , sm ) solves the problem of an agent born in period t (1). t t+1 t+2 t t+1 initial old and initial middle aged follow their plans, i.e. given prices and (sy , sm ), (cm , sm , co , co ) satises 1 1 1 2 0 0 (3)-(6). for all t, given prices (Kt , Yt , Lt ) solves the rm's problem (7). markets clear, i.e. (8)-(10) are satised. Solution From rm's problem

L = Yt wt Lt (rt + ) Kt t (Yt AKt L1 ) t

First order conditions are


Yt Kt Lt : 1 t = 0
1 : (rt + ) + t AKt L1 = 0 t : wt + t AKt (1 )L = 0 t

after simplication we get


rt wt
1 = AKt L1 t

(1 )AKt L t

Next dene the variables in per worker terms kt Kt /Lt and yt Yt /Lt .
rt wt = =
1 Akt

(1

)Akt

(11) (12)

Since kt =

Kt Lt

Kt Nt +Nt1

Kt+1 = sy Nt + sm Nt1 t t

Kt+1 Nt+1 + Nt Nt Nt1 = sy + sm t t Nt+1 + Nt Nt + Nt1 Nt + Nt1 Nt + Nt1 Kt+1 (1 + n + 1) Nt (1 + n) Nt1 Nt1 = sy + sm t t Nt+1 + Nt 1 + 1 N (1 + n + 1) Nt1 (1 + n + 1) Nt1
1+n t

kt+1 (1 + n) = sy t kt+1 =

1+n 1 + sm t 2+n 2+n

1 y 1 s + sm 2+n t (2 + n) (1 + n) t

(13)

This is the law of motion for capital per worker. Thus, given the initial k0 , we can solve the model in matlab. 4

Steady state Denition 2. The steady state allocation is a competitive allocation satisfying kt = k, yt = y , cy = cy , t sy = sy , cm = cm , sm = sm , co = co , for all t. t t t t
In the steady state we have w r cy sy cm sm co = = (1 ) Ak Ak 1

1 2+r w (1 + + 2 ) 1 + r = w cy 1 = [w + (1 + r) sy ] 1+ = w + (1 + r)sy cm = = (1 + r) sm

and to nd capital the law of motion for capital (13) and substitute kt+1 = k k= 1 y 1 s + sm 2+n (2 + n) (1 + n)

Algorithm for nding the steady state


Guess k . Given k compute w and r. Next compute cy , sy , cm , sm , co . Using (13) aggregate into new k . Check if |k k | , if it is satised you have a steady state, otherwise repeat starting with k .

Algorithm for nding the path


Guess {kt }t=1 . Assume in period 50 economy is in the steady state.
50

Given {kt }t=1 compute {wt , rr }t=1 .


50 50

Next compute {cy , sy , cm , sm }t=1 . t t t t


50

Using (13) aggregate into new kt

50 t=1

. Check if
50 t=1

50 t=1

kt kt , if it is satised you have a steady

state, otherwise repeat starting with kt

There is one more check to make (just in case), you need to check whether in 50 periods economy achieves the steady state. Extend your transition path to 150 compare both paths.

Path of capital
Matlab code for solving the model. Path of capital, see lawgure1Figure 1 .

gure1

Figure 1: The law of motion for capital per worker.

0.065

0.06

0.055

0.05

0.045

0.04

0.035

0.03

0.025

0.02

10

15

20

25

30

35

40

45

50

lawreturn

Social Security

Description
We are going to consider a switch from PAYG system to fully funded system. Denote bt pension in period t. Denote contribution of young and middle aged as, respectively, y and m. Relation between bt and ( y , m ) depends on the social security system (details later). Next given (bt , y , m ) we solve the consumer problem.

Consumer problem Assume that agent solves her problem when young and commits to its solution. The problem of an agent born in period t 0 is
(cy ,cm ,co ,sy ,so ) t t+1 t+2 t t+1

max

log cy + log cm + 2 log co t t+1 t+2 cy + sy = wt ty t t


m cm + sm = wt+1 t+1 + (1 + rt+1 )sy t t+1 t+1

(14)

sb.to

co = (1 + rt+2 )sm + bt+2 t+2 t+1

Lagrangian
L = log cy + log cm + 2 log co t t+1 t+2 y (cy + sy wt + ty ) t t t
m m cm + sm wt+1 + t+1 (1 + rt+1 ) sy t t+1 t+1 t+1 o m o t+2 ct+2 (1 + rt+2 ) st+1 bt+2

FOCs:
cy : t cm : t+1 sy : t sm : t
1 cy t 1 cm
t+1

= y t = m t+1 = o t+1 = (1 + rt+1 ) m t+1 = (1 + rt+2 ) o t+2

co : 2 co1 t+2 y t

t+2

m t+1

Simplifying
cm t+1 co t+2 = = (1 + rt+1 ) cy t (1 + rt+2 ) cm t+1

Since
cy + sy t t cm + sm t+1 t+1 co t+2 = wt ty
m = wt+1 t+1 + (1 + rt+1 )sy t

(1 + rt+2 )sm + bt+2 t+1

we have
cy + t

1 1 cm + co = wey t t+1 (1 + rt+1 ) (1 + rt+1 )(1 + rt+2 ) t+2


m wt+1 t+1 bt+2 + (1 + rt+1 ) (1 + rt+1 )(1 + rt+2 )

where
wey = wt ty + t

Substituting we get
cy + t

(1 + rt+1 ) cy (1 + rt+2 ) (1 + rt+1 ) cy t t + = wey t (1 + rt+1 ) (1 + rt+1 )(1 + rt+2 ) cy = t 1 wey (1 + + 2 ) t

Finally, Furthermore, since

m co + (1 + rt+2 ) cm = (1 + rt+2 ) wt+1 t+1 + (1 + rt+1 ) sy + bt+2 t t+2 t+1

Substituting for co = (1 + rt+2 ) cm we get t+2 t+1


cm t+1 sm t+1 = = bt+2 1 m wt+1 t+1 + (1 + rt+1 ) sy + t 1+ 1 + rt+2 m wt+1 t+1 + (1 + rt+1 )sy cm t t+1

and for the last period we use the budget constraint to get
co = (1 + rt+2 )sm + bt+2 t+2 t+1

Next, we need to deal with the initial middle aged and initial old (born in period 1 and 2). For simplicity we assume that they follow their plans, i.e.
cm 1 sm 1 co 2 b2 1 m w1 1 + (1 + r1 ) sy + 0 1+ 1 + r2 m = w1 1 + (1 + r1 )sy cm 1 0 = = (1 + r2 ) sm 1 + b2

(15) (16) (17) (18)

and similarly the initial old follow their plans (although they would not have much of a choice anyway,
co = (1 + r1 ) sm + b1 1 0

The size of the generation born in period t is Nt . Assume Nt = (1 + n)Nt1 where n is the growth rate of population.
Consumer problem solution Summarizing (the same formulas also for the initial old)
cy = t 1 wey 1 + + 2 t

where wey = wt ty + t

m wt+1 t+1 (1+rt+1 )

bt+2 (1+rt+1 )(1+rt+2 )

sy t cm = t

wt ty cy t

1 bt+1 wt tm + (1 + rt ) sy + t1 1+ 1 + rt+1 sm = wt tm + (1 + rt )sy cm t t t1 co = (1 + rt ) sm + bt t t1

2.1

PAYG Social Security

PAYG Social security Collects contributions t from young and middle aged and pays to old.
Nt2 bt = Nt ty + Nt1 tm

Thus

bt = (1 + n) ty + (1 + n) to

(19)

Market clearing The asset market clearing condition is given by


Kt+1 = sy Nt + sm Nt1 t t

(20) (21)

The goods market clearing condition


Nt cy + Nt1 cm + Nt2 co + Kt+1 = Yt + (1 d)Kt t t t

where Nt represents the size of the generation born in period t. Since all young and middle aged people work thus
Lt = Nt + Nt1

(22)

Competitive equilibrium Denition 3. An equilibrium is an allocation {cy , cm , co , sy , sm , Kt , Yt , Lt } and prices {wt , rt } such t t t t t t=1 t=1 that for all t 1, given prices (cy , cm , co , sy , sm ) solves the problem of an agent born in period t (14). t t+1 t+2 t t+1 initial old and initial middle aged follow their plans, i.e. given prices and (sy , sm ), (cm , sm , co , co ) satises 1 1 1 2 0 0 (15)-(18). for all t, given prices (Kt , Yt , Lt ) solves the rm's problem (7). for all t, social security is balanced, thus (19) is satised. markets clear, i.e. (20)-(22) are satised. Solution Similarly as before we get
1 y 1 st + sm 2+n (2 + n) (1 + n) t This is the law of motion for capital per worker. Thus, given the initial k0 , we can solve the model in matlab. kt+1 =

Steady state
In the steady state we have w r =
2

(1 ) Ak

= Ak 1

b = (1 + n) y + (1 + n) m cy = 1 w m b w y + + 2 2 1++ (1 + r) (1 + r) sy cm = = w y cy

1 b w m + (1 + r) sy + 1+ 1+r = = w m + (1 + r)sy cm (1 + rt ) sm + b

sm c
o

In order to nd the steady state use the law of motion for capital (13) and substitute kt+1 = k k=
2.2

1 y 1 s + sm 2+n (2 + n) (1 + n)

Fully Funded Social Security

Fully Funded Social security Collects contributions t from young and middle aged, invests and proceedings are paid to old, thus
bt = (1 + rt ) (1 + rt1 ) y + (1 + rt ) m

(23)

Market clearing The asset market clearing condition is given by


Kt+1 = (sy + ty ) Nt + (sm + tm ) Nt1 t t

(24) (25)

The goods market clearing condition


Nt cy + Nt1 cm + Nt2 co + Kt+1 = Yt + (1 d)Kt t t t

where Nt represents the size of the generation born in period t. Since all young and middle aged people work thus
Lt = Nt + Nt1

(26)

Competitive equilibrium Denition 4. An equilibrium is an allocation {cy , cm , co , sy , sm , Kt , Yt , Lt } and prices {wt , rt } such t t t t t t=1 t=1 that for all t 1, given prices (cy , cm , co , sy , sm ) solves the problem of an agent born in period t (14). t t+1 t+2 t t+1 initial old and initial middle aged follow their plans, i.e. given prices and (sy , sm ), (cm , sm , co , co ) satises 1 1 1 2 0 0 (15)-(18). for all t, given prices (Kt , Yt , Lt ) solves the rm's problem (7). for all t, social security is balanced, thus (23) is satised. markets clear, i.e. (24)-(26) are satised. Solution Similarly as before we get
kt+1 = 1 1 (sy + ty ) + (sm + tm ) t 2+n (2 + n) (1 + n) t

This is the law of motion for capital per worker. Thus, given the initial k0 , we can solve the model in matlab.
Steady state
In the steady state we have w r = =
2

(1 ) Ak Ak 1

b = (1 + r) y + (1 + r) m cy = 1 w m b w y + + 2 2 1++ (1 + r) (1 + r) sy = w y cy

10

cm =

1 b w m + (1 + r) sy + 1+ 1+r = = w m + (1 + r)sy cm (1 + rt ) sm + b

sm c
o

In order to nd the steady state use the law of motion for capital (13) and substitute kt+1 = k k=
3

1 1 (sy + y ) + (sm + m ) 2+n (2 + n) (1 + n)

Transition from PAYG to Fully Funded

Transition path
Assume initially we have a PAYG system and it is in the steady state (in general it is not necessary) Assume we switch to the FF system and eventually we end up in the new steady state (necessary). Old system is unexpectedly disbanded in period 0. Problem pensions for initial old and middle aged. Assume they are paid as promised, i.e. b = 2 (1 + n) y + (1 + n) o and it is nanced by young and middle aged through evenly distributed taxes.

Furthermore initial middle aged are in the PAYG system (thus their contributions are not invested).

Parameters
= 0.33; = 0.9720 ; = 1 (1 0.07)20 ; z = 10; n = 4; sy = 0.015; sm = 0.027; 1 1 y = 0.2; m = 0.2;

Path of capital
Matlab code for solving the model. Path of capital, see capitalgure2Figure 2 .

Path of welfare
We look at how welfare of dierent generations is aected to see who gains and who loses. Path of welfare change, see welfaregure3Figure 3 .

Summary
We showed how to solve OLG models We showed how to deal with the transition paths. As far as social security is concerned it probably is necessary to nance it through debt in order for

the switch to be Pareto optimal.

11

gure2
0.48

Figure 2: Capital per worker on the transition path.

0.46

0.44

0.42

0.4

0.38

0.36

0.34 10 20 30 40 50

capitalreturn

gure3

Figure 3: Welfare change on the transition path for generation born in each period.
0.05

-0.05

-0.1

-0.15

-0.2 10 20 30 40 50

lawreturn

12

You might also like