Skip to content
Snippets Groups Projects
Commit 792924a3 authored by Marco Ratto's avatar Marco Ratto
Browse files

- test the rank of Pinf in univariate smoother for the subset of observables,...

- test the rank of Pinf in univariate smoother for the subset of observables, in order to trap cases where this is not already trapped in compute_Pinf_Pstar.m
- issue warning when diffuse steps never end [maybe we should issue an error?]
parent bf607ce6
No related branches found
No related tags found
No related merge requests found
...@@ -122,7 +122,7 @@ end ...@@ -122,7 +122,7 @@ end
t = 0; t = 0;
icc=0; icc=0;
newRank = rank(Pinf(:,:,1),diffuse_kalman_tol); newRank = rank(Z*Pinf(:,:,1)*Z',diffuse_kalman_tol);
while newRank && t < smpl while newRank && t < smpl
t = t+1; t = t+1;
a(:,t) = a1(:,t); a(:,t) = a1(:,t);
...@@ -156,7 +156,7 @@ while newRank && t < smpl ...@@ -156,7 +156,7 @@ while newRank && t < smpl
end end
end end
if newRank if newRank
oldRank = rank(Pinf(:,:,t),diffuse_kalman_tol); oldRank = rank(Z*Pinf(:,:,t)*Z',diffuse_kalman_tol);
else else
oldRank = 0; oldRank = 0;
end end
...@@ -168,7 +168,7 @@ while newRank && t < smpl ...@@ -168,7 +168,7 @@ while newRank && t < smpl
Pstar(:,:,t+1) = T*Pstar(:,:,t)*T'+ QQ; Pstar(:,:,t+1) = T*Pstar(:,:,t)*T'+ QQ;
Pinf(:,:,t+1) = T*Pinf(:,:,t)*T'; Pinf(:,:,t+1) = T*Pinf(:,:,t)*T';
if newRank if newRank
newRank = rank(Pinf(:,:,t+1),diffuse_kalman_tol); newRank = rank(Z*Pinf(:,:,t+1)*Z',diffuse_kalman_tol);
end end
if oldRank ~= newRank if oldRank ~= newRank
disp('univariate_diffuse_kalman_filter:: T does influence the rank of Pinf!') disp('univariate_diffuse_kalman_filter:: T does influence the rank of Pinf!')
...@@ -367,3 +367,9 @@ if decomp_flag ...@@ -367,3 +367,9 @@ if decomp_flag
end end
epsilonhat = Y - Z*alphahat; epsilonhat = Y - Z*alphahat;
if (d==smpl)
warning(['missing_DiffuseKalmanSmootherH3_Z:: There isn''t enough information to estimate the initial conditions of the nonstationary variables']);
return
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment