Jaimovich and rebelo (2009)
Posted: Thu Jun 02, 2016 5:55 pm
Hi,
I want to replicate Jaimovich and Rebelo (2009) : "News and Business Cyvle" paper. I include both temporary TFP and investment specific shocks . When I run the program it gives me the following error. I am not sure whether there are problems of defining my shocks or initial values.I tried different ways of writing shocks (all included in the codes) and many initial values. But it does not work. Also, how can I check whether my initial values are good or not?
My code :
I want to replicate Jaimovich and Rebelo (2009) : "News and Business Cyvle" paper. I include both temporary TFP and investment specific shocks . When I run the program it gives me the following error. I am not sure whether there are problems of defining my shocks or initial values.I tried different ways of writing shocks (all included in the codes) and many initial values. But it does not work. Also, how can I check whether my initial values are good or not?
An infinite element was encountered when trying to solve equation(s) 12
with respect to the variable(s): A.
The values of the endogenous variables when the problem was encountered were:
C 0.76
I 0.24
Y 1
K 10
N 0.31
X 0.76
U 0.8
A 1.002
Z 1.002
lam1 0
lam2 0
lam3 0
AUX_EXO_LAG_14_0 0
AUX_EXO_LAG_14_1 0
AUX_EXO_LAG_14_2 0
AUX_EXO_LAG_15_0 0
AUX_EXO_LAG_15_1 0
AUX_EXO_LAG_15_2 0
My code :
- Code: Select all
var C I Y K N X U A Z lam1 lam2 lam3;
varexo e ez ei eiz;
parameters beta phi1 phi theta sigma gama alpha psi delta1 delta rhoe rhoz se sez si siz;
beta = 0.985;
psi=5.17;
sigma=1;
gama=0.001;
theta=1.4;
alpha=0.64;
%u=0.15;
phi1=0.5;
phi= 0.3;
delta1=0.15;
delta=0.0125;
rhoe=0.5;
rhoz=0.8;
se=0.66;
sez=0.33;
si=0.66;
siz=0.33;
model;
% wrt C
((C)-psi*((N)^theta)*(X))^(-sigma)+(lam1)*gama*(C)^(gama-1)*(X(-1))^(1-gama)=(lam2);
%wrt X;
(((C)-psi*((N)^theta)*(X))^(-sigma))*psi*(N)^theta +(lam1)= beta* ((lam1(+1))*(1-gama)*((C(+1))^gama)*(X)^(-gama));
%wrtN
(((C)-psi*((N)^theta)*(X))^(-sigma))*theta*psi*((N)^(theta-1))*(X)=(lam2)*alpha*((A)*((U)*(K(-1)))^(1-alpha))*(N)^(alpha-1);
%wrt U
(lam2)*(1-alpha)*(A)*((U)^-alpha)*((K(-1))^(1-alpha))*(N)^alpha= (lam3)*delta1*(K(-1));
%wrt Kt+1;
(lam3)=beta*(((lam2(+1)))*(1-alpha)*(A(+1))*((U(+1))^(1-alpha))*((K)^-alpha)*(N(+1))^alpha )+ (lam3)*(1-delta);
%wrt I
(lam2)*(1/exp(Z))=(lam3)*(1-phi*((I)/exp(I(-1)))-phi1*((I)/(I(-1))))+ beta*(lam3(+1))*phi1*((I(+1))/(I))^2;
%production function
(Y)=(A)*(((U)*(K(-1)))^(1-alpha))*(N)^alpha;
%Resource constraint
(Y)=(C)+(I/Z);
%Capital Accumulation
(K)=(I)*(1-phi*((I)/(I(-1))))+(1-delta)*(K(-1));
%X
(X)=((C)^gama)*(X(-1))^(1-gama);
A=rhoe*A(-1)+e+ei(-3);
%exp(A)=exp(A(-1))^rhoe*e;
Z=rhoz*Z(-1)+ei+eiz(-3);
%exp(Z)=exp(Z(-1))^rhoz*ei*eiz(-3);
end;
initval;
C=0.76;
I=0.24;
Y=1;
K=10;
N=0.31;
X=0.76;
U=0.8;
A=1.0025;
Z=1.0025;
lam1=0;
lam2=0;
lam3=0;
end;
shocks;
var e=se^2;
var ez=sez^2;
var ei=si^2;
var eiz=siz^2;
end;
stoch_simul(order=1,irf=15,nograph,periods=500,simul_replic=100);