mode_compute=6 ; 9 : index exceeds matrix dimensions

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

mode_compute=6 ; 9 : index exceeds matrix dimensions

Postby mharding » Fri Jun 19, 2015 10:30 am

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:

Code: Select all
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

Code: Select all
Error using chol
Matrix must be positive definite.


for mode_compute=9:

Code: Select all
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.
Attachments
CD08_usdata_filt.xls
(34 KiB) Downloaded 332 times
CD08_nonlinear_est.mod
(11.47 KiB) Downloaded 80 times
mharding
 
Posts: 18
Joined: Mon Mar 16, 2015 2:18 pm

Re: mode_compute=6 ; 9 : index exceeds matrix dimensions

Postby jpfeifer » Sat Jun 20, 2015 8:50 pm

Please try the unstable version and report back.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: mode_compute=6 ; 9 : index exceeds matrix dimensions

Postby mharding » Tue Jun 23, 2015 6:23 am

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
mharding
 
Posts: 18
Joined: Mon Mar 16, 2015 2:18 pm

Re: mode_compute=6 ; 9 : index exceeds matrix dimensions

Postby jpfeifer » Thu Jun 25, 2015 6:18 pm

Yes. Or try the
Code: Select all
mcmc_jumping_covariance
option with the Hessian from first order.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: mode_compute=6 ; 9 : index exceeds matrix dimensions

Postby mharding » Wed Jul 08, 2015 6:20 am

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.
Attachments
CD08_usdata_filt.xls
(36 KiB) Downloaded 109 times
CD08_nonlinear_est_SO.mod
(12.73 KiB) Downloaded 73 times
CD08_nonlinear_est_SO_CheckPlots2.pdf
(6.52 KiB) Downloaded 64 times
CD08_nonlinear_est_SO_CheckPlots1.pdf
(8.01 KiB) Downloaded 74 times
mharding
 
Posts: 18
Joined: Mon Mar 16, 2015 2:18 pm

Re: mode_compute=6 ; 9 : index exceeds matrix dimensions

Postby jpfeifer » Wed Jul 08, 2015 7:07 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: mode_compute=6 ; 9 : index exceeds matrix dimensions

Postby mharding » Wed Jul 08, 2015 9:14 am

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).
Attachments
jumping_covariance.xls
(29.5 KiB) Downloaded 98 times
xparam1.xls
(25.5 KiB) Downloaded 95 times
mharding
 
Posts: 18
Joined: Mon Mar 16, 2015 2:18 pm

Re: mode_compute=6 ; 9 : index exceeds matrix dimensions

Postby jpfeifer » Wed Jul 08, 2015 10:06 am

Please provide the mat-file in a zip-file.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: mode_compute=6 ; 9 : index exceeds matrix dimensions

Postby mharding » Wed Jul 08, 2015 11:34 am

OK, yes that's better. Here they are.
Attachments
CD08_nonlinear_est.zip
(19.17 KiB) Downloaded 70 times
mharding
 
Posts: 18
Joined: Mon Mar 16, 2015 2:18 pm


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 7 guests