Added a commented line to print the effective number of particles if needed.

time-shift
Stéphane Adjemian (Charybdis) 2012-03-09 18:33:31 +01:00
parent 4ba016cc16
commit 4aedf7e9c0
1 changed files with 1 additions and 0 deletions

View File

@ -130,6 +130,7 @@ for t=1:sample_size
wtilde = weights.*exp(lnw-dfac);
lik(t) = log(mean(wtilde))+dfac;
weights = wtilde/sum(wtilde);
% sum(weights>max(weights)*1e-6)
Neff = 1/(weights*weights');
if (Neff<DynareOptions.particle.resampling.neff_threshold*sample_size && strcmpi(DynareOptions.particle.resampling.status,'generic')) || strcmpi(DynareOptions.particle.resampling.status,'systematic')
nb_obs_resamp = nb_obs_resamp+1 ;