stochastic and deterministic model code anomalies?

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

stochastic and deterministic model code anomalies?

Postby jambu » Mon Jan 26, 2009 2:04 pm

Dear all,
This one week i try to run this two simple versions of this model, but i don't understand why it is impossible to get an output even if i don't keep checking on the user guide. About the stochastic version, i have only a beginning of an output, but nothing for the deterministic one. I know that eigenvalues are suitable, that's why i think problems come from my code.
Can anyone help me, please? i don't mange to fix my code, which is certainly very simple for someone who is used to coding in Dynare.
i know you are very busy, so thanks for all the time you could spend to answer this post.
All the best, Marc-Antoine.

Here is the stochastic model code:

var yx yh c cx ch ph px p nt nh nx w pr sx sh s b;
varexo e;
parameters eps psi khi sigm alpha muh mux lbda rho sigma;
eps=4;
psi=4;
khi=0.25;
sigm=2.5;
alpha=0.7;
mux=1.4;
muh=1.4;
lbda=50;
rho=0.95;
sigma=0.007;

model;
sx=khi*((px/p))^(-eps)*s;
sh=(1-khi)*((ph/p))^(-eps)*s;
cx=khi*((px/p))^(-eps)*c;
ch=(1-khi)*((ph/p))^(-eps)*c;

p=((1-khi)*(ph^(1-eps))+khi*(px^(1-eps)))^(1/(1-eps));

nt=((w/p)^(1/psi))*(c^(-sigm/psi));

yx=nx^(alpha);
yh=nh^(alpha);

nx=yx*px/w*(1/mux);
nh=yh*ph/w*(1/muh);

pr=(mux-1)*yx-b;

b=w*nx+ph*yh-p*c;

s=b/p;

yx=cx+sx;

yh=ch+sh;

nt=nx+nh;

b=rho*b(-1)+e;

end;



initval;
p=((1-alpha/mux)/(mux-1))^(-1);
px=p;
ph=p;
c=(1/(mux-1)-1/p)*lbda/khi;
yx=lbda/(mux-1);
cx=khi*c;
ch=(1-khi)*c;
yh=lbda*(1-khi)/khi*(1/(mux-1)-1/p);
nx=(alpha/mux)^(1/(psi+1))*lbda^((1-sigm)/(1+psi))*(1/(mux-1)-1/p)^(-sigm/(psi+1))*(1/khi)^(-sigm/(psi+1))*(1+mux/muh*(1-khi)/khi*(1/(mux-1)-1/p))^(-psi/(psi+1));
nt=nx*(1+mux/muh*(1-khi)/khi*(1/(mux-1)-1/p));
nh=nt-nx;
w=alpha*(lbda/(mux-1))*p/(nx*mux);
b=0;
s=0;
sx=0;
sh=0;
end;

steady;
check;

shocks;
var e = sigma^2;
end;

stoch_simul(periods=2000);




And here is the deterministic model code:



var yx yh c cx ch ph px p nt nh nx w pr ex eh e;
varexo b;
parameters eps psi khi sigm alpha muh mux lbda;
eps=4;
psi=4;
khi=0.25;
sigm=2.5;
alpha=0.7;
mux=1.8;
muh=1.8;
lbda=50;

model;
ex=khi*((px/p))^(-eps)*e;
eh=(1-khi)*((ph/p))^(-eps)e;
cx=khi*((px/p))^(-eps)*c;
ch=(1-khi)*((ph/p))^(-eps)*c;

p=((1-khi)*(ph^(1-eps))+khi*(px^(1-eps)))^(1/(1-eps));

nt=((w/p)^(1/psi))*(c^(-sigm/psi));

yx=nx^(alpha);
yh=nh^(alpha);

nx=yx*px/w*(1/mux);
nh=yh*ph/w*(1/muh);

pr=(mux-1)*yx-b;

b=w*nx+ph*yh-p*c;

e=b/p;

yx=cx+ex;

yh=ch+eh;

nt=nx+nh;
end;

initval;
p=((1-alpha/mux)/(mux-1))^(-1);
px=p;
ph=p;
c=(1/(mux-1)-1/p)*lbda/khi;
yx=lbda/(mux-1);
cx=khi*c;
ch=(1-khi)*c;
yh=lbda*(1-khi)/khi*(1/(mux-1)-1/p);
nx=(alpha/mux)^(1/(psi+1))*lbda^((1-sigm)/(1+psi))*(1/(mux-1)-1/p)^(-sigm/(psi+1))*(1/khi)^(-sigm/(psi+1))*(1+mux/muh*(1-khi)/khi*(1/(mux-1)-1/p))^(-psi/(psi+1));
nt=nx*(1+mux/muh*(1-khi)/khi*(1/(mux-1)-1/p));
nh=nt-nx;
w=alpha*(lbda/(mux-1))*p/(nx*mux);
ex=0;
eh=0;
e=0;
b=0;
end;

steady;
check;

shocks;
var b;
periods 1:9;
values 0.1;
end;
simul(periods=2000);
jambu
 
Posts: 1
Joined: Fri Jun 06, 2008 3:22 pm

Re: stochastic and deterministic model code anomalies?

Postby SébastienVillemot » Tue Feb 17, 2009 9:00 am

Hi

For the deterministic version, use command "rplot" to display the path of variables. You may also use command "dsample" to reduce the time window displayed.

Best

Sébastien
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 12 guests