Recursive Forecasting issues with Dynare 4.5.2


Dear all,
I am in trouble with recursive forecasting routine. It will be a bit lengthy but I need to set things out such that my question is, hopefully, clear.

I am estimating a version of SW07 for an european country’.

I have 90 observations (actually, I have 93, but since first_obs=4 they end up being just 90) available and I am estimating recursively my model from period 45 onward (i.e. ‘‘nobs[45:90]’’ to obtain recursive forecasts.

Since the recursive forecasting procedure is very time consuming, before launching it, I always make sure the estimation procedure does not get stuck at any of the sample points. That is, I just run the code recursively by hands for nobs[45:90], [46:90]…[90:90], just to check whether the M-H initialization is fine (I stop it when I see it is fine and go further). This strategy has always been working.

The point is that now a strange thing happens. When the fully automated recursive estimation procedure is launched in dynare, the model recursive estimation is fine until period 88, where it gets stuck as the MH initialization gives the following error message :

Error using chol
Matrix must be positive definite.

Error in metropolis_hastings_initialization (line 68)
d = chol(vv);

Error in random_walk_metropolis_hastings (line 63)
** metropolis_hastings_initialization(TargetFun, xparam1, vv, mh_bounds,dataset_,options_,M_,estim_params_,bayestopt_,oo_);**

Error in dynare_estimation_1 (line 782)
** feval(options_.posterior_sampling_method,objective_function,options_.proposal_distribution,xparam1,invhess,bounds,dataset_,options_,M_,estim_params_,bayestopt_,oo_);**

Error in dynare_estimation (line 77)
** dynare_estimation_1(var_list,M_.dname);**

Error in fbc_es_forecasting_noredr_consCY (line 957)

Error in dynare (line 181)
evalin(‘base’,fname) ;

However, if I try to rerun it for nobs[88:90] it works fine. That is pretty strange.

The point is that, why? If I let the routine start automatically from nobs[88:90] it works, if I let it start from nobs[45:90] it stops at 88 (that is the one corresponding to nobs[88:90]).

I am a bit puzzled, does anybody have a clue on why this happens? Am I missing something?

Thank you in advance,




My guess is that it has to do with mode-finding. A restart with [88:90] uses the prior mean by default as the starting point. [45:90] would use the posterior mean for 87 as the starting point for 88.


I see, it makes sense. Any suggestion on how I can fix it?


Which mode-finder did you use? I would recommend 5 in this case.


I was going with 4. I switch to 5 now.

many thanks!


Just for sake of correctness and completeness: it worked fine after your suggestion has been implemented.

Many Thanks