I am trying to run the RBC model which consists of households,intermediate goods firms and finals goods firms. The thing that I want to see is how the economy reacts to the shock in foreign price good which is used in production of the final good. I have been trying to model it for 3 weeks but for some reason it doesn't work. Could you please tell me what am I doing wrong or suggest some method? I have attached the mod file
Thank you!
- Code: Select all
// 1.Preamble
var c lab wage k r d lm rp y dt pm ystar inv z;
varexo epsz;
parameters alpha pstar psi beta dbar rstar sigmaz rhoz lambda mu delta theta ;
// 2.Calibration
theta =0.36;
psi = 0.001;
beta = 0.87;
dbar = 0.007;
rstar = (1/beta)-1;
lambda = 0.61;
mu=0.69;
alpha= 0.32;
delta = 0.1255;
rhoz = 0.765;
sigmaz = 0.027;
pstar =1 ;
ky = alpha/(1/beta - 1 + delta);
cy = 1- ky*delta;
// 3.Model
model;
//HOUSEHOLDS:
lm = (theta/c); // 1 FOC wrt Ct Marginal Utility of Consumption
1-theta/1-lab= lm*wage; // 2 FOC wrt Lt Labor Supply
lm = lm(+1)*beta*(dt(+1)-delta+1); // 3 FOC wrt Kt Euler Equation for Capital
lm = lm(+1)*beta*(1+r(+1)); // 4 FOC wrt Dt Euler Equation for Bonds
rp = psi*(exp(d(-1)-dbar)-1); // 5 Given in Grohe model
r = rstar + rp; // 6 Given in Garcia Cicco Model
// INTERMEDIATE GOODS FIRM:
alpha*y/k(-1)= dt; // 7 FOC wrt Kt Demand for capital
(1-alpha)*y/lab = wage; // 8 FOC wrt Lt Labor Demand
// FINAL GOODS PRODUCING:
(lambda*y^(mu)+(1-lambda)*ystar^(mu))^((1/mu)-1)*lambda*(y^mu-1)= pm; // 9 Demand for domestic input
(lambda*y^(mu)+(1-lambda)*ystar^(mu))^((1/mu)-1)*(1-lambda)*(ystar^mu-1)= exp(z)*pstar; // 10 Demand for foreign input
//MARKET CLEARING
c+inv+d = wage*lab+dt*k(-1)+d(-1)*(1+r); // 11 Household budget Constraint
k = (1-delta)*k(-1)+inv; // 12 Law motion of Capital
y = (k(-1)^alpha)*(lab^1-alpha); // 13 Intermediate Goods Sector
// FOREIGN PRICE SHOCK
z = rhoz*z(-1) + epsz; // 14
end;
// 4.Computation of the steady state
initval; // pm pstar mstar z;
lab = 1/(1+ cy*theta);
y = ky^(alpha/(1-alpha))*lab;
k=ky*y;
c=cy*y;
inv = delta*k;
wage = (1-alpha)*y/lab;
lm = theta/c;
dt = (1/beta-1+delta);
r = rstar;
d = dbar;
rp =0;
pm=pstar;
z = 0;
ystar = ((y^mu-1)*lambda/1-lambda)^1/mu-1;
end;
// 4.Shocks
shocks ;
var epsz = sigmaz^2;
end;
%check;
resid(1);
steady(solve_algo=0);
stoch_simul(periods=10000,irf=100,order=1);