# Stochastic and deterministic model code anomalies?

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=yxpx/w(1/mux);
nh=yhph/w(1/muh);

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

b=wnx+phyh-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/(nxmux);
b=0;
s=0;
sx=0;
sh=0;
end;

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=yxpx/w(1/mux);
nh=yhph/w(1/muh);

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

b=wnx+phyh-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/(nxmux);
ex=0;
eh=0;
e=0;
b=0;
end;

check;

shocks;
var b;
periods 1:9;
values 0.1;
end;
simul(periods=2000);

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