Page 1 of 1

Index out of bounds because size(estim_params_.var_endo)

PostPosted: Sun Mar 15, 2015 11:10 am
by ptr
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.

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

PostPosted: Sun Mar 15, 2015 5:45 pm
by jpfeifer
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.

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

PostPosted: Mon Mar 16, 2015 4:17 pm
by ptr
I've tried to specify measurement errors eg psi, uniform_pdf,,, 0, 5; in vain. Any additional tip/ trick?

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

PostPosted: Mon Mar 16, 2015 4:20 pm
by jpfeifer
Which code exactly did you try?

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

PostPosted: Mon Mar 16, 2015 10:09 pm
by ptr
Garcia Cicco et al 2010 replication code.

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

PostPosted: Tue Mar 17, 2015 8:48 am
by jpfeifer
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?

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

PostPosted: Sun Mar 22, 2015 1:54 am
by ptr
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?

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

PostPosted: Sun Mar 22, 2015 12:03 pm
by jpfeifer
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)

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

PostPosted: Fri Apr 03, 2015 5:09 pm
by ptr
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.

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

PostPosted: Mon Apr 06, 2015 8:56 am
by ptr
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.

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

PostPosted: Mon Apr 06, 2015 4:35 pm
by ptr
I have resolved the error. Thank you.

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

PostPosted: Tue May 19, 2015 9:40 am
by selima
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

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

PostPosted: Tue May 19, 2015 10:04 am
by jpfeifer
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.