Problem Set 2
Problem Set 2
1. Find the bug. Find the three errors in the following Matlab code that simulates the
Solow model. Give the line number and write the correct line.
2. Matlab vectors and matrices. Of which size are the variables L, Y, Z defined in
the following Matlab code? (e.g.: 4x1 for column vector with four entries, 1x5 for row
vector with five entries, 2x3 for a matrix with 2 rows and 3 columns): Hint: K is a
1x100 row vector.
K = 0.1:0.1:10;
L = K’;
Y = K.^alpha .* L.^(1-alpha);
Z = K*L;
Yt = Kt↵ (At Lt Ht )1 ↵
,
where Yt is total GDP, Kt is the capital stock, Lt is the labor force, Ht is human
capital per worker, and At measures labor-augmenting technological growth. Suppose
1
that we measured growth rates gY = 6%, gK = 6%, gL = 1.5% and gH = 0.6% in
a given year (note that we cannot measure At directly). Assume ↵ = 1/3 and use
growth accounting to find the contribution of K, N , L and A to the growth of total
GDP (not GDP per capita, as in class!) . At which rate gA did At grow in this year?
(b) Find the rate of growth of the total factor productivity, gB .(HINT: Take logs of
the production function, and di↵erentiate with respect to time).
(c) What is the rate of growth of per capita income (Y /L) in the long run? HINT: In
class, we studied an economy with a production function Y = K ↵ (AL)1 ↵ , where
A was assumed to grow at a rate gA . We showed that the long-run rate of growth
in per capital income in this economy was gA . In solving this problem, think
about how B (total factor productivity) and A (labor efficiency) are related.
2
5. Firm’s problem with Cobb-Douglas production function. Consider a firm
with production function Y = F (K, L) = AK ↵ L1 ↵ , where A = 1 and ↵ = 1/3 are
parameters. The firm sells output Y at normalized price 1, the factor prices are w for
labor L and r for capital K. Find three pairs (r, w) such that the following are true:
(a) The firm has positive profits under the optimal choice.
(b) The firm’s optimal choice is Y ⇤ = 0 (and it would make negative profits other-
wise).
(c) The firm has zero profits under the optimal choice (thus optimal supply is some
Y ⇤ 2 [0, 1]).
For each pair (r, w), use Matlab to i) make a plot with iso-cost curves and isoquants,
marking an optimal allocation1 , ii) make a surface plot of the profit function ⇡(K, L) =
F (K, L) rK wL, and iii) comment briefly on the firm’s optimal choice.
6. (Suboptimal) Paths in Ramsey model. Consider a Ramsey model with zero
population growth (i.e n = 0 and Lt = 1 for all t) and zero technological growth
(g = 0, At = 1 for all t). The representative household has preferences
Z 1
V0 = e ⇢t u(ct )dt, (1)
0
where ⇢ = 0.03 is the discount rate and u(c) = [c1 ✓ 1]/(1 ✓) with ✓ = 2 is the
1/3
utility function. The production function is yt = kt . Assume that the economy
starts with k0 = 1 and that the savings rate is given by (as a function of time)
0.03t
st = 0.1 + 0.1e . (2)
(a) Write a Matlab code to approximate the time paths of kt , yt , ct and flow utility
ut = u(ct ) over time t 2 [0, 300], using a time increment of t = 0.1.2 Report
this code in your solution.
(b) Plot the time paths for kt , yt , ct and ut for t 2 [0, 300].
(c) Calculate the household’s value V0 from this savings policy. Hint: Approximate
the integral in (1) by
Z 1 N
X
⇢t ⇢ti 300⇢
e u(ct )dt ' e u(cti ) t + e u(c300 )/⇢ (3)
0 | {z }
i=0
⌘W
where N = 300/ t is the number of time periods and where {ti = i t}N i=1 is
the time grid in the approximation. Note here that W captures the continuation
value at t = 300, where we assume that consumption stays constant forever (i.e.
ct = c300 for all t > 300).
1 You may use plot(Kstar,Lstar,’x’,’LineWidth’,2) to mark a pair K ⇤ , L⇤ ) with a thick black cross,
for example.
2 You may use the ”naive” solution technique for the di↵erential equation that we used for the Solow
model.
3
PROBLEM SET 2
1 . Find 3 emors in the Matlab code for the Solow Model and correct them :
Line 15 : most notorious one as it does not operates well the rector . Vectors must be
Solution : A
.
*
Prec . Alpha
Line 10 : next most notorious one as loops must be specified to m ove each value of
Solution :
for it= 1 : Nt
Line 13 :
ginally ,
looking more
thoughtgelly into the coding we see how the current
to update capital .
Solution kk
=
kk + dt kdot ;
<1 , .
..,
100) (1 x 100)
. .
: row .
.
L =
k L =
z L scalarnumber isot K .* (
k
doing matix operation where would
get anothe
= ;
+
as a we
columns
makix of 100 and 100 E K
10037 Exe
=
rows .
=
x, 100 , 1) , ch
goes out
.
3 Growth accouting with human capital . Assume the p .
g . Y t =
k* CAt , L, HA)" .
Suppose ve
gy a
= =
gr g-
=
, ,
Data
gy
6 % 6% 1. 5 % 0 6 % 13
cte
=
gr
:
gr gH
= = =
=
,
H)1
-
2t =
kc + =
e0g(yt)
=
al0g(x+) + (1 -
d)l0g(At) + ( -
c)l0g((t) + Cr c)-
logHt
cgron (heory( i =
c + x -
x + x -
xi + c -
xi =
=
0 06
,
=
30 ,
0 +
+ +
30015 + 2 0 006
3
,
=
=
0, 0
=
0 02
,
+
2 +
+ 0 0
,
+ 0
,
004
i = (0 ,
06 -
q
, 034) -
3 = 0
,
039 =
3 , 90 %
gA
At (z i
grN = 0 039 0 015 0 054 5 , 40 %
= = =
.
= +
= +
, , ,
e
L
3(3
3
9 1, 5)
contibution
+
A N 0, 6 %
k 2
%; H
,
to : 1 % 0 4
, %; 2
,
6 %; =
5, y
= 30 % investment rate Y 7%
gowth GDP
Y 2 capital output ratio S 5%
=
5
year :
= = =
to
, , .
,
depreciation rate
,
v
=
2
growth rale of labor wo r k .
Assume p .
g . as = BKCL" ith a
=
0, 4 .
The
economy is on a balanced
growth path with a constant capital to output ratio
* =
2, 5 ,
Ft .
The
as Rate
of growth of aggregale capital stock
knowing I is constant .
According to kaldor
gacts ;
I is
oughly constant
, theregore
I
=
2,5 calsob
a
i i
B 3
i
3 0 0 07 7xasy 07 7x S
= =
0
9x
= = = =
= =
- -
, ,
k r ky
moving 3 =
BK
3 =
3 +
ci +
c -
x4 =
07
=
0 , 4(0 , 07) 0 60 , 02)
0
g
=
+ +
, ,
03 3 %
91
=
0,
=
c Rate
growth of per capita income
? in the
long r
Y Br c 1
A c
-
k
-
c -
3 Br
-
2
= = = =
B =
A :
i
xi
0 , 03 -
=
x - = =
5 % -
B x -
0
,
4)
=
07 02 5 %
92
=
or
92 g 0 0
-
-
=
, ,
v
5 Firms
.
problem with Cobb -
Douglas p .
J . Consider p g
. . 3 =
FCK , =
AKG2 where A =
1
,
c =
13 .
clear woruspace
Define parametes
r, w that
salisfy the 3
sections ,
create I rectors
vectors for k, L
Output
the CES
function calling
production Su
calwlate MP
.
X
loop for generating
better
*
c te ro progit under the oplimal choice and the optinal supply y = 0
,
1) .
6 Suboplimal Paths model Consider population = 1 At and
Ransey growth
=
0 0
in
g
.
n =
.
, ,
technological growth ,
At = 1
,
At . The representative household has
presences Vo= 5 etcca)dt
0
where
=
0
,
03 discountrate ,
UCC =
c8-11 - 8 vility guction with 8 = 2. . The p .
g.
is
y z
=
k
03t
Assume the economy stards with ko=1 and St
=
0 .
1 + 0 . 150 ,
savings rate .
as Matlab code approximate dine paths and ve= vCC) time te 0 300
to ke ,
yz ,
over
, using
St =
0 . 12 Line increment .
where N =
300st n
:
og time priods {ti ,
=
:st3 =1 time gid in
approximation and wcaptures
2300 #t 300 .
1st Clear 5
our
space grom e . x . .
X
:
2 Define al parametes to vie .
needed cument
for calculating >
and, therefore
savings ,
current consumption .
gor kt ,
ya , c and ve-
6t Calculate Yo Veral'
total
agregate ubility or
Vo = -
0
,
7082
b) Plot time paths for ke , yt , c and ve for te 0
,
300