Commit 2995562e authored by Frédéric Karamé's avatar Frédéric Karamé
Browse files

Delete resampling possibility in gaussian particle filter

parent 5880db75
...@@ -146,19 +146,19 @@ for t=1:sample_size ...@@ -146,19 +146,19 @@ for t=1:sample_size
%VarSampleWeights = VarSampleWeights*VarSampleWeights'/(number_of_particles-1) ; %VarSampleWeights = VarSampleWeights*VarSampleWeights'/(number_of_particles-1) ;
lik(t) = log(SumSampleWeights) ; %+ .5*VarSampleWeights/(number_of_particles*(SumSampleWeights*SumSampleWeights)) ; lik(t) = log(SumSampleWeights) ; %+ .5*VarSampleWeights/(number_of_particles*(SumSampleWeights*SumSampleWeights)) ;
SampleWeights = SampleWeights./SumSampleWeights ; SampleWeights = SampleWeights./SumSampleWeights ;
Neff = neff(SampleWeights) ; % Neff = neff(SampleWeights) ;
if (Neff<0.5*sample_size && ParticleOptions.resampling.status.generic) || ParticleOptions.resampling.status.systematic % if (Neff<0.5*sample_size && ParticleOptions.resampling.status.generic) || ParticleOptions.resampling.status.systematic
ks = ks + 1 ; % ks = ks + 1 ;
StateParticles = resample(StateParticles',SampleWeights,ParticleOptions)' ; % StateParticles = resample(StateParticles',SampleWeights,ParticleOptions)' ;
StateVectorMean = mean(StateParticles,2) ; % StateVectorMean = mean(StateParticles,2) ;
StateVectorVarianceSquareRoot = reduced_rank_cholesky( (StateParticles*StateParticles')/(number_of_particles-1) - StateVectorMean*(StateVectorMean') )'; % StateVectorVarianceSquareRoot = reduced_rank_cholesky( (StateParticles*StateParticles')/(number_of_particles-1) - StateVectorMean*(StateVectorMean') )';
SampleWeights = 1/number_of_particles ; % SampleWeights = 1/number_of_particles ;
elseif ParticleOptions.resampling.status.none % elseif ParticleOptions.resampling.status.none
StateVectorMean = StateParticles*SampleWeights ; StateVectorMean = StateParticles*SampleWeights ;
temp = bsxfun(@minus,StateParticles,StateVectorMean) ; temp = bsxfun(@minus,StateParticles,StateVectorMean) ;
StateVectorVarianceSquareRoot = reduced_rank_cholesky( bsxfun(@times,SampleWeights',temp)*temp' )'; StateVectorVarianceSquareRoot = reduced_rank_cholesky( bsxfun(@times,SampleWeights',temp)*temp' )';
%disp(StateVectorVarianceSquareRoot) %disp(StateVectorVarianceSquareRoot)
end % end
end end
end end
......
Markdown is supported
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