From 32bf5e9a0e685f86c01659d8d79239a530b4ced5 Mon Sep 17 00:00:00 2001 From: Michel Juillard Date: Mon, 4 Oct 2010 21:57:08 +0200 Subject: [PATCH] Diffuse smoother: bug correction when singularity occurs --- matlab/DiffuseKalmanSmoother1_Z.m | 62 +++++++++++++++++++++---------- matlab/DsgeSmoother.m | 4 +- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/matlab/DiffuseKalmanSmoother1_Z.m b/matlab/DiffuseKalmanSmoother1_Z.m index 807ec74ef..f474afdd2 100644 --- a/matlab/DiffuseKalmanSmoother1_Z.m +++ b/matlab/DiffuseKalmanSmoother1_Z.m @@ -63,6 +63,7 @@ global options_ d = 0; decomp = []; nk = options_.nk; +kalman_tol = options_.kalman_tol; spinf = size(Pinf1); spstar = size(Pstar1); v = zeros(pp,smpl); @@ -91,28 +92,51 @@ etahat = zeros(rr,smpl); r = zeros(mm,smpl+1); t = 0; -while rank(Pinf(:,:,t+1),crit1) & t