Explaining particle filters for nonlinear state estimation
Particle filters approximate nonlinear, non-Gaussian state posteriors by representing them with many weighted samples ("particles"). Unlike Kalman filters, which assume linearity and Gaussian noise, particle filters use importance sampling to propagate particles, assign weights based on likelihood, and resample to discard low-weight particles and duplicate high-weight ones, preventing degeneracy and focusing computational effort on probable states. Resampling methods like systematic or stratified resampling maintain particle diversity and improve estimate accuracy over time.
In state–space models you have a latent state (x_t) that evolves over time and noisy observations (y_t) that depend on that state. The goal of state estimation is to infer the posterior distribution (p(x_t \mid y_{1:t})) as new data arrive. The Kalman filter does this efficiently when both the state dynamics and the observation model are linear and the noise is Gaussian; under those assumptions the posterior is always Gaussian and can be propagated using closed–form formulas.
If either the dynamics/measurement model is nonlinear or the uncertainty is not well described by a single Gaussian, the posterior can become multimodal or skewed, and the Kalman filter’s Gaussian assumption breaks down. Particle filters, or sequential Monte Carlo methods, address this by representing the posterior with a set of random samples (“particles”) and associated weights instead of a parametric density. A simple particle filter operates as follows:
-
Initialization: Draw (N) particles ({x_0^{(i)}}) from an initial prior over the state and assign them equal weights (w_0^{(i)} = 1/N).
-
Prediction (propagation): At each time step (t), propagate each particle through the state transition model. For example, if (x_t = f(x_{t-1}) + \eta_t) with process noise (\eta_t), sample (x_t^{(i)} \sim p(x_t \mid x_{t-1}^{(i)})).
-
Update (weighting): Incorporate the new observation (y_t) by updating each particle’s weight according to the likelihood of the observation given that particle’s state: (w_t^{(i)} \propto w_{t-1}^{(i)}, p(y_t \mid x_t^{(i)})). Normalize the weights so they sum to one.
After these steps, the weighted particle set approximates the posterior. Over time, however, a problem called weight degeneracy arises: a few particles will carry most of the weight while many contribute almost nothing. This reduces the effective sample size and wastes computation.
To combat this, particle filters include a resampling step. When the effective number of particles falls below a threshold, you draw a new set of (N) particles by sampling, with replacement, from the current set according to their weights. Particles with high weights are likely to be copied multiple times; particles with low weights are likely to be discarded. After resampling, all particles’ weights are reset to (1/N), and the algorithm continues.
Resampling focuses computational effort on regions of high posterior probability and eliminates low–weight particles, but it also introduces the possibility of having many identical copies of a high–weight particle. Variants like systematic, stratified, or residual resampling reduce variance compared to simple multinomial resampling, and adding a small amount of noise after resampling (sometimes called jittering or roughening) can help maintain diversity. More advanced schemes like the auxiliary particle filter or regularized particle filter also address sample impoverishment.