Commit 795d0fce authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Cosmetic changes.

parent 6c6b6293
...@@ -130,17 +130,17 @@ for t=1:sample_size ...@@ -130,17 +130,17 @@ for t=1:sample_size
wtilde = weights.*exp(lnw-dfac); wtilde = weights.*exp(lnw-dfac);
lik(t) = log(sum(wtilde))+dfac; lik(t) = log(sum(wtilde))+dfac;
weights = wtilde/sum(wtilde); weights = wtilde/sum(wtilde);
if strcmpi(DynareOptions.particle.resampling.status,'generic')) if strcmp(DynareOptions.particle.resampling.status,'generic'))
Neff = 1/(weights*weights'); Neff = 1/(weights*weights');
end 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 ; nb_obs_resamp = nb_obs_resamp+1 ;
StateVectors = tmp(mf0,resample(weights,DynareOptions.particle.resampling.method1,DynareOptions.particle.resampling.method2)); StateVectors = tmp(mf0,resample(weights,DynareOptions.particle.resampling.method1,DynareOptions.particle.resampling.method2));
weights = ones(1,number_of_particles)/number_of_particles; 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)'; 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; 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,:); StateVectors = tmp(mf0,:);
end end
end end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment