Code covered by the BSD License  

Highlights from
Resampling methods for particle filtering

image thumbnail
from Resampling methods for particle filtering by Jose-Luis Blanco
Implementation of four resampling methods (Multinomial, Residual, Stratified, and Systematic)

ESS( w )
function [ ess ] = ESS( w )
% ------------------------------------------------------------------------------------------------------
% function [ ess ] = ESS( w )
%
% Calcula el "Efective Sample Size". Si es muy bajo es que hay que resamplear las muestras.
% ------------------------------------------------------------------------------------------------------
M = size(w,1);
cv = sum( ( w.*M - 1 ).^2 ) / M;
ess = 1 / ( 1 + cv );

Contact us at files@mathworks.com