I want to simulate in a deterministic model, but the result is nan or constant numbers, I just simplify the model of Iacoviello(2005) removing housing sector, and I check the model many times, could anyone help me, many thanks!
- Code: Select all
Var y, ce, cp, i, rd, pi, w, n, rl, x, k, l;
varexo a;
parameters gamma betap betae alpha delta theta xbar ybar cebar cpbar ibar rdbar pibar wbar nbar rlbar lbar kbar abar ikratio wnyratio kyratio iyratio nyratio lyratio;
betap=0.995;
betae=0.97;
alpha=0.5;
delta=0.025;
theta=0.75;
gamma=1.75;
rdbar=1/betap-1;
rlbar=rdbar;
nbar=0.24;
xbar=1.05;
ikratio=delta;
wnyratio=(1-alpha)/xbar;
kyratio=alpha*(delta-1+1/betae)/xbar;
iyratio=kyratio*ikratio;
nyratio=kyratio^((-alpha)/(1-alpha));
wbar=(1-alpha)/(xbar*nyratio);
cpbar=wbar*(1-nbar)/gamma;
ybar=nbar/nyratio;
lyratio=(1/xbar-1+cpbar/ybar-wnyratio)/rlbar;
lbar=lyratio*ybar;
ibar=iyratio*ybar;
cebar=ybar-cpbar-ibar;
kbar=ibar/delta;
cebar=ybar-cpbar-ibar;
abar=1;
pibar=1;
Model;
w/cp=gamma/(1-n);
cp(+1)/(1+rd)=betap*cp/pi(+1);
w=(1-alpha)*y/(x*n);
pi(+1)*ce(+1)=(1+rl)*betae*ce;
1/ce=betae*(1-delta+alpha*y(+1)/(x(+1)*k))/ce(+1);
ce+w*n+(1+rl(-1))*l(-1)/pi+i=y/x+l;
k=(1-delta)*k(-1)+i;
y=a*(k(-1)^alpha)*(n^(1-alpha));
y=ce+cp+i;
log(pi/pibar)=betap*log(pi(+1)/pibar)+(1-betap*theta)*(1-theta)*(log(x/xbar))/theta;
rl=rd;
log(rd/rdbar)=0.27*(1.27*log(pi(-1)/pibar)+0.13*log(y(-1)/ybar))+0.73*log(rd(-1)/rdbar);
end;
Initval;
y=ybar;
ce=cebar;
cp=cpbar;
i=ibar;
rd=rdbar;
pi=pibar;
w=wbar;
n=nbar;
rl=rlbar;
x=xbar;
l=lbar;
k=kbar;
end;
//steady;
//check;
shocks;
var a;
periods 1 2:1000;
values 2 1;
end;
simul(periods=1000);