From 7438dae0d45ffd6b46c1b9c596d04da81481cf97 Mon Sep 17 00:00:00 2001
From: ferhat <ferhat.mihoubi@univ-evry.fr>
Date: Tue, 14 Jan 2014 17:32:45 +0100
Subject: [PATCH] Speeds up the Kalman smoother (cherry picked from commit
 ae72105b5c0cc1cd5121e8c026d9c0bfe40dfc39)

---
 matlab/missing_DiffuseKalmanSmootherH1_Z.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/matlab/missing_DiffuseKalmanSmootherH1_Z.m b/matlab/missing_DiffuseKalmanSmootherH1_Z.m
index ff8c99a0b..4b5014771 100644
--- a/matlab/missing_DiffuseKalmanSmootherH1_Z.m
+++ b/matlab/missing_DiffuseKalmanSmootherH1_Z.m
@@ -177,7 +177,7 @@ while notsteady && t<smpl
         atilde(:,t) = a(:,t) + PZI*v(di,t);
         K(:,di,t)    = T*PZI;
         L(:,:,t)    = T-K(:,di,t)*ZZ;
-        P(:,:,t+1)  = T*P(:,:,t)*T'-T*P(:,:,t)*ZZ'*K(:,di,t)' + QQ;
+		P(:,:,t+1)  = T*P(:,:,t)*L(:,:,t)' + QQ;
     end
     a(:,t+1)    = T*atilde(:,t);
     Pf          = P(:,:,t);
-- 
GitLab