Robotics
← Roadmap/State Estimation

Particle Filters

Nonparametric filtering for non-Gaussian beliefs.

Progress0/5 questions
hardState EstimationSkip to practice questions ↓

Prerequisites

Why it matters in robotics

Particle filters estimate a robot's state when its belief about where it is has multiple competing possibilities or an irregular shape that simpler estimators break down on, representing that belief with a set of weighted samples instead of a single smooth distribution. This includes the hardest case, where the robot has no idea where it starts and has to work that out from scratch, by running a predict, update, and resample loop whose practical failure modes are losing track of the true possibilities or collapsing onto too few of them. Resampling strategy, how many effective samples remain informative, and total particle count trade compute against accuracy.

What to study

  • Representing belief as weighted samples vs. a parametric (Gaussian) distribution; sampling from the motion model and weighting by the measurement likelihood
  • The predict to update to resample loop and how it implements the recursive Bayes filter
  • Resampling: low-variance/systematic resampling, effective sample size (Neff), and avoiding sample impoverishment and particle deprivation
  • Monte Carlo Localization (MCL) and Adaptive MCL (KLD-sampling), including global localization and the kidnapped-robot problem

Where to study

Cheatsheet

Symbols used below

xt[i]x_t^{[i]}state hypothesis of particle ii at time tt
wt[i]w_t^{[i]}importance weight of particle ii
NNnumber of particles
NeffN_{eff}effective sample size
p(ztxt[i])p(z_t \mid x_t^{[i]})measurement likelihood — how well particle ii explains the observation

Predict → weight → resample

Predict: sample each particle forward through the motion model, xt[i]p(xtut,xt1[i])x_t^{[i]} \sim p(x_t \mid u_t, x_{t-1}^{[i]}).

Weight: score each particle by how well it explains the new measurement, wt[i]=p(ztxt[i])w_t^{[i]} = p(z_t \mid x_t^{[i]}).

Resample: draw NN new particles with replacement, probability proportional to wt[i]w_t^{[i]}, then reset weights uniformly. This is Monte Carlo integration standing in for the Bayes filter's exact predict/update integral.

Effective sample size

Neff=1i(wt[i])2N_{eff} = \dfrac{1}{\sum_i (w_t^{[i]})^2}

Low NeffN_{eff} means weight is concentrated on a few particles — resample now. Resampling on every step is wasteful; resampling only when NeffN_{eff} drops below a threshold (e.g. N/2N/2) avoids unnecessary variance.

Two failure modes

Sample impoverishment: repeated resampling collapses diversity — many particles become exact copies of a few ancestors, so the set can no longer represent the true spread of the belief.

Particle deprivation: no particle lands anywhere near the true state, so no amount of reweighting can recover it. More particles, better proposal distributions, or added process noise both mitigate this.

Low-variance (systematic) resampling

Instead of drawing NN independent samples from the weight distribution, low-variance resampling picks one random offset and then steps through the cumulative weight in fixed-size increments of 1/N1/N.

Same proportional selection, far less sampling noise, and it runs in O(N)O(N) instead of O(NlogN)O(N \log N).

Monte Carlo Localization

MCL is a particle filter applied to global localization: particles start spread uniformly over the map (or over plausible poses) and concentrate as measurements arrive.

KLD-sampling (Adaptive MCL) varies NN on the fly — few particles once the belief is confident and tightly clustered, many while it's spread out or the robot is lost (the kidnapped-robot problem).

Kalman — one GaussianParticle — multimodal samples
A Kalman filter carries a single Gaussian (unimodal); a particle filter represents the belief with weighted samples, so it can track multimodal / non-Gaussian distributions — at higher compute cost.
 Kalman filterParticle filter
Belief shapeUnimodal GaussianArbitrary, multimodal
Global / kidnapped-robot localizationCannot represent — needs a unique starting guessNatural fit — particles cover all hypotheses
Cost scalingPolynomial in state dimensionLinear in particle count, but particle count needed grows with state dimension
DeterminismDeterministic given inputsStochastic — sampling and resampling noise
weightedresample ∝ weightuniform
Resampling replaces weighted particles with equally-weighted copies drawn in proportion to their weight — concentrating samples where the posterior is high (but risking particle depletion).

Application focus

Select an application above.

Practice questions (5)