From ac2fa68b86639166ed0a740936c510a1f1e62503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Fri, 4 May 2012 11:22:17 +0200 Subject: [PATCH] Fixed bug related to the resampling of the particles. --- matlab/particle/sequential_importance_particle_filter.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matlab/particle/sequential_importance_particle_filter.m b/matlab/particle/sequential_importance_particle_filter.m index 13aaf30c2..4a01e8e49 100644 --- a/matlab/particle/sequential_importance_particle_filter.m +++ b/matlab/particle/sequential_importance_particle_filter.m @@ -130,10 +130,10 @@ for t=1:sample_size wtilde = weights.*exp(lnw-dfac); lik(t) = log(sum(wtilde))+dfac; weights = wtilde/sum(wtilde); - if strcmp(DynareOptions.particle.resampling.status,'generic')) + if strcmp(DynareOptions.particle.resampling.status,'generic') Neff = 1/(weights*weights'); end - if (Neff