Code covered by the BSD License
-
ESS( w )
-
Gauss( x )
-
countPathHypotheses(x)
-
covParticlesXY( x,y,w )
-
h=error_ellipse(varargin)
ERROR_ELLIPSE - plot an error ellipse, or ellipsoid, defining confidence region
-
motionModel( X, action )
-
observationLikelihood( x, obs...
-
particleFilter( x,w, action, ...
A simple SIS with resampling filter
-
plotParticles( x, w )
Dibuja un conjunto de particulas de "poses" del robot
-
plotParticlesFromFile( f )
Fondo negro:
-
plotParticlesUnweight( x, w )
Dibuja un conjunto de particulas de "poses" del robot
-
resample( w )
-
resampleMultinomial( w )
-
resampleResidual( w )
"Repetition counts" (plus the random part, later on):
-
resampleStratified( w )
-
resampleSystematic( w )
-
runExample(INTERACTIVE,RESAMP...
The main script for running the Particle Filter example
-
runAnalysis.m
-
View all files
from
Resampling methods for particle filtering
by Jose-Luis Blanco
Implementation of four resampling methods (Multinomial, Residual, Stratified, and Systematic)
|
| resampleResidual( w ) |
function [ indx ] = resampleResidual( w )
M = length(w);
% "Repetition counts" (plus the random part, later on):
Ns = floor(M .* w);
% The "remainder" or "residual" count:
R = sum( Ns );
% The number of particles which will be drawn stocastically:
M_rdn = M-R;
% The modified weights:
Ws = (M .* w - floor(M .* w))/M_rdn;
% Draw the deterministic part:
% ---------------------------------------------------
i=1;
for j=1:M,
for k=1:Ns(j),
indx(i)=j;
i = i +1;
end
end;
% And now draw the stocastic (Multinomial) part:
% ---------------------------------------------------
Q = cumsum(Ws);
Q(M)=1; % Just in case...
while (i<=M),
sampl = rand(1,1); % (0,1]
j=1;
while (Q(j)<sampl),
j=j+1;
end;
indx(i)=j;
i=i+1;
end
% t = rand(M+1);
% T = sort(t);
% T(M+1) = 1;
% j=1;
%
% while (i<=M),
% if (T(i)<Q(j)),
% indx(i)=j;
% i=i+1;
% else
% j=j+1;
% end
% end
%
|
|
Contact us at files@mathworks.com