If F is identically 0 in Kalman filter, discard parameter draw instead of treating current observation as unobserved

See discussion on mailing list 18/06/2016
time-shift
Johannes Pfeifer 2016-06-19 17:13:04 +02:00 committed by Stéphane Adjemian (Hermes)
parent fa3a71bcae
commit 8dc96cafa4
5 changed files with 13 additions and 12 deletions

View File

@ -172,10 +172,11 @@ while notsteady && t<=last
sig=sqrt(diag(F));
if any(diag(F)<kalman_tol) || rcond(F./(sig*sig')) < kalman_tol
if ~all(abs(F(:))<kalman_tol)
%use diffuse filter
return
else
a = T*a;
P = T*P*transpose(T)+QQ;
%pathological case, discard draw
return
end
else
F_singular = 0;

View File

@ -81,9 +81,8 @@ while rank(Pinf,diffuse_kalman_tol) && (t<=last)
% The univariate diffuse kalman filter should be used.
return
else %rank 0
a = T*a;
Pstar = T*Pstar*transpose(T)+QQ;
Pinf = T*Pinf*transpose(T); % (5.16) DK (2012)
%pathological case, discard draw
return
end
else
iFstar = inv(Fstar);

View File

@ -152,10 +152,11 @@ while notsteady && t<=last
end
if rcond(F) < kalman_tol
if ~all(abs(F(:))<kalman_tol)
% The univariate diffuse kalman filter should be used.
return
else
a = T*a;
P = T*P*transpose(T)+QQ;
%pathological case, discard draw
return
end
else
F_singular = 0;

View File

@ -105,10 +105,11 @@ while notsteady && t<=last
sig=sqrt(diag(F));
if any(diag(F)<kalman_tol) || rcond(F./(sig*sig')) < kalman_tol
if ~all(abs(F(:))<kalman_tol)
%use diffuse filter
return
else
a = T*a;
P = T*P*transpose(T)+QQ;
%pathological case, discard draw
return
end
else
F_singular = 0;

View File

@ -100,9 +100,8 @@ while rank(Pinf,diffuse_kalman_tol) && (t<=last)
% The univariate diffuse kalman filter should be used.
return
else %rank 0
a = T*a;
Pstar = T*Pstar*transpose(T)+QQ;
Pinf = T*Pinf*transpose(T); % (5.16) DK (2012)
%pathological case, discard draw
return
end
else
iFstar = inv(Fstar);