Page 1 of 1

Error with DSGE-VAR 'Index exceeds matrix dimensions'

PostPosted: Mon May 16, 2016 3:34 pm
by Ouz
Dear all,

Any of you have experience on the following, please?

We tried to estimate our model using the DSGE-VAR option, but the following error message pops out.

''Index exceeds matrix dimensions.

Error in dsge_var_likelihood (line 149)
constant = transpose(SteadyState(BayesInfo.mfys));

Error in gmhmaxlik (line 108)
logpo2 = - feval(ObjFun,proposal,varargin{:});

Error in dynare_estimation_1 (line 418)
[xparam1,PostVar,Scale,PostMean] = ...

Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);

Error in check1 (line 651)
dynare_estimation(var_list_);

Error in dynare (line 180)
evalin('base',fname) ;''


Before this we tried our code with the pure Bayesian method and it run well. We tried to abandon lines 369, 393 and 394 of the attached (hence get it to pure Bayesian) and saw there was no problem, either. But we dont understand why there is a problem when we activate the 'DSGE-VAR' option?

Any help would be very appreciated.

Kind regards,
Gary

Re: Error with DSGE-VAR 'Index exceeds matrix dimensions'

PostPosted: Tue May 17, 2016 6:14 pm
by Ouz
...And some follow-up here. Just noticed that when I change the input of

'mh_jscale=?'

I could get the code running for a while (I lowered it from 0.8 to 0.08 in this example). But how this is linked to the error message which seems to have to do with the dsge-var likelihood in the SS? Should the input of 'mh_jscale' matter at all in terms coding?

Many thanks.

Gary

Re: Error with DSGE-VAR 'Index exceeds matrix dimensions'

PostPosted: Tue May 17, 2016 6:53 pm
by jpfeifer
Dear Gary, thanks for pointing out this bug. In dsge_var_likelihood.m
Code: Select all
elseif info(1) == 3 || info(1) == 4 || info(1) == 19 || info(1) == 20 || info(1) == 21
    fval = objective_function_penalty_base+info(2);

the
Code: Select all
info(1) == 6

is missing. With a smaller mh_jscale the parameter draw that triggered this error code does not occur.
We will fix this soon in the unstable version: https://github.com/DynareTeam/dynare/pull/1190

Note that the presample option is actually not supported for DSGE-VARs so that the mod-file will trigger an error with the unstable version.

Re: Error with DSGE-VAR 'Index exceeds matrix dimensions'

PostPosted: Tue May 17, 2016 7:26 pm
by Ouz
Dear jpfeifer,

Many thanks for clarifying that. I followed your instruction and get the problem sorted. That was a big help; really appreciate that!!!

Kind regards,
Gary