Index out of bounds because size(estim_params_.var_endo)

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.

Index out of bounds because size(estim_params_.var_endo)

Postby ptr » Sun Mar 15, 2015 11:10 am

Dear Dynare community,

Am estimating a baseline RBC model of Garcia Cicco et al 2010 from JPfeifer replication files on https://sites.google.com/site/pfeiferecon/dynare. However, dynare yields below error.

There are 6 eigenvalue(s) larger than 1 in modulus
for 6 forward-looking variable(s)

The rank condition is verified.

??? Attempted to access estim_params_.var_endo(:,1); index out of bounds because
size(estim_params_.var_endo)=[0,0].

Error in ==> BRBC at 242
tmp1 = find(estim_params_.var_endo(:,1)==11);

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

Various restriction on estimation command (datafile=Book1, mode_check, mode_compute=6, moments_varendo, mh_nblocks=1, mh_replic=2000000) g_y g_c g_i t_b_y; doesn't resolve the problem.

What could be the problem with my code.

Kind Regards.
Attachments
Book1.xls
(11.74 KiB) Downloaded 115 times
BRBC.mod
(3.58 KiB) Downloaded 107 times
ptr
 
Posts: 30
Joined: Fri Apr 19, 2013 9:58 am

Re: Index out of bounds because size(estim_params_.var_endo)

Postby jpfeifer » Sun Mar 15, 2015 5:45 pm

You are trying to specify initial values on parameters that are not specified to be estimated. In particular, you set the starting value for measurement error, but you did not specify measurement error.
------------
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: Index out of bounds because size(estim_params_.var_endo)

Postby ptr » Mon Mar 16, 2015 4:17 pm

I've tried to specify measurement errors eg psi, uniform_pdf,,, 0, 5; in vain. Any additional tip/ trick?
ptr
 
Posts: 30
Joined: Fri Apr 19, 2013 9:58 am

Re: Index out of bounds because size(estim_params_.var_endo)

Postby jpfeifer » Mon Mar 16, 2015 4:20 pm

Which code exactly did you try?
------------
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: Index out of bounds because size(estim_params_.var_endo)

Postby ptr » Mon Mar 16, 2015 10:09 pm

Garcia Cicco et al 2010 replication code.
ptr
 
Posts: 30
Joined: Fri Apr 19, 2013 9:58 am

Re: Index out of bounds because size(estim_params_.var_endo)

Postby jpfeifer » Tue Mar 17, 2015 8:48 am

My replication code runs. I told you to correctly specify the measurement error. You posted some cryptic code snipped that does not work:
ve tried to specify measurement errors eg psi, uniform_pdf,,, 0, 5; in vain.

But how exactly did you try to specify the measurement error?
------------
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: Index out of bounds because size(estim_params_.var_endo)

Postby ptr » Sun Mar 22, 2015 1:54 am

I have done the following (see attached revised code):

1) specified measurement errors as you suggest in,
https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf?attredirects=0
.
using the two approaches separately.

2) provided explicit starting values for the parameters instead of starting at the priors.
The error generated is
Error in ==> dynare_estimation_init at 253
plot_priors(bayestopt_,M_,estim_params_,options_)

Error in ==> dynare_estimation_1 at 81
[dataset_,xparam1, hh, M_, options_, oo_, estim_params_,bayestopt_] =
dynare_estimation_init(var_list_, dname, [], M_, options_, oo_, estim_params_,
bayestopt_);
.

Besides you replication files does not run as well with the error
ERROR: in the 'steady_state' block, variable 'tb' is undefined in the declaration of variable 'tb'
although the steady state block is specified.

What (am I not doing right) is the problem with my code?
Attachments
BRBC.mod
(4.79 KiB) Downloaded 102 times
ptr
 
Posts: 30
Joined: Fri Apr 19, 2013 9:58 am

Re: Index out of bounds because size(estim_params_.var_endo)

Postby jpfeifer » Sun Mar 22, 2015 12:03 pm

Your file does not run, because the steady state is wrong. The model is not actually linear with mean 0. See e.g. the second equation that contains phi*g_bar.
My mod-file crashes with the posted message, because it requires Dynare 4.5 (i.e. at the moment the unstable version of Dynare)
------------
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: Index out of bounds because size(estim_params_.var_endo)

Postby ptr » Fri Apr 03, 2015 5:09 pm

Thank you. My code now runs.

However, the posterior distribution for figure 3 is not generated although the autocorrelation function is.

I cannot also see them in the oo_ folder.
ptr
 
Posts: 30
Joined: Fri Apr 19, 2013 9:58 am

Re: Index out of bounds because size(estim_params_.var_endo)

Postby ptr » Mon Apr 06, 2015 8:56 am

In your replication code, the following error is generated although the data naming style and path is right as suggested in
http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6485
:

Choose one of the following options:

[1] Consider all the endogenous variables.
[2] Consider all the observed endogenous variables.
[3] Stop Dynare and change the mod file.

options [default is 1] = 1

??? Error using ==> load_xls_file_data at 117
load_xls_file_data: I am not able to read the dates!

Error in ==> dseries.dseries at 131
[freq,init,data,varlist] = load_xls_file_data(varargin{1}, sheet, range);

Error in ==> makedataset at 98
DynareDataset = dseries(datafile);

Error in ==> dynare_estimation_init at 490
[dataset_, dataset_info, newdatainterfaceflag] = makedataset(options_,
options_.dsge_var*options_.dsge_varlag, gsa_flag);

Error in ==> dynare_estimation_1 at 94
[dataset_, dataset_info, xparam1, hh, M_, options_, oo_, estim_params_, bayestopt_,
bounds] = ...

Error in ==> dynare_estimation at 91
dynare_estimation_1(var_list,dname);

Error in ==> GarciaCiccoetal2010 at 295
oo_recursive_=dynare_estimation(var_list_);

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

What could be the problem.
ptr
 
Posts: 30
Joined: Fri Apr 19, 2013 9:58 am

Re: Index out of bounds because size(estim_params_.var_endo)

Postby ptr » Mon Apr 06, 2015 4:35 pm

I have resolved the error. Thank you.
ptr
 
Posts: 30
Joined: Fri Apr 19, 2013 9:58 am

Re: Index out of bounds because size(estim_params_.var_endo)

Postby selima » Tue May 19, 2015 9:40 am

Good morning In fact I have nearly the same error
?? Error using ==> dseries.subsref at 231
dseries::subsref: Indices are out of bounds! Subsample cannot end after 128Y.

Error in ==> makedataset at 220
DynareDataset = DynareDataset(FIRSTOBS:lastobs);

Error in ==> dynare_estimation_init at 493
[dataset_, dataset_info, newdatainterfaceflag] = makedataset(options_,
options_.dsge_var*options_.dsge_varlag, gsa_flag);

Error in ==> dynare_estimation_1 at 94
[dataset_, dataset_info, xparam1, hh, M_, options_, oo_, estim_params_, bayestopt_,
bounds] = ...

Error in ==> dynare_estimation at 91
dynare_estimation_1(var_list,dname);

Error in ==> article2fiscalsansd at 502
oo_recursive_=dynare_estimation(var_list_);

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

could ayone help me? thank you jpfeifer
Attachments
article2fiscalsansd.mod
(10.52 KiB) Downloaded 96 times
data7.m
(13.05 KiB) Downloaded 105 times
selima
 
Posts: 46
Joined: Thu Jan 10, 2013 5:13 pm

Re: Index out of bounds because size(estim_params_.var_endo)

Postby jpfeifer » Tue May 19, 2015 10:04 am

The current data interface in the unstable version is still under development. With
Code: Select all
nobs=128,first_obs=50

You want 128 observations after observation 50. But you only have 128 observations in total. Thus, you need to adjust nobs to account for not starting with observation 1.
------------
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: Google [Bot] and 6 guests