Skip to content
Snippets Groups Projects
Commit 1a978e42 authored by Johannes Pfeifer's avatar Johannes Pfeifer
Browse files

Fix bug in missing_DiffuseKalmanSmootherH3_Z.m

Closes #1339 by properly factorizing computations
parent 2f9dc092
No related branches found
No related tags found
No related merge requests found
...@@ -294,13 +294,13 @@ if d ...@@ -294,13 +294,13 @@ if d
if Finf(i,t) > diffuse_kalman_tol if Finf(i,t) > diffuse_kalman_tol
% recursions need to be from highest to lowest term in order to not % recursions need to be from highest to lowest term in order to not
% overwrite lower terms still needed in this step % overwrite lower terms still needed in this step
Linf = eye(mm) - Kinf(:,i,t)*Z(i,:)/Finf(i,t);
L0 = (Kinf(:,i,t)*(Fstar(i,t)/Finf(i,t))-Kstar(:,i,t))*Z(i,:)/Finf(i,t);
r1(:,t) = Z(i,:)'*v(i,t)/Finf(i,t) + ... r1(:,t) = Z(i,:)'*v(i,t)/Finf(i,t) + ...
(Kinf(:,i,t)'*Fstar(i,t)/Finf(i,t)-Kstar(:,i,t)')*r0(:,t)/Finf(i,t)*Z(i,:)' + ... L0'*r0(:,t) + ...
r1(:,t)-Kinf(:,i,t)'*r1(:,t)/Finf(i,t)*Z(i,:)'; % KD (2000), eq. (25) for r_1 Linf'*r1(:,t); % KD (2000), eq. (25) for r_1
r0(:,t) = r0(:,t)-Kinf(:,i,t)'*r0(:,t)/Finf(i,t)*Z(i,:)'; % KD (2000), eq. (25) for r_0 r0(:,t) = Linf'*r0(:,t); % KD (2000), eq. (25) for r_0
if state_uncertainty_flag if state_uncertainty_flag
Linf = eye(mm) - Kinf(:,i,t)'/Finf(i,t);
L0 = (Kinf(:,i,t)*(Fstar(i,t)/Finf(i,t))-Kstar(:,i,t))*Z(i,:)/Finf(i,t);
N_2(:,:,t)=Z(i,:)'/Finf(i,t)^2*Z(i,:)*Fstar(i,t) ... N_2(:,:,t)=Z(i,:)'/Finf(i,t)^2*Z(i,:)*Fstar(i,t) ...
+ Linf'*N_2(:,:,t)*Linf... + Linf'*N_2(:,:,t)*Linf...
+ Linf'*N_1(:,:,t)*L0... + Linf'*N_1(:,:,t)*L0...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment