v4: bug correction in DiffuseKalmanSmoother* + new option_.diffuse_d (DiffuseKalmanSmootherH3corr.m) isn't corrected

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@677 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
michel 2006-03-13 10:21:14 +00:00
parent d084976eac
commit e72a1d579c
2 changed files with 510 additions and 508 deletions

View File

@ -1,12 +1,13 @@
function [alphahat,etahat,a1, aK] = DiffuseKalmanSmoother3(T,R,Q,Pinf1,Pstar1,Y,trend,pp,mm,smpl,mf)
function [alphahat,etahat,a1, aK, a] = DiffuseKalmanSmoother3(T,R,Q,Pinf1,Pstar1,Y,trend,pp,mm,smpl,mf)
%function [a,etahat,a1, aK] = DiffuseKalmanSmoother3(T,R,Q,Pinf1,Pstar1,Y,trend,pp,mm,smpl,mf)
% Modified by M. Ratto
% New output argument aK: 1-step to nk-stpe ahed predictions)
% New input argument nk: max order of predictions in aK
% New global variable id_ where the DKF stops (common with
% New option options_.diffuse_d where the DKF stops (common with
% diffuselikelihood3)
% New icc variable to count number of iterations for Finf steps
% Pstar % Pinf simmetric
% New termination of DKF iterations based on id_
% New termination of DKF iterations based on options_.diffuse_d
% Li also stored during DKF iterations !!
% some bugs corrected in the DKF part of the smoother (Z matrix and
% alphahat)
@ -101,9 +102,9 @@ while newRank & t < smpl
options_.diffuse_d = icc;
end
end,
if newRank==0,
options_.diffuse_d=i;
end
% if newRank==0,
% options_.diffuse_d=i; %this is buggy
% end
% end new terminiation criteria by M. Ratto
else
%% Note that : (1) rank(Pinf)=0 implies that Finf = 0, (2) outside this loop (when for some i and t the condition
@ -251,3 +252,4 @@ else
etahat(:,1) = QRt*r(:,1);
end
a=a(:,1:end-1);

View File

@ -102,9 +102,9 @@ while newRank & t < smpl
options_.diffuse_d = icc;
end
end,
if newRank==0,
options_.diffuse_d=i;
end
% if newRank==0,
% options_.diffuse_d=i; % this line is buggy!
% end
% end new terminiation criteria by M. Ratto
else
%% Note that : (1) rank(Pinf)=0 implies that Finf = 0, (2) outside this loop (when for some i and t the condition