DsgeVarLikelihood of Dynare 4.0.0 vs. Inestable Version

I am using codes written by Tim Robinson to compute forecast error (RMSE), in Dynare 4.0.0, especifically the DsgeVarLikelihood function:

[fval, cost_flag, info, PHI_STACKED, SIGMA, iXX] = DsgeVarLikelihood(xparam1, gend)


xparam1 : value of vector of estimated parameters
gend : Number of observations in the sample

I would like to use the unstable version of Dynare because it is faster than Dynare 4.0.0, but in this last I get this error:

Error using dsge_var_likelihood (line 80)
Not enough input arguments.

Could you please help me to use the dsge_var_likelihood function and define inputs in the inestable version?

Also, I have another question, when I invoke options_.nobs in inestable version I get a different value of the 4.0.0 version.

Thanks in advance


In the unstable version, the syntax is

where most of the inputs come from the call to

[dataset_, dataset_info, xparam1, hh, M_, options_, oo_, estim_params_, bayestopt_, bounds] = ... dynare_estimation_init(var_list_, dname, ], M_, options_, oo_, estim_params_, bayestopt_);

Regarding your second question: what exactly do you mean? I would need more details

Thanks jpfeifer,

  1. About the last question, I mean when I run my .mod I get options_.nobs = 32 in unstable version, which is size of my data,
    but in 4.4.3 and previous versions I get options_.nobs = 28.

  2. By other side, when I try to use dsge_var_likelihood function running this:

[code] dynare mymod

options_.first_obs = 5;
options_.nobs = NaN;
[dataset_, dataset_info, xparam1, hh, M_, options_, oo_, estim_params_, bayestopt_, bounds] = …
dynare_estimation_init(var_list_, ], ], M_, options_, oo_, estim_params_, bayestopt_);

[fval,info,exit_flag,grad,hess,SteadyState,trend_coeff,PHI_tilde,SIGMA_u_tilde,iXX,prior] = …

I get size(PHI_tilde,1) = 20. But It should be 10 (=5x2) because I have five observable variables and I set

options_.varlag = 2;

  1. What would be the rigth form to loop over dsge_prior_weight option and over sample size to get PHI_tilde and SIGMA_u_tilde. I loop over dsge_prior_weight in a .mod and I loop over sample size in a .m file. But I see when I loop in a .mod (over dsge_prior_weight) dynare estimates twice, it makes slow this method, because in each iteration I run my .mod and after I run dynare_estimation(var_list_). I attach my files.
    question.rar (17.4 KB)

1- That is a matter of the changed internal treatment. In 4.4.3 nobs deducted the options_.first_obs. But that should not affect the results.
2. You are setting the wrong option for the lag number. It should be

Thus, you are still at the default of 4.
3. You should be able to change the prior weight within a loop via