Page 1 of 1

Possible bug in Dynare 4.3.3 when using diffuse KF

PostPosted: Fri May 17, 2013 12:51 pm
by reluginbuhl
Dear Dynare Team,

I have a DSGE model with some non-stationary observables. I am using the diffuse_filter option in estimation (as well as the so-called obsolete observation_trends and unit_root_vars, because I get error messages about the steady state values from my *_steadystate.m file not satisfying the model equations without these arguments, see my earlier post viewtopic.php?f=1&t=2813&start=0). I would like to use the mode=1 for the joint posterior mode determination. Estimation typically begins OK, but after a few iterations of mode=1, I get this error message when Dynare crashes:

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

Error in univariate_kalman_filter (line 171)
Fi = z(i,:)*PZ + H(d_index(i));

Error in dsge_likelihood (line 677)
[LIK, lik] =
Error in nlconst (line 744)
f = feval(funfcn{3},x,varargin{:});

Error in fmincon (line 837)

Error in dynare_estimation_1 (line 227)
[xparam1,fval,exitflag,output,lamdba,grad,hessian_fmincon] = ...

Error in dynare_estimation (line 70)

Error in tempv6_experiment (line 1332)

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

Looking at the code, I see that the value of H=0 (and not a vector as the code would like: the error occurs when the code needs to use a value for H(2)). I see earlier in the code that the routine does make a H1 matrix for the diffuse case. Perhaps the solution can be found by using this matrix instead of H (in the diffuse case when kalman_algo==4 as is the case for my mod-file)?

Any help would be much appreciated!

Thank you.

Rob Luginbuhl

ps I cannot include my mod file or steady state, because I am not sure that they can be made public.

Re: Possible bug in Dynare 4.3.3 when using diffuse KF

PostPosted: Fri May 17, 2013 9:56 pm
by jpfeifer
This is a bug that will be soon fixed in the unstable version. For Dynare 4.3.3 a bug-fixed version of dsge_likelihood.m is attached. If you replace the original one with it, it should run.

Re: Possible bug in Dynare 4.3.3 when using diffuse KF

PostPosted: Mon May 20, 2013 10:19 am
by reluginbuhl
Thank you! The problem seems to be fixed.
Rob Luginbuhl