missing_DiffuseKalmanSmootherH1_Z.m: fix crash when Pinf is singular for more than 1 period

iFstar was accessed as three-dimensional array with t along third dimension, but it is only two-dimensional
time-shift
Johannes Pfeifer 2016-10-29 11:53:05 +02:00
parent ff1522a571
commit c94011eeb8
1 changed files with 1 additions and 1 deletions

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(:,:,t); %(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)