Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Macroeconomics I

Problem Set # 4

This problem set is due Friday, February 10th .

1 Numerically Solving the Ramsey Model

For this exercise, you can use any programming language that you prefer. In the seminar,
we will use Python to solve it.
In the last Problem Set, we solved the Ramsey model with household size growth
and no technological change for a given initial level of capital k0 . The two optimality
conditions are

k̇ = f (k) − c − (δ + n)k

= σ(f ′ (k) − δ − ρ)
c

plus a transversality condition.


As we discussed, depending on the initial consumption, c0 , we would follow the saddle
path. We will use numerical methods to determine c0 and simulate the model.
First, our equations are in continuous time thus we need to approximate k(t) and c(t) at
N discrete points in the time dimension, tn , n = 1, . . . , N . Denote distance between grid
points by ∆t and the short-hand notation k n = k(tn ).
We can approximate time derivatives by

k n+1 − k n
k̇ ≈
∆t

1
and approximate the differential equations by

k n+1 − k n
= f (k n ) − cn − (δ + n)k n
∆t
cn+1 − cn 1
= σ(f ′ (k n ) − δ − ρ)
∆t cn

rearranging terms we get

k n+1 = ∆t[f (k n ) − cn − (δ + n)k n ] + k n (1)


cn+1 = ∆t[σ(f ′ (k n ) − δ − ρ)]cn + cn (2)

with k 0 = k0 given. We also assume that k0 < k ∗ for simplicity.


The basic algorithm is to guess a value of c0 , simulate the model long enough, and then
check if we are at the steady-state. If not, reset c0 and simulate again the model. The
problem with that strategy is that if we are not exactly in the SS, because ∆t is not
infinitesimal, we are going to diverge as we keep iterating forward. Thus we use some
tolerance level to evaluate if we reached the SS. Moreover, since we imposed that k0 < k ∗ ,
we know that if cn > c∗ or k n > k ∗ in any iteration, we are not going to reach the SS
(why?), and thus we can restart the algorithm. We also know that c0 ∈ [0, c∗ ] (because
k0 < k ∗ !) and that if cn > c∗ at any iteration our guess for c0 is too high and similarly
if k n > k ∗ at any iteration our guess for c0 is too low (why?). Given that, we can use an
algorithm similar to the Bisection Method.

The Algorithm

Assume that f (k) = Ak α , A = 1, α = 31 , σ = 0.5, ρ = 0.05, δ = 0.05, n = 0.02, k0 = 0.5k ∗ , ∆t =


0.1 and N = 1000.
Define the error tolerance parameter

cn − c∗ 2 kn − k∗ 2
ϵ= (2 n ∗ ) + (2 n )
c +c k + k∗

and some error tolerance, say 0.01.



Select any c0 ∈ (0, c∗ ), e.g. c0 = c2 . Set c = 0 and c̄ = c∗ . Simulate the model for N
iterations.

(a) If at any iteration cn > c∗ set c̄ = c0 and select a new c0 = (c̄ + c)/2.

(b) If at any iteration k n > k ∗ set c = c0 and select a new c0 = (c̄ + c)/2.

2
(c) If ϵ < 0.01, we found c0 and the entire path of cn and k n

Exercise

(a) Write the algorithm to solve for c0 given k0 < k ∗ .

(b) Plot the path of kt and ct together with the k̇ = 0 and ċ = 0 curves.

(c) Plot two paths, one for some initial consumption higher than c0 and another for an
initial consumption lower than c0 .

You might also like