Diffuse Kalman filter: add comment for better comparison to Koopman/Durbin (2003) as there is a typo in their paper

time-shift
Johannes Pfeifer 2016-10-29 15:00:37 +02:00
parent c94011eeb8
commit e3aecd4e74
3 changed files with 5 additions and 5 deletions

View File

@ -97,7 +97,7 @@ while rank(Pinf,diffuse_kalman_tol) && (t<=last)
else %F_{\infty,t} positive definite
%To compare to DK (2012), this block makes use of the following transformation
%Kstar=T^{-1}*K^{(1)}=M_{*}*F^{(1)}+M_{\infty}*F^{(2)}
% =P_{*}*Z'*F^{(1)}+P_{\infty}*Z'*((-1)*(F_{\infty}^{-1})*F_{*}*(F_{\infty}^{-1}))
% =P_{*}*Z'*F^{(1)}+P_{\infty}*Z'*((-1)*(-F_{\infty}^{-1})*F_{*}*(F_{\infty}^{-1}))
% =[P_{*}*Z'-Kinf*F_{*})]*F^{(1)}
%Make use of L^{0}'=(T-K^{(0)}*Z)'=(T-T*M_{\infty}*F^{(1)}*Z)'
% =(T-T*P_{\infty*Z'*F^{(1)}*Z)'=(T-T*Kinf*Z)'
@ -108,7 +108,7 @@ while rank(Pinf,diffuse_kalman_tol) && (t<=last)
iFinf = inv(Finf);
Kinf = Pinf*Z'*iFinf; %define Kinf=T^{-1}*K_0 with M_{\infty}=Pinf*Z'
Fstar = Z*Pstar*Z' + H; %(5.7) DK(2012)
Kstar = (Pstar*Z'-Kinf*Fstar)*iFinf; %(5.12) DK(2012)
Kstar = (Pstar*Z'-Kinf*Fstar)*iFinf; %(5.12) DK(2012); note that there is a typo in DK (2003) with "+ Kinf" instead of "- Kinf", but it is correct in their appendix
Pstar = T*(Pstar-Pstar*Z'*Kinf'-Pinf*Z'*Kstar')*T'+QQ; %(5.14) DK(2012)
Pinf = T*(Pinf-Pinf*Z'*Kinf')*T'; %(5.14) DK(2012)
a = T*(a+Kinf*v); %(5.13) DK(2012)

View File

@ -119,7 +119,7 @@ while rank(Pinf,diffuse_kalman_tol) && (t<=last)
Kinf = Pinf*ZZ'*iFinf;
%see notes in kalman_filter_d.m for details of computations
Fstar = ZZ*Pstar*ZZ' + H(d_index,d_index); %(5.7) DK(2012)
Kstar = (Pstar*ZZ'-Kinf*Fstar)*iFinf; %(5.12) DK(2012)
Kstar = (Pstar*ZZ'-Kinf*Fstar)*iFinf; %(5.12) DK(2012); note that there is a typo in DK (2003) with "+ Kinf" instead of "- Kinf", but it is correct in their appendix
Pstar = T*(Pstar-Pstar*ZZ'*Kinf'-Pinf*ZZ'*Kstar')*T'+QQ; %(5.14) DK(2012)
Pinf = T*(Pinf-Pinf*ZZ'*Kinf')*T'; %(5.14) DK(2012)
a = T*(a+Kinf*v); %(5.13) DK(2012)

View File

@ -132,7 +132,7 @@ while rank(Pinf(:,:,t+1),diffuse_kalman_tol) && t<smpl
end
else
iFstar = inv(Fstar(:,:,t));
Kstar(:,:,t) = Pstar(:,:,t)*ZZ'*iFstar; %(5.15) of DK (2012) with Kstar=T^{-1}*K^(0)
Kstar(:,:,t) = Pstar(:,:,t)*ZZ'*iFstar; %(5.15) of DK (2012) with Kstar=T^{-1}*K^(0)
Pinf(:,:,t+1) = T*Pinf(:,:,t)*transpose(T); % DK (2012), 5.16
Pstar(:,:,t+1) = T*(Pstar(:,:,t)-Pstar(:,:,t)*ZZ'*Kstar(:,:,t)')*T'+QQ; % (5.17) DK (2012) with L_0 plugged in
a(:,t+1) = T*(a(:,t)+Kstar(:,:,t)*v(:,t)); % (5.13) DK (2012)
@ -145,7 +145,7 @@ while rank(Pinf(:,:,t+1),diffuse_kalman_tol) && t<smpl
atilde(:,t) = a(:,t) + Kinf(:,di,t)*v(di,t);
Linf(:,:,t) = T - T*Kinf(:,di,t)*ZZ; %L^(0) in DK (2012), eq. 5.12
Fstar(di,di,t) = ZZ*Pstar(:,:,t)*ZZ' + H(di,di); %(5.7) DK(2012)
Kstar(:,di,t) = (Pstar(:,:,t)*ZZ'-Kinf(:,di,t)*Fstar(di,di,t))*iFinf(di,di,t); %(5.12) DK(2012) with Kstar=T^{-1}*K^(1)
Kstar(:,di,t) = (Pstar(:,:,t)*ZZ'-Kinf(:,di,t)*Fstar(di,di,t))*iFinf(di,di,t); %(5.12) DK(2012) with Kstar=T^{-1}*K^(1); note that there is a typo in DK (2003) with "+ Kinf" instead of "- Kinf", but it is correct in their appendix
Pstar(:,:,t+1) = T*(Pstar(:,:,t)-Pstar(:,:,t)*ZZ'*Kinf(:,di,t)'-Pinf(:,:,t)*ZZ'*Kstar(:,di,t)')*T' + QQ; %(5.14) DK(2012)
Pinf(:,:,t+1) = T*(Pinf(:,:,t)-Pinf(:,:,t)*ZZ'*Kinf(:,di,t)')*T'; %(5.14) DK(2012)
end