# Simplified Iacoviello

Hi

I am trying to simulate simple IacovieIlo model. However when i am giving housing preference shocks. The output in not correct. There is housing price is moving in opposite direction to consumption, which is not correct. Request you to please help me out. I am attaching codes herewith

``````//Simulate the Iacoviello (2005) Basic Model (Stochastic Gov Spending)

//%Declare Variables
var y x c_u c_c l_u l_c w_u w_c dp h_u h_c q b_c r c J;
varexo eg;
parameters BETA_S, BETA_B, ETA, M, GAMMA, X, THETA, RHO, PHIP, XSS, KTILDE, PHIY, RHOG, GBAR, PP, J_ss;

//%------------------------------
//% DEFINE PARAMETERS
//%------------------------------

BETA_S=0.99;
BETA_B=0.98;
J_ss=0.1;
XSS=1.2;
KTILDE=0.0858;
ETA=1.01;
M=0.9;
GAMMA=0.64;
X=1.2;
THETA=0.75;
RHO=0.8;
PHIP=0.5;
PHIY=0.5;
STDERR_AE=0.0029;
RHOG=0.8;
GBAR=0.3;
PP=0.95;

//%------------------------------
//% MODEL EQUATIONS
//%------------------------------

model;

//----SAVERS---//
1/exp(c_u) = BETA_S*exp(r)/(exp(dp(+1))*exp(c_u(+1)));
exp(w_u)=((exp(l_u))^(ETA-1))*exp(c_u);
J/exp(h_u) = exp(q)/exp(c_u) - (BETA_S*exp(q(+1)))/exp(c_u(+1));

//---BORROWERS---//
exp(c_c)= exp(w_c)*exp(l_c)+exp(b_c)+exp(q)*(exp(h_c(-1))-exp(h_c))-(exp(r(-1))*exp(b_c(-1)))/exp(dp);
exp(w_c)=exp(l_c)^(ETA-1)*exp(c_c);
J/exp(h_c) = (1/exp(c_c))*(exp(q)-(M*exp(q(+1))*exp(dp(+1)))/exp(r))- BETA_B*(1-M)*(exp(q(+1))/exp(c_c(+1)));
J=PP*J_ss-eg;
//--Collateral constraint--//
exp(b_c)=(M*exp(h_c)/exp(r))*exp(q(+1))*exp(dp(+1));

//--FIRMS--//

exp(w_u)=GAMMA*(exp(l_u))^(GAMMA-1)*(exp(l_c))^(1-GAMMA)*(1/exp(x));
exp(w_c)=GAMMA*((exp(l_u))^GAMMA)*((exp(l_c))^(-GAMMA))*(1/exp(x));
exp(y)=((exp(l_u))^GAMMA*(exp(l_c))^(1-GAMMA));

//--NKPC--//
dp = BETA_S*dp(+1)- KTILDE*(x-log(XSS));

//--TAYLOR RULE--//
//--OPTION 1: Extended--//
r = RHO*r(-1)+(1-RHO)*(1+PHIP)*dp+(1-RHO)*PHIY*y +(1-RHO)*log(1/BETA_S);

//--MARKET CLEARING--//
exp(h_u)+exp(h_c)=1;
exp(c)=exp(c_u)+exp(c_c);
exp(y)=exp(c_u)+exp(c_c);
end;

//--INITIAL VALUE BLOCK--//
initval;

c_u=0;
c_c=0;
w_u=0;
w_c=0;
b_c=0;
l_u=0;
l_c=0;
h_u=0;
h_c=0;
dp=0;
r=0.01;
y=0;
q=0;
x=0;
end;