Professional Documents
Culture Documents
March 5, 2009
1 A Prototype Model
A representative agent maximizes
00
(7)
I-a
(8)
I-n
1
(9)
{3
c
------
Parameters Values
(3 0.98
0 0.4
a 0.33
f5 0.025
n 0.28
delta = 0.025;~ J
~
r = I/beta - (I-delta);
yk = r/theta;
y = yk*k;
c = y - delta*k;
(fT'
k
~ ykA ( 1/ce-f)) 2
Al\j AAA··· A
\...------y-:--'
j .-thvtt.
Variables Steady State Values
r 0.0454
k 10.52
y 1.19
c 0.93
1.3 Log-linearized
CfNl~o\ '-I.
t3
A
= At, IS ( (10)
n A A
(16)
3
Y[e + ( 1- e) cP01 + (1 - $) h.
C~1 + (1- e» Y4>1
--
where
1
y[O + (1 - .8)¢0] + (1 - 6)k C- + (1 - 8)Y¢1 y(1 + (1 - 8)¢1 ]
Al = 0 1 0
[ o . 0 p
+ B· Et+l , (17)
[
~::~ ]. = [ !O~;4 (~.;} --1l!Li ] .[ ~: ] + [ -O~ 77 ] Et+l' (18)
Zt+l 0 0 0.8 Zt 1
A B
To decouple the dynamics of this system, we need to find the eigenvalues
and the eigenvectors of the matrix A. Matlab can help us find them easily.
Just use the command "eig". For example, simply type
~
[V,D] = eig(A)
will give us the matrix of eigenvectors (V), and the diagopal matrix of
. 1 D AI"n~ht9. UIM'I
elgenva ues, . ~ ~ (~-\'tb ~ {OjVlloll\.tAHV
V
f-
In our model, the diagonal matrix iS~iS tv h~ Z:~:J ~ \i(\.tvv
,
\'- (Iv... 0 A.
\
,
/J-tJ.. ,}
v
J.I'.t-'
~~. ~~
toll/"
'--- 't _ [1.978 0 0] b(vJ Kt s.
D - 0 0.399 0 .
o 0 0.8
Notice that the eigenvalue in the first row has a value outside a unit
circle. This is the unstable root that we can use to eliminate >. from our
dynamical system. That is, we are able to write>' as a linear combination
of it, and z, the endogenous and exogenous state variables of our model.
[
kt+
A I ]
t+ I = DV-
I [ kt]
At + °]
[ -0.77 Et+I, (19)
~+I ~ 1
or,
co- 5-11tk
d
V-I
~~t+I ,.j~N\
11
J~] =
,,,,,e",•• , •• , , . , • • •
ZR[ t ] Zt
+[ -o~ 1
77 ] Et+I , (20)
~
_.{ kt-,--t-, -::. S ,4? Kt' -1: 0.'Z)\(-.!J
A VI A VI3 .
At = ' ~t - - ' Zt . -+- " • l- I.{ C tr'
VI 2 VI 2
~. L~~~,i)'
Use this relationship in ~~a~--to6Pt-aiR_
..",.,
""-
kt +I = 0.399kt + 0.239zt . ""-"",
' ....
lCl.\~ (l
L
r
ltft,u of (\I\o-tllm uf~ [
r.- ~
M/) tiOVl Or 1;
kt +I
Zt+I
] = [0.399
°' 0.239] [
0.8 1
°] [
0.239 ]
0.8
/
/
1\
-:;:! -Ct-
5
~
A
Ct-
IJ
v
A
V1t :::.
The impact of Et on kt + 2 and Zt+2 is
= [OO~6344] .
The impact of Et on k t + i and Zt+i is
Here is the Matlab code for computing the impulse response function,
M = zeros(2,200);
For i = 1:200
;1:':,; 1
A\i*[O;1 ; '(\ ('1-\/ ~ 'C
0
./
V
)
~x I ~-¥
,~() ~ 9" l""-'\ J ~
pr .) -::; l\> . ~o·/\} ')
t!' Co') v \) 0'" v "~
rN (.0 ~
v' l(V]
-1
V Vt-t-r
L--v-_...j
\I i\€ 0. 'J et" V\ ~nVl~ fj (IV\
6
NO
1 ..
000 Mauro! Date § .I ? .I t?1.. .
hMere.. Xok =-
~ I'
lA\,
1 0 --- -fA1 0 0
.-,
I'
A4; \ 0 }A2. ()
li j 0 ~
.}A 1. ~
() ,4
-z..,.....
- 0 x
1--
oc D X
A
AC1 7 1'") Kt + AC1 7 2-) .. 'ri(1,3) l~. ..... ,4(13)2
1\'(1 ~) - A(17-)
M‐File (MATLAB)
% This is an M‐file for my first RBC Model.
% Setting parameter values.
beta = 0.98;
theta = 0.4;
alpha = 0.33;
delta = 0.025;
n = 0.28;
rho = 0.8;
phi1 = 1/(theta‐(n/(1‐n)));
phi0 = phi1*theta;
% Steady state value
r = 1/beta ‐ (1‐delta);
yk = r/theta;
kn = yk^(1/(theta‐1));
k = kn*n;
y = yk*k;
c = y‐delta*k;
% Construct Matrices
a4 = beta*(1‐theta)*r*(phi0‐1);
a5 = 2+beta*r*(1‐theta)*phi1;
a6 = beta*r*(1‐theta)*phi1 + 1;
A0 = [k 0 0; a4 a5 a6; 0 0 1];
a1 = y*(theta+(1‐theta)*phi0) + (1‐delta)*k;
a2 = (1/c)+(1‐theta)*y*phi1;
a3 = y*(1+(1‐theta)*phi1);
A1 = [a1 a2 a3; 0 1 0; 0 0 rho];
% Calculating Matrix
A = inv(A0)*A1;
B = inv(A0)*[0;0;1];
[V,D] = eig(A);
W = inv(V);
%The 1st eigenvalues is outside the unit circle. Therefore, we impose that
%the transformed variable in the 1st row of matrix V*X equals zero
DD = [A(1,1)‐(A(1,2)*(W(1,1)/W(1,2))) A(1,3)‐(A(1,2)*(W(1,3)/W(1,2)));0 rho];
%Computing Impulse Response Function
%one time increase in technology shock
M=zeros(2,200);
for i = 1:200
M(:,i) = DD^i*[0;1];
end;
Y = M';
plot(Y)
%Impulse Response Function for Consumption, Income and Labor
c_hat = zeros(200,1);
y_hat = zeros(200,1);
n_hat = zeros(200,1);
for i = 1:200
c_hat(i) = [W(1,1)/W(1,2) W(1,3)/W(1,2)]*M(:,i);
n_hat(i) = [phi1*(theta‐(W(1,1)/W(1,2))) phi1*(1‐(W(1,3)/W(1,2)))]*M(:,i);
y_hat(i) = (r/theta)*M(1,i)+M(2,i);
end;