Error in computing likelihood 1

Hi. My friends, how can I fix this error?

Error in computing likelihood for initial parameter values

ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.

ESTIMATION_CHECKS: If this is not a problem with the setting of options (check the error message below),

ESTIMATION_CHECKS: you should try using the calibrated version of the model as starting values. To do

ESTIMATION_CHECKS: this, add an empty estimated_params_init-block with use_calibration option immediately before the estimation

ESTIMATION_CHECKS: command (and after the estimated_params-block so that it does not get overwritten):

You should try using the calibrated values of your model, exactly how the error message tells you. That means between the estimated_params-block and the estimation-command you put:

estimated_params_init(use_calibration);
end;

This way the estimation starts at the calibrated values and not the ones you defined within estimated_params.

If it still does not work with the calibrated version of the model (which you should always check before proceeding to estimation), then your model has a unit root and you are missing the diffuse_filter-option.

I’m not very good at DSGE models. Please look at the attachment to see if I have applied what you and Mr. jpfeifer said correctly.

Thankstb.pdf (7.8 KB)

What I suggested, yes, the other thing not. But you should first try if it works with the calibrated parameters and only use the diffuse_filter if your model features a unit root, as mentioned by Prof. Pfeifer.

Normally, estimating models is not recommended for beginners, since it is very error prone and needs quite some experience to be done correctly and successfully.

I wrote your command in the said place Like below, please look, I wrote correctly, but it gives the error. Do I have to write a number or something else instead of this command (use_calibration)??

ERROR: far.mod: line 343, col 22: syntax error, unexpected ‘(’, expecting COMMA or ‘;’
Line 343 is also this line:
estimated_params_init(use_calibration);

Part of the model code:

rho_dg, normal_pdf, 0.95, 0.05;

rho_rmb, normal_pdf, 0.90, 0.05;

omagy_rmb, normal_pdf, -1.7, 0.05;

omagpic_rmb, normal_pdf, -1.54, 0.05;

tau, beta_pdf, 0.16, 0.07;

rho_g, beta_pdf, 0.95, 0.01;

rho_rr, normal_pdf, 0.95, 0.1;

omag_or, beta_pdf, 0.90, 0.02;

stderr u_I, inv_gamma_pdf, 0.01, inf;

stderr u_a , inv_gamma_pdf, 0.01, inf;

stderr u_or , inv_gamma_pdf, 0.01, inf;

stderr u_dc , inv_gamma_pdf, 0.01, inf;

stderr u_rmb , inv_gamma_pdf, 0.01, inf;

stderr u_g , inv_gamma_pdf, 0.01, inf;

estimated_params_init(use_calibration);

end;

//--------------------------------------------------------------

// Simulation

//--------------------------------------------------------------

estimation (datafile=khoda, mode_check, mode_compute=2, mh_jscale=0.3, mh_replic=800000, mh_drop=0.25, mh_nblocks=2, bayesian_irf, irf=20, lik_init=2);

stoch_simul (periods=2100,irf=30);

That is wrong. This is a separate block that comes after the estimated_params-command.

Excuse me, is the correct place written now?
if it is wrong, please write the correct one for me.
thank you

//observable variables

varobs I g c pic y m mb;

estimated_params_init(use_calibration);

//a1p, beta_pdf, 0.95, 0.01;

//alfa,beta_pdf, 0.412, 0.02;

//rhoa, beta_pdf, 0.95, 0.01;

//rho_or, beta_pdf, 0.95, 0.05;

car, beta_pdf, 0.1, 0.1;

kappa, beta_pdf,0.1, 0.1;

rho_zb, normal_pdf, 0.95, 0.05;

sai_zb_y, normal_pdf, -1.5, 0.05;

sai_zb_q, normal_pdf, -1.6, 0.05;

rho_dc, normal_pdf, 0.95, 0.05;

rho_dg, normal_pdf, 0.95, 0.05;

rho_rmb, normal_pdf, 0.90, 0.05;

omagy_rmb, normal_pdf, -1.7, 0.05;

omagpic_rmb, normal_pdf, -1.54, 0.05;

tau, beta_pdf, 0.16, 0.07;

rho_g, beta_pdf, 0.95, 0.01;

rho_rr, normal_pdf, 0.95, 0.1;

omag_or, beta_pdf, 0.90, 0.02;

stderr u_I, inv_gamma_pdf, 0.01, inf;

stderr u_a , inv_gamma_pdf, 0.01, inf;

stderr u_or , inv_gamma_pdf, 0.01, inf;

stderr u_dc , inv_gamma_pdf, 0.01, inf;

stderr u_rmb , inv_gamma_pdf, 0.01, inf;

stderr u_g , inv_gamma_pdf, 0.01, inf;

end;

//--------------------------------------------------------------

// Simulation

//--------------------------------------------------------------

estimation (datafile=kh, mode_check, mode_compute=2, mh_jscale=0.3, mh_replic=800000, mh_drop=0.25, mh_nblocks=2, bayesian_irf, irf=20,lik_init=2);

stoch_simul (periods=2100,irf=30);

varobs I g c pic y m mb;

estimated_params;

//a1p, beta_pdf, 0.95, 0.01;

//alfa,beta_pdf, 0.412, 0.02;

//rhoa, beta_pdf, 0.95, 0.01;

//rho_or, beta_pdf, 0.95, 0.05;

car, beta_pdf, 0.1, 0.1;

kappa, beta_pdf,0.1, 0.1;

rho_zb, normal_pdf, 0.95, 0.05;

sai_zb_y, normal_pdf, -1.5, 0.05;

sai_zb_q, normal_pdf, -1.6, 0.05;

rho_dc, normal_pdf, 0.95, 0.05;

rho_dg, normal_pdf, 0.95, 0.05;

rho_rmb, normal_pdf, 0.90, 0.05;

omagy_rmb, normal_pdf, -1.7, 0.05;

omagpic_rmb, normal_pdf, -1.54, 0.05;

tau, beta_pdf, 0.16, 0.07;

rho_g, beta_pdf, 0.95, 0.01;

rho_rr, normal_pdf, 0.95, 0.1;

omag_or, beta_pdf, 0.90, 0.02;

stderr u_I, inv_gamma_pdf, 0.01, inf;

stderr u_a , inv_gamma_pdf, 0.01, inf;

stderr u_or , inv_gamma_pdf, 0.01, inf;

stderr u_dc , inv_gamma_pdf, 0.01, inf;

stderr u_rmb , inv_gamma_pdf, 0.01, inf;

stderr u_g , inv_gamma_pdf, 0.01, inf;

end;


estimated_params_init(use_calibration);
end;

//--------------------------------------------------------------

// Simulation

//--------------------------------------------------------------

estimation (datafile=kh, mode_check, mode_compute=2, mh_jscale=0.3, mh_replic=800000, mh_drop=0.25, mh_nblocks=2, bayesian_irf, irf=20,lik_init=2);

stoch_simul (periods=2100,irf=30);

thank you so much.

The problem seems to be from somewhere else.

Errors:

Error in computing likelihood for initial parameter values

ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.
ESTIMATION_CHECKS: If this is not a problem with the setting of options (check the error message below),
ESTIMATION_CHECKS: you should try using the calibrated version of the model as starting values. To do
ESTIMATION_CHECKS: this, add an empty estimated_params_init-block with use_calibration option immediately before the estimation
ESTIMATION_CHECKS: command (and after the estimated_params-block so that it does not get overwritten):

Error using print_info (line 32)
Blanchard & Kahn conditions are not satisfied: no stable equilibrium.

Error in print_info (line 32)
error(message);

Error in initial_estimation_checks (line 196)
print_info(info, DynareOptions.noprint, DynareOptions)

Error in dynare_estimation_1 (line 164)
oo_ =
initial_estimation_checks(objective_function,xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);

Error in dynare_estimation (line 105)
dynare_estimation_1(var_list,dname);

Error in far.driver (line 775)
oo_recursive_=dynare_estimation(var_list_);

Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;
.

Again, does a calibrated version of the model work?

Yes, the model runs in calibration mode. In the case of Bayesian estimation, it goes to the previous (prior) distribution stage, after which it gives this error. Excuse me, can you send me your email? Let me send you the codes and look to see where the problem comes from.

My email is: mahsa.amiri202019@gmail.com

Excuse me, I have another question. In DSGE models, how do they solve the problem of colinear relationships between the variables and the equations between several equations and between several variables?
How to write equations so that the collinear error does not give equations and variables ??
Like the file I attached
111111.pdf (169.8 KB)

Did you take my above comment

into account?

yes,
I wrote this command
lik_init=2

But the problem was not solved.

I do not know what to do to remove the unit root

Without the file it is impossible to tell.

I wrote my email address in the messages so that you can send your email so that I can just email you my model code.

Use the private message capabilities of the forum.

I sent it in private, I do not know if you received it or not

The check-command clearly shows

EIGENVALUES:
Modulus Real Imaginary

   7.345e-17        7.345e-17                0
   1.666e-06       -2.883e-12        1.666e-06
   1.666e-06       -2.883e-12       -1.666e-06
       0.137            0.137                0
      0.4213           0.4213                0
        0.95             0.95                0
        0.95             0.95                0
        0.95             0.95                0
        0.95             0.95                0
        0.95             0.95                0
      0.9515           0.9515                0
      0.9903           0.9903                0
           1                1                0
           1                1                0
       1.188            1.168            0.221
       1.188            1.168           -0.221
       2.395           -2.395                0
   9.524e+10        9.524e+10                0
   2.103e+15        2.103e+15                0
   2.457e+17        2.457e+17                0

There are 6 eigenvalue(s) larger than 1 in modulus
for 7 forward-looking variable(s)

The rank condition ISN’T verified!

So the calibrated model does NOT work.