Commit 42ecfa38 authored by MichelJuillard's avatar MichelJuillard

fxing bug in diffuse smoother with missing values

parent 08375e7b
...@@ -116,7 +116,7 @@ while rank(Pinf(:,:,t+1),diffuse_kalman_tol) && t<smpl ...@@ -116,7 +116,7 @@ while rank(Pinf(:,:,t+1),diffuse_kalman_tol) && t<smpl
alphahat = Inf; alphahat = Inf;
return return
else else
a(:,:,t+1) = T*a(:,:,t); a(:,t+1) = T*a(:,t);
Pstar(:,:,t+1) = T*Pstar(:,:,t)*transpose(T)+QQ; Pstar(:,:,t+1) = T*Pstar(:,:,t)*transpose(T)+QQ;
Pinf(:,:,t+1) = T*Pinf(:,:,t)*transpose(T); Pinf(:,:,t+1) = T*Pinf(:,:,t)*transpose(T);
end end
...@@ -125,7 +125,7 @@ while rank(Pinf(:,:,t+1),diffuse_kalman_tol) && t<smpl ...@@ -125,7 +125,7 @@ while rank(Pinf(:,:,t+1),diffuse_kalman_tol) && t<smpl
Kstar(:,:,t) = Pstar(:,:,t)*ZZ'*iFstar(:,:,t); Kstar(:,:,t) = Pstar(:,:,t)*ZZ'*iFstar(:,:,t);
Pinf(:,:,t+1) = T*Pinf(:,:,t)*transpose(T); Pinf(:,:,t+1) = T*Pinf(:,:,t)*transpose(T);
Pstar(:,:,t+1) = T*(Pstar(:,:,t)-Pstar(:,:,t)*ZZ'*Kstar(:,:,t)')*T'+QQ; Pstar(:,:,t+1) = T*(Pstar(:,:,t)-Pstar(:,:,t)*ZZ'*Kstar(:,:,t)')*T'+QQ;
a(:,:,t+1) = T*(a(:,:,t)+Kstar(:,:,t)*v(:,t)); a(:,t+1) = T*(a(:,t)+Kstar(:,:,t)*v(:,t));
end end
end end
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment