0% found this document useful (0 votes)
5 views9 pages

Problem Set 2

The document outlines Problem Set 2 for a Macro I course at UC3M, focusing on various economic models and Matlab coding exercises. Students are required to identify errors in provided Matlab code, analyze vector sizes, and perform growth accounting with human capital and total factor productivity. The problem set emphasizes understanding of economic theory and practical application through coding and calculations.

Uploaded by

Irene A G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views9 pages

Problem Set 2

The document outlines Problem Set 2 for a Macro I course at UC3M, focusing on various economic models and Matlab coding exercises. Students are required to identify errors in provided Matlab code, analyze vector sizes, and perform growth accounting with human capital and total factor productivity. The problem set emphasizes understanding of economic theory and practical application through coding and calculations.

Uploaded by

Irene A G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Macro I (UC3M, Master in Economics)

Professor: Matthias Kredler


Problem Set 2
Due: 17 October 2023
Please hand in the problem set via Aula Global before the beginning of our class. You are
encouraged to work in groups; however, every student has to hand in his/her own version
of the solution.

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.

1 delta = 0.1; % Depreciation rate.


2 alpha = 1/3; % Capital share.
3 A = 1; % Total factor productivity.
4 T = 100; % How many years to iterate
5 dt = 0.1; % Time increment.
6 Nt = 100/dt; % How many time periods
7 kk = 1; % Initialize current capital.
8 kvec = zeros(Nt,1); % Allocate vector for capital over time.
9
10 for it=Nt % Loop forward over all time periods.
11 kvec(it) = kk; % Write current capital into vector.
12 kdot = A.*kk.^alpha - delta.*kk; % Obtain net investment rate.
13 kk = (kk + kdot)*dt; % Update running variable: current capital.
14 end
15 yvec = A.*kvec^alpha; % Obtain vector with GDP per capita.

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;

3. Growth accounting with human capital. Assume a production function

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?

4. Growth accounting: TFP instead of labor-augmenting growth. Consider an


economy with the following data about the last year:
I
i⌘ = 30% investment rate,
Y
= 7% growth rate of GDP,
K
= 2.5 capital to output ratio,
Y
= 5% depreciation rate,
n = 2% growth rate of labor force.

Assume that the production function is given by Y = BK ↵ L1 ↵ with ↵ = 0.4. The


economy is on a balanced growth path with a constant capital to output ratio Kt /Yt =
2.5 for all t. Moreover, population grows at the constant rate n, aggregate output a
the rate , and TFP grows at the constant rate gB .
(a) What is the rate of growth of the aggregate capital stock? Hint: Use the fact
that the ratio K/Y is constant over time.

(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 :

Assuming that we will not use nor


savings rate (s) nor population growth Cab as
they

are n ot specified and that ko=1Cline 7)


,
the three crors gound would be :

Line 15 : most notorious one as it does not operates well the rector . Vectors must be

specified in operations as name of rector. , gollowed by any operation ,


in this case'

Solution : A
.
*
Prec . Alpha

Line 10 : next most notorious one as loops must be specified to m ove each value of

it which tanes values


grow a to NE
,
not a salar Nt =

Solution :

for it= 1 : Nt

Line 13 :
ginally ,
looking more
thoughtgelly into the coding we see how the current

capital formula is not


correctly computed in the code as we need in
=
xx+rdot dt .

to update capital .

Solution kk
=
kk + dt kdot ;

<1 , .
..,
100) (1 x 100)

2 Sizes vaiables (, 3 , z ; hint K 0 1 : 0 1 10 is 1x100 rector


of
:
a
=

. .
: row .
.

L =
k L =

transposed rectork L is 100x1 column rector with 100 enties


; a

~ alpha ~C1-alphal ; and product


*
3 =
K .
L . matrix of 100 nows 100 colved knonecher

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

measured rates 67, 1 ,5 % and in not being


growth 6 %, 91 0 6 %
given year
=

gy a
= =

gr g-
=

, ,

able to measure At directly) .


Assume a = 3 and use
growth accouting to
gird the contibution

and A total GDP At which rate did At this


K
year ?
L the in
of ,
N
,
to
growth of .
go grow

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

4 Growth TPF instead labor Conside data last


accounting of -augueling growth the
following for
:
. .

= 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

population grows constant rate Y and TFP constant rale


at
, aggregate output at
grows at
gr .

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

b) Rate the TFP


growth of , gB

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 .

The firm sells y at normalized pice 1 .


Find 3 Cr , wb such that the gollowings are true :

we can develop the three sections at the same lime :

clear woruspace

Define parametes

With random values


of

r, w that
salisfy the 3

sections ,
create I rectors

vectors for k, L

vectors for ratios

Output

the CES
function calling

production Su

calwlate MP
.

X
loop for generating

the final plots

To see the oplimal

better

This will the needed surface and contor


plots with the optimals
give us

for each rection crext pageb .


as Positive progits under the optinal choice .

Optimal negative profits)


*
b) choice at Y =
0 cothewise the firm has .

*
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 .

a) Calculate househoed's value No approximating Secedtetinceist+e-socode =w

where N =
300st n
:
og time priods {ti ,
=
:st3 =1 time gid in
approximation and wcaptures

the continuation value at t =


300 where we assume <1
=

2300 #t 300 .

We can develop both questions

at the same lime :

1st Clear 5
our
space grom e . x . .

X
:
2 Define al parametes to vie .

grd create needed rectors


for

the approximated paths and

for calculating Vo . We need

also a vec tor


for s as is

needed cument
for calculating >

and, therefore
savings ,

current consumption .

4th Create a vaiable to store

the value of the final Vo .

5th create a loop to


get

the approximated paths

gor kt ,
ya , c and ve-

6t Calculate Yo Veral'
total
agregate ubility or

tawing into account all time prods grom the loop .

Vo = -
0
,
7082
b) Plot time paths for ke , yt , c and ve for te 0
,
300

Time path for yz

Time path for kt

Time path for at

Time path for Ut

You might also like