Possible bug in Dynare 4.3.3 when using diffuse KF

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.

Possible bug in Dynare 4.3.3 when using diffuse KF

Postby reluginbuhl » Fri May 17, 2013 12:51 pm

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] =
univariate_kalman_filter(DynareDataset.missing.aindex,DynareDataset.missing.number_of_observations,DynareDataset.missing.no_more_missing_observations,Y,diffuse_periods+1,size(Y,2),
.
Error in nlconst (line 744)
f = feval(funfcn{3},x,varargin{:});

Error in fmincon (line 837)
[X,FVAL,LAMBDA,EXITFLAG,OUTPUT,GRAD,HESSIAN]=...

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

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

Error in tempv6_experiment (line 1332)
dynare_estimation(var_list_);

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.

Sincerely,
Rob Luginbuhl

ps I cannot include my mod file or steady state, because I am not sure that they can be made public.
reluginbuhl
 
Posts: 53
Joined: Wed Mar 04, 2009 2:41 pm

Re: Possible bug in Dynare 4.3.3 when using diffuse KF

Postby jpfeifer » Fri May 17, 2013 9:56 pm

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.
Attachments
dsge_likelihood.m
Bugfixed function
(28.97 KiB) Downloaded 207 times
------------
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: Possible bug in Dynare 4.3.3 when using diffuse KF

Postby reluginbuhl » Mon May 20, 2013 10:19 am

Thank you! The problem seems to be fixed.
Sincerely,
Rob Luginbuhl
reluginbuhl
 
Posts: 53
Joined: Wed Mar 04, 2009 2:41 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests