??? Attempted to access info(2); index out of bounds because

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.

??? Attempted to access info(2); index out of bounds because

Postby xiang8482890 » Wed Sep 03, 2014 9:19 am

Dear all,

I was trying out one paper "Toward a Taylor Rule for Fiscal Policy", I downloaded the data and code to repeat the exercise using the same version of dynare as reminded by the authors.

However, when I was doing the estimation part, things went smoothly at first, but then errors appeared as:

??? Attempted to access info(2); index out of bounds because numel(info)=1.

Error in ==> DsgeLikelihood at 135
fval = bayestopt_.penalty+info(2);

Error in ==> csminit at 126
f = feval(fcn,dxtest,varargin{:});

Error in ==> csminwel1 at 101
[f1 x1 fc retcode1] = csminit(fcn,x,f,g,badg,H,varargin{:});

Error in ==> dynare_estimation_1 at 204
[fval,xparam1,grad,hessian_csminwel,itct,fcount,retcodehat] = ...

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> model_baseline at 485
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;

please check the attchment for the data and code. What's the problem? Thanks!
Attachments
obsdata_first_diff2.m
(2.18 KiB) Downloaded 113 times
model_baseline.mod
(7.5 KiB) Downloaded 125 times
generate_tables_figures_est.m
(17.28 KiB) Downloaded 106 times
data_september2012.m
(43.98 KiB) Downloaded 93 times
xiang8482890
 
Posts: 9
Joined: Wed Oct 26, 2011 12:54 pm

Re: ??? Attempted to access info(2); index out of bounds bec

Postby jpfeifer » Wed Sep 03, 2014 9:39 am

The mode-file is missing. Also, you did not specify which Dynare version you were actually using. In Dynare 4.2.4, the version used by the authors, line 135 of DsgeLikelihood is
Code: Select all
    cost_flag = 0;

and not what your error message says.
------------
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: ??? Attempted to access info(2); index out of bounds bec

Postby xiang8482890 » Wed Sep 03, 2014 3:12 pm

jpfeifer wrote:The mode-file is missing. Also, you did not specify which Dynare version you were actually using. In Dynare 4.2.4, the version used by the authors, line 135 of DsgeLikelihood is
Code: Select all
    cost_flag = 0;

and not what your error message says.


Sorry that I missed two files, now I package all the files in rar document. I did use Dynare 4.2.4 and I checked that line 135 of DsgeLikelihood is cost_flag = 0, but the errors just occured that way. What can I do to possibly fix it?

Thanks so much for your patience!
Attachments
estimation.rar
(1.49 MiB) Downloaded 103 times
xiang8482890
 
Posts: 9
Joined: Wed Oct 26, 2011 12:54 pm

Re: ??? Attempted to access info(2); index out of bounds bec

Postby jpfeifer » Wed Sep 03, 2014 3:35 pm

Before the line where the crash appears in DsgeLikelihood.m, please add
Code: Select all
   
if length(info)==1
        disp(info);
 end

and report the result. It should give you an error code.
------------
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: ??? Attempted to access info(2); index out of bounds bec

Postby xiang8482890 » Thu Sep 04, 2014 2:07 am

jpfeifer wrote:Before the line where the crash appears in DsgeLikelihood.m, please add
Code: Select all
   
if length(info)==1
        disp(info);
 end

and report the result. It should give you an error code.


before I added the three-line code, the errors were:

??? Attempted to access info(2); index out of bounds because numel(info)=1.

Error in ==> DsgeLikelihood at 135
fval = bayestopt_.penalty+info(2);

Error in ==> csminit at 126
f = feval(fcn,dxtest,varargin{:});

Error in ==> csminwel1 at 101
[f1 x1 fc retcode1] = csminit(fcn,x,f,g,badg,H,varargin{:});

Error in ==> dynare_estimation_1 at 204
[fval,xparam1,grad,hessian_csminwel,itct,fcount,retcodehat] = ...

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> model_baseline at 485
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;


When I added the three-line code starting right after line 134, the errors turn to be:

??? Attempted to access info(2); index out of bounds because numel(info)=1.

Error in ==> DsgeLikelihood at 138
fval = bayestopt_.penalty+info(2);

Error in ==> csminit at 126
f = feval(fcn,dxtest,varargin{:});

Error in ==> csminwel1 at 101
[f1 x1 fc retcode1] = csminit(fcn,x,f,g,badg,H,varargin{:});

Error in ==> dynare_estimation_1 at 204
[fval,xparam1,grad,hessian_csminwel,itct,fcount,retcodehat] = ...

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> model_baseline at 485
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;


There is nothing new except that the number 135 is now 138.

T-T (crying)
xiang8482890
 
Posts: 9
Joined: Wed Oct 26, 2011 12:54 pm

Re: ??? Attempted to access info(2); index out of bounds bec

Postby jpfeifer » Thu Sep 04, 2014 4:58 am

It should still crash with the same, but before the crash it should provide a number, an error code. You only posted the crash, but not the error code.
------------
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


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 4 guests