Mode_compute=6 ; 9 : index exceeds matrix dimensions

Dear all,

I have a nonlinear version of a medium-scale DSGE model and I am trying to implement the particle filter triggered by estimation(order=2,…).

For this, I need to use some algorithm like mode_compute=6 or 9. The problem is that when I try these options, (even for etimation at first order) the algorithm crashes with the following error:

for mode_compute=6:

Index exceeds matrix dimensions. Error in dsge_likelihood (line 301) constant = SteadyState(BayesInfo.mfys); Error in gmhmaxlik (line 108) logpo2 = - feval(ObjFun,proposal,varargin{:}); Error in dynare_estimation_1 (line 437) [xparam1,PostVar,Scale,PostMean] = ... Error in dynare_estimation (line 89) dynare_estimation_1(var_list,dname); Error in CD08_nonlinear_est (line 536) dynare_estimation(var_list_); Error in dynare (line 180) evalin('base',fname) ;

and also for some tries of this algorithm I’ve gotten the widely discussed error

Error using chol Matrix must be positive definite.

for mode_compute=9:

Index exceeds matrix dimensions. Error in dsge_likelihood (line 301) constant = SteadyState(BayesInfo.mfys); Error in cmaes (line 948) fitness.raw(k) = feval(fitfun, arxvalid(:,k), varargin{:}); Error in dynare_estimation_1 (line 526) [x, fval, COUNTEVAL, STOPFLAG, OUT, BESTEVER] = cmaes(func2str(objective_function),xparam1,H0,cmaesOptions,dataset_,options_,M_,estim_params_,bayestopt_,oo_); Error in dynare_estimation (line 89) dynare_estimation_1(var_list,dname); Error in CD08_nonlinear_est (line 536) dynare_estimation(var_list_); Error in dynare (line 180) evalin('base',fname) ;

I have run several identification tests to check that all parameters are identified, used the use_calibration option for estimated_params_init option, tried different jumping matrices for the mcmc_jumping_covariance option, but nothing seems to work.

Any further suggestions on how to try to overcome this issue (or to implement the particle filter in general) are highly appreciated.
CD08_usdata_filt.xls (34 KB)
CD08_nonlinear_est.mod (11.5 KB)

Please try the unstable version and report back.

Dear Johannes,

thank you. With the unstable version the problem is solved for both estimation at first and second order. Using mode_compute=9, the computing time for the particle filter is of 9h32min (with an Intel Core i7-4600U, 2.7GHz, 64-bit and 4GB RAM). Now I’m dealing with the problem that the hessian is not positive definite at the mode, but I suppose I should find suitable values for a positive definite hessian at fisrt order, and then try at second order.

Thank you again for your help.

Martin

Yes. Or try the mcmc_jumping_covariance option with the Hessian from first order.

Thank you Johannes.

Another issue: the acceptance rate of the MCMC remains extremely low, it doesn’t matter how low I set the mh_jscale value. Hence, the algorithm tends to get stuck in some subspace of the parameter space. Any idea on how to increase the acceptance rate?

And one follow up question regarding mode_check plots: can they be interpreted just as with the Kalman filter? As can be seen from the pdfs attached, the likelihood appears to jump up and down in this case rather than behave smoothly.
CD08_usdata_filt.xls (36 KB)
CD08_nonlinear_est_SO.mod (12.7 KB)
CD08_nonlinear_est_SO_CheckPlots2.pdf (6.52 KB)
CD08_nonlinear_est_SO_CheckPlots1.pdf (8.01 KB)

Dear Martin, the mode-file is missing.

Regarding mode_check: in principle the interpretation is the same, but in case of the particle filter, the likelihood function is not differentiable anymore as different parameters might result in different particles being selected. This explains the random chatter.

Dear Johannes,
thank you. Here is the mode-file and the MCMC jumping covariance matrix that I’m using, which is the hessian at first order (I converted the files to .xls since the .mat format apparently is not supported for uploading).
jumping_covariance.xls (29.5 KB)
xparam1.xls (25.5 KB)

Please provide the mat-file in a zip-file.

OK, yes that’s better. Here they are.
CD08_nonlinear_est.zip (19.2 KB)