Cosmetic changes.

time-shift
Stéphane Adjemian (Charybdis) 2012-03-30 11:48:23 +02:00
parent 6c6b62937f
commit 795d0fce16
1 changed files with 4 additions and 4 deletions

View File

@ -130,17 +130,17 @@ for t=1:sample_size
wtilde = weights.*exp(lnw-dfac);
lik(t) = log(sum(wtilde))+dfac;
weights = wtilde/sum(wtilde);
if strcmpi(DynareOptions.particle.resampling.status,'generic'))
if strcmp(DynareOptions.particle.resampling.status,'generic'))
Neff = 1/(weights*weights');
end
if (Neff<DynareOptions.particle.resampling.neff_threshold*sample_size && strcmpi(DynareOptions.particle.resampling.status,'generic')) || strcmpi(DynareOptions.particle.resampling.status,'systematic')
if (Neff<DynareOptions.particle.resampling.neff_threshold*sample_size && strcmp(DynareOptions.particle.resampling.status,'generic')) || strcmp(DynareOptions.particle.resampling.status,'systematic')
nb_obs_resamp = nb_obs_resamp+1 ;
StateVectors = tmp(mf0,resample(weights,DynareOptions.particle.resampling.method1,DynareOptions.particle.resampling.method2));
weights = ones(1,number_of_particles)/number_of_particles;
elseif strcmpi(DynareOptions.particle.resampling.status,'smoothed')
elseif strcmp(DynareOptions.particle.resampling.status,'smoothed')
StateVectors = multivariate_smooth_resampling(weights',tmp(mf0,:)',number_of_particles,DynareOptions.particle.resampling.number_of_partitions)';
weights = ones(1,number_of_particles)/number_of_particles;
elseif strcmpi(DynareOptions.particle.resampling.status,'none')
elseif strcmp(DynareOptions.particle.resampling.status,'none')
StateVectors = tmp(mf0,:);
end
end