I insert my code as follows. I'll really appreciate it if you can provide me any clue. Thank you.
Anita
- Code: Select all
var a y c ca cn cstar h ha hn gs qs s g wr rf r rstar rr rrf pih pistar brhat drhat ndrhat tr tra tbhat;
varexo nua nug nucstar nupistar nurstar;
parameters N Y WR TBhat lambda alpha eta alphastar varphi rho beta chi phi epsilon theta psigg psigd psitg psitd byhat dyhat cy gy cstary tr_y rfs rs rstars rhoa rhocstar rhopistar rhorstar;
lambda=1/3;
alpha=0.2;
eta=2/3;
alphastar=0.2;
varphi=1;
rho=1;
beta=0.98;
chi=0;
phi=1.5;
epsilon=21;
theta=75;
psigg=0.9;
psigd=-0.02;
psitg=0.5;
psitd=0.02;
rfs=1/beta;
rs=1/beta;
rstars=1/beta;
N=1;
Y=1;
WR=(epsilon-1)/epsilon;
byhat=1;
dyhat=1;
cy=WR^(1/rho);
gy=1-lambda*WR-(1-lambda)*cy;
TBhat=1;
cstary=(alpha*cy)/alphastar;
tr_y=gy;
rhoa=0.85;
rhocstar=0.8;
rhopistar=0.75;
rhorstar=0.9;
model(linear);
y = a+h;
y = ((1-alpha)*cy*(c+eta*gs))+(gy*g)+(alphastar*cstary*(eta*(qs+gs)+cstar));
wr = varphi*ha+rho*ca;
wr = varphi*hn+rho*cn;
r = pih(+1)+rho*(ca(+1)-ca)-(gs-gs(+1));
rfs*rf = (rfs+chi*(1-lambda)*(dyhat-1/Y))*(rho*(ca(+1)-ca)-qs(+1)+qs+pistar(+1))-chi*(1-lambda)*(dyhat*(drhat-y)+y/Y);
rfs*rf = rstars*rstar+chi*(byhat*(brhat-y)+(1-lambda)*dyhat*(drhat-y)+(2-lambda)*y/Y);
r = phi*pih/rs;
pih = beta*pih(+1)+(epsilon-1)*N*(wr+gs-a)/theta;
tr_y*tr+byhat*brhat = gy*(g-gs)+rfs*byhat*brhat(-1);
TBhat*tbhat = y-cy*(c+gs)-gy*g;
g = psigg*g(-1)+psigd*rfs*byhat*brhat(-1)/gy+nug;
tr_y*tr = gy*psitg*(g-gs)+psitd*byhat*rfs*brhat(-1);
cy*ca+dyhat*(rfs*drhat(-1)-drhat)+(dyhat-(1/Y))*rfs*(rf(-1)+qs-qs(-1)-pistar) = (y-gs-lambda*WR*(wr+hn)-tr_y*tra)/(1-lambda);
cy*cn = WR*(wr+hn);
c = (1-lambda)*ca+lambda*cn;
h = (1-lambda)*ha+lambda*hn;
tr = tra;
a = rhoa*a(-1)+nua;
cstar = rhocstar*cstar(-1)+nucstar;
pistar = rhopistar*pistar(-1)+nupistar;
rstar = rhorstar*rstar(-1)+nurstar;
rr = r+(gs-gs(+1)-pih(+1));
rrf = rf+(qs(+1)-qs-pistar(+1));
gs = alpha*s;
qs = (1-alphastar)*s-gs;
ndrhat = brhat+(1-lambda)*drhat;
end;
steady;
resid(1);
check;
shocks;
var nua;
stderr 0.007;
var nug;
stderr 0.008;
var nucstar;
stderr 0.007;
var nupistar;
stderr 0.007;
var nurstar;
stderr 0.008;
end;
stoch_simul(irf=40,periods=2100);