DSGE model Estimation Problem. Matlab Stops working

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;

To run your code, the data file is needed as well.

Dear Sir,
Data is given in the data file namely DSGEdynaredata.xlsx (64.5 KB) above in the previous post

You only defined 5 variables, but there are 10 equations.

There are five endogenous and five exogenous (state) variables. State variables are shocks and following the AR(1) process. Please check the attached pdf file in which model has been described and kindly suggest the procedure so that the model can be estimated.
Model.pdf (245.2 KB)

The left hand side variables are still endogenous and to be defined as such. It is the epsilon, i.e. the innovations that are exogenous variables in Dynare.

Question1: Does r, v, k, l and O need to be included in the enodogenous list? If yes, does the data of these five variables need to be included in the data file in excel?

I have included total ten endogenous variables in the list x i p g b r v k l O but matlab still stops working

This is the message i got in matlab when i run the program

Please provide the updated file

myexample.dyn (2.9 KB) DSGEdynaredata.xlsx (64.5 KB)

Respected Johannes Pfeifer Sir,
As desired by you, the .dyn file and data file in .xlsx format are attached. The error has already been communicated. Kindly suggest a solution. Your name will be duly acknowledged in my publications.
Best Regards

Your code contains strange invisible characters. Please use a standard ASCII editor.

Respected Sir,
I am attaching datafile with updated codes, but still getting error in estimating the model. Please check and suggest the solution. DSGEdynaredata.xlsx (64.5 KB) myexample.dyn (1.6 KB)

The screenshot of the error is shown in the attached file. shot.pdf (130.1 KB)

As Dynare says

Warning: Some of the parameters have no value (ghe0, ghe1, ghe2, ghe3, ghe4, ghe5, theta0, theta1, theta2,
theta3, theta4, theta5, chi_r, chi_v, chi_k, chi_l, chi_O) when using steady. If these parameters are not
initialized in a steadystate file or a steady_state_model-block, Dynare may not be able to solve the model…

Hello everyone.

I have a problem related to running the code and the output. I work at Octave and I don’t know if it has any effect on the result. However, here’s the code Monetary policy schock.pdf (346.1 KB) if anyone can run it in Matlab and send me the output?

Please upload the mod-file and the parameter-file you are loading. The pdf screws up the character encoding.

zad5.m (2.6 KB) zad5.mod (2.6 KB) DSGE_MP_parameters.mat (179 Bytes)

ok can anyone help me with this? I don’t know what I forgot, what I didn’t do right?

Dear professor,

here is my model which I must solve using Dynare. I don’t know what I did wrong but I can’t run the code. I run the code and then only see figures without lines, what do I have to do to get lines too?

Thank you