Dear Community, I am trying to estimate the following DSGE model using the data file DSGEdynaredata.xlsx (64.5 KB), but when I run the model, Matlab stops working. Please fix the problem.
//List of variables
var x i p g b;
//Exogenous shocks
varexo eta_r eta_v eta_k eta_l eta_O;
parameters sigma alpha kappa beta ghe1 ghe2 ghe3 ghe4 ghe5 theta0 theta1 theta2 theta3 theta4 theta5 chi_r chi_v chi_k chi_l chi_O istar bbar omegabar;
sigma = 5.00;
alpha = 0.20;
kappa = 0.50;
beta = 0.99;
istar = 0.07;
bbar = 0.20;
omegabar = 0.26;
model;
x = x(+1) - sigma*(i - p(+1)) + alpha*b + r;
p = kappa*x + beta*p(+1) + v;
b = (1 + istar)*b(-1) + bbar*i + g - omegabar*x + k;
i = ghe1*i(-1) - ghe2*i(-2) + ghe3*p + ghe4*x - ghe5*x(-1) + l;
g = - theta0*p + theta1*g(-1) - theta2*g(-2) + theta3*g(+1) - theta4*x + theta5*x(-1) + O;
r = chi_r*r(-1) + eta_r;
v = chi_v*v(-1) + eta_v;
k = chi_k*k(-1) + eta_k;
l = chi_l*l(-1) + eta_l;
O = chi_O*O(-1) + eta_O;
end;
varobs x i p g b;
estimated_params;
chi_r, beta_pdf, 0.8, 0.05;
chi_v, beta_pdf, 0.8, 0.05;
chi_k, beta_pdf, 0.8, 0.05;
chi_l, beta_pdf, 0.8, 0.05;
chi_O, beta_pdf, 0.8, 0.05;
stderr eta_r, inv_gamma_pdf, 0.04, inf;
stderr eta_v, inv_gamma_pdf, 0.04, inf;
stderr eta_k, inv_gamma_pdf, 0.04, inf;
stderr eta_l, inv_gamma_pdf, 0.04, inf;
stderr eta_O, inv_gamma_pdf, 0.04, inf;
end;
estimation(datafile = DSGEdynaredata, mh_replic = 20000, mh_nblocks = 2, mh_drop = 0.45, mh_jscale = 0.4, first_obs = 1,
mode_compute = 4, mode_check, bayesian_irf) x i p g b;
stoch_simul(irf = 10, order=1, relative_irf) x i p g b;