Page 1 of 1

where am i wrong

PostPosted: Thu Jul 01, 2010 11:23 am
by blackeif
I am new learner of dynare. I recently make a small adjustment of RBC_Monop_JFV.mod by adding an economic sector nx(illustrating net export) in the model economy. however the dynare can not run the new mod. Could somebody help me to find where is the wrong point?

------------------------the original RBC_Monop_JFV.mod is:---------------------------------------------------
// Adapted from Jesus Fernandez-Villaverde, Basic RBC Model with Monopolistic Competion Philadelphia, March 3, 2005
var y c k i l w r z;
varexo e;
parameters beta psi delta alpha rho gamma sigma epsilon;

alpha = 0.33;
beta = 0.99;
delta = 0.023;
psi = 1.75;
rho = 0.95;
sigma = (0.007/(1-alpha));
epsilon = 10;

model;
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
psi*c/(1-l) = w;
c+i = y;
y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
r = y*((epsilon-1)/epsilon)*alpha/k(-1);
i = k-(1-delta)*k(-1);
z = rho*z(-1)+e;
end;

initval;
k = 9;
c = 0.76;
l = 0.3;
w = 2.07;
r = 0.03;
y=0.922;
z = 0;
e = 0;
end;

steady;

check;

shocks;
var e = sigma^2;
end;

stoch_simul(periods=2100);

------------------------the adjustend RBC_Monop_JFV.mod is:---------------------------------------------------

var y c k i nx l y_l w r z;
varexo e1 e2;
parameters beta psi delta alpha rho1 rho2 gamma sigma epsilon;
alpha = 0.33;
beta = 0.99;
delta = 0.023;
psi = 1.75;
rho1 = 0.95;
rho2 = 0.95;
sigma = (0.007/(1-alpha));
epsilon = 10;
model;
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
psi*c/(1-l) = w;
c+i+nx = y;
y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
r = y*((epsilon-1)/epsilon)*alpha/k(-1);
i = k-(1-delta)*k(-1);
y_l = y/l;
z = rho1*z(-1)+e1;
nx = rho2*nx(-1)+e2;
end;
initval;
k = 9;
c = 0.76;
l = 0.3;
w = 2.07;
r = 0.03;
z = 0;
e1 = 0;
nx = 0;
e2 = 0;
end;
steady;
check;
shocks;
var e1 = sigma^2;
var e2 = sigma^2;
end;
stoch_simul(periods=2100);
original RBC_Monop_JFV.mod
(817 Bytes) Downloaded 70 times
adjusted RBC_Monop_JFV.mod
(789 Bytes) Downloaded 70 times

Re: where am i wrong

PostPosted: Thu Jul 01, 2010 11:27 am
by jpfeifer
What is the problem? It runs fine on my machine.

Re: where am i wrong

PostPosted: Thu Jul 01, 2010 11:49 am
by blackeif
the mod is run on dynare4.04/4.12 in matlab,the machine said the adjusted mod is unreconized,but the original mod works well. can you tell me the adjusted mod runs in which environmnet? thanks

Re: where am i wrong

PostPosted: Thu Jul 01, 2010 12:09 pm
by jpfeifer
Your filename is not allowed to contain empty spaces. Moreover, there were some strange characters in front of
nx = 0;
e2 = 0;
which must be deleted. The attached file should run.

Re: where am i wrong

PostPosted: Thu Jul 01, 2010 12:12 pm
by blackeif
thank you very much for help, i will try it soon

Re: where am i wrong

PostPosted: Fri Jul 02, 2010 3:46 am
by blackeif
i try it in my machine and it works, thank you!