thanks a lot for the help in this forum first, many of my questions were answered only by reading foreign topics. It is really good, to have such a world-wide community stick together!
But right now I am facing some problems, that I cant explain. I am replicating a model, used by Robert E. Hall 2011 to explain the fluctuations of aftercrisis US-economy with financial friction as a driving source. He implements the friciton as a exogenous driven shock that rises the price of capital for firms and housing for household. Households choose their consumption between "usual" consumption and durable goods and housing, so we have two different kinds of capital here.
The paper: http://www.federalreserve.gov/events/co ... 120909.pdf
Ok, my model doesn't replicate his results correct, but this is fine for me now, because I have to hand in my thesis on monday and ... better this, than nothing. The problem I am facing right now, and which I can't explain to myself, is: I put an exp() around each endogenous variable, but right know, I get some timing problems!!! This is really driving me crazy, and so I am hoping, that some intelligent genius can help me. If you are reading this ... I would be glad, if you help me
Soooo, my code that is running some kind of impulse responses:
- Code: Select all
var y, py, k, d, r, w, c, pk, pd, h, qk, qd, cy, m, mu, f;
varexo e;
parameters sigma, chi, psi, beta, phi, alpha, kappa_k, kappa_d, delta_k, delta_d, omega, rho, rho_g;
sigma = 0.41;
chi = 1.01;
//chi = -1.6713;
//chi = 0.334; // from Hall 2009b
psi = 1.66;
//psi = 1.54; // from Hall 2009b
//psi = 0.66; // guess
beta = 0.987;
phi = 0.82;
alpha = 0.646;
kappa_k = 8.0;
kappa_d = 8.0;
delta_k = 0.0188;
delta_d = 0.0129;
omega = 1.03;
rho = 0.60;
rho_g = 0.60;
// ##############################################################
// ### Model normal ###
// ##############################################################
model;
y = (h^alpha) * (k(-1)^(1-alpha));
(1-alpha) * (py * y) / (mu * pk) = k(-1);
//pd * d(-1) = (1 - phi) * c;
pd(+1) * d = (1 - phi) * c(+1);
(w * c^(-1/sigma)) * (1-chi*(1-1/sigma)*h^(1+1/psi)) = (-1*h^(1/psi))*(-chi*(1+1/psi)*c^(1-1/sigma)-1);
(1+r)*m = 1;
y = cy + 0.2 + k - (1-delta_k)*k(-1) + (kappa_k/2) * (((k-k(-1))^2)/k(-1)) + d - (1-delta_d)*d(-1) + ((kappa_d/2)*((d-d(-1))^2)/d(-1));
(phi^(-phi)) * ((1-phi)^(-(1-phi))) * (py^phi) * (pd^(1-phi)) = 1;
//pk = (1 + r(-1)) * (1 + f(-1)) * qk(-1) * py(-1) - (1-delta_k) * qk * py;
//pd = (1 + r(-1)) * (1 + f(-1)) * qd(-1) * py(-1) - (1-delta_d) * qd * py;
pk(+1) = (1 + r) * (1 + f) * qk * py - (1-delta_k) * qk(+1) * py(+1);
pd(+1) = (1 + r) * (1 + f) * qd * py - (1-delta_d) * qd(+1) * py(+1);
// ##### Auxilary Model #####
h = alpha * (py*y) / (mu*w);
qk = kappa_k * (k - k(-1))/(k(-1)) + 1;
qd = kappa_d * (d - d(-1))/(d(-1)) + 1;
cy = phi*c/py;
m = beta * (((c(+1)^(-1/sigma))/c^(-1/sigma)) * ((1-chi*(1-1/sigma)*(h(+1))^(1+1/psi)) / (1-chi*(1-1/sigma)*h^(1+1/psi))));
mu = (y/1.89942907558276)^(-omega);
f = rho*f(-1) + e;
end;
initval;
y = 1.89942907558276;
py = 1.2054994131041;
k = 21.2073462421196;
d = 9.9703287551424;
r = 0.0129058949799601;
w = 2.92156533602169;
c = 1.72314927796078;
pk = 0.038221437790282;
pd = 0.0311089912529679;
h = 0.506298918774804;
qk = 1;
qd = 1;
cy = 1.17211372528957;
m = 0.987258544901434;
mu = 1;
f = 0;
end;
steady;
//model_diagnostics(M_,options_,oo_) ;
check;
write_latex_dynamic_model;
shocks;
var e = 0.015;
//var e_g = 1;
//var e; stderr 0.015;
end;
stoch_simul(order = 1, irf = 10) y k d r pk pd f c h;
And now get ready for my exp-version of the model, that is somehow NOT working. And please be so kind and show me the mistake I made, and that I am not able to find.
- Code: Select all
var y, py, k, d, r, w, c, pk, pd, h, qk, qd, cy, m, mu, f;
varexo e;
parameters sigma, chi, psi, beta, phi, alpha, kappa_k, kappa_d, delta_k, delta_d, omega, rho, rho_g;
sigma = 0.41;
chi = 1.01;
//chi = -1.6713;
//chi = 0.334; // from Hall 2009b
psi = 1.66;
//psi = 1.54; // from Hall 2009b
//psi = 0.66; // guess
beta = 0.987;
phi = 0.82;
alpha = 0.646;
kappa_k = 8.0;
kappa_d = 8.0;
delta_k = 0.0188;
delta_d = 0.0129;
omega = 1.03;
rho = 0.60;
rho_g = 0.60;
// ##############################################################
// ### Model exp ###
// ##############################################################
//## on: ( ) || off: (/*) ##
model;
exp(y) = (exp(h)^alpha) * (exp(k(-1))^(1-alpha));
(1-alpha) * (exp(py) * exp(y)) / (exp(mu) * exp(pk)) = exp(k(-1));
exp(pd) * exp(d(-1)) = (1 - phi) * exp(c);
//exp(pd(+1)) * exp(d) = (1 - phi) * exp(c(+1));
(exp(w) * exp(c)^(-1/sigma)) * (1-chi*(1-1/sigma)*exp(h)^(1+1/psi)) = (-1*exp(h)^(1/psi))*(-chi*(1+1/psi)*exp(c)^(1-1/sigma)-1);
(1+exp(r))*exp(m) = 1;
exp(y) = exp(cy) + 0.2 + exp(k) - (1-delta_k)*exp(k(-1)) + (kappa_k/2) * (((exp(k)-exp(k(-1)))^2)/exp(k(-1))) + exp(d) - (1-delta_d)*exp(d(-1)) + ((kappa_d/2)*((exp(d)-exp(d(-1)))^2)/exp(d(-1)));
(phi^(-phi)) * ((1-phi)^(-(1-phi))) * (exp(py)^phi) * (exp(pd)^(1-phi)) = 1;
exp(pk) = (1 + exp(r(-1))) * (1 + exp(f(-1))) * exp(qk(-1)) * exp(py(-1)) - (1-delta_k) * exp(qk) * exp(py);
exp(pd) = (1 + exp(r(-1))) * (1 + exp(f(-1))) * exp(qd(-1)) * exp(py(-1)) - (1-delta_d) * exp(qd) * exp(py);
//exp(pk(+1)) = (1 + exp(r)) * (1 + exp(f)) * exp(qk) * exp(py) - (1-delta_k) * exp(qk(+1)) * exp(py(+1));
//exp(pd(+1)) = (1 + exp(r)) * (1 + exp(f)) * exp(qd) * exp(py) - (1-delta_d) * exp(qd(+1)) * exp(py(+1));
// ##### Auxilary Model #####
exp(h) = alpha * (exp(py)*exp(y)) / (exp(mu)*exp(w));
exp(qk) = kappa_k * (exp(k) - exp(k(-1)))/(exp(k(-1))) + 1;
exp(qd) = kappa_d * (exp(d) - exp(d(-1)))/(exp(d(-1))) + 1;
exp(cy) = phi*exp(c)/exp(py);
exp(m) = beta * (((exp(c(+1))^(-1/sigma))/exp(c)^(-1/sigma)) * ((1-chi*(1-1/sigma)*(exp(h(+1)))^(1+1/psi)) / (1-chi*(1-1/sigma)*exp(h)^(1+1/psi))));
//exp(m(-1)) = beta * (((exp(c(0))^(-1/sigma))/exp(c(-1))^(-1/sigma)) * ((1-chi*(1-1/sigma)*(exp(h(0)))^(1+1/psi)) / (1-chi*(1-1/sigma)*exp(h(-1))^(1+1/psi))));
exp(mu) = (exp(y)/exp(1.89942907558276))^(-omega);
f = rho*f(-1) + e;
end;
initval;
y = log(1.89942907558276);
py = log(1.2054994131041);
k = log(21.2073462421196);
d = log(9.9703287551424);
r = log(0.0129058949799601);
w = log(2.92156533602169);
c = log(1.72314927796078);
pk = log(0.038221437790282);
pd = log(0.0311089912529679);
h = log(0.506298918774804);
qk = log(1);
qd = log(1);
cy = log(1.17211372528957);
m = log(0.987258544901434);
mu = log(1);
f = 0;
end;
steady;
check;
shocks;
var e = 0.015;
end;
stoch_simul(order = 1, irf = 10) y k d r pk pd f;
If you can help me:
Thanks a lot
Valentin
P.S. If there is someone outside, that can help me to replicate Halls results correctly, I will regard him or her as a friend and he or she will be my guest in berlin, providing a deep look into the beautiful and funny side of this city ... ... ... seriously