Delete resampling possibility in gaussian particle filter

rm-particles^2
Frédéric Karamé 2015-01-14 16:13:21 +01:00
parent 5880db7537
commit 2995562e68
1 changed files with 9 additions and 9 deletions

View File

@ -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