Do not carry a single guess — carry a cloud of them. Each particle is a hypothesis about the hidden state; each is weighted by how well it explains the evidence, then the cloud is resampled so good guesses breed and bad ones die. The weighted mean is the estimate. It is Monte-Carlo turned into a filter — and it holds shapes the Kalman family cannot: two peaks at once. Down the center the belief goes in, the engine predicts-weights-resamples, the estimate comes out. Blue builds it; red breaks it.
source Gordon, Salmond & Smith, Novel approach to nonlinear/non-Gaussian Bayesian state estimation, IEE Proc. F 140(2):107–113 (1993) — doi:10.1049/ip-f-2.1993.0015. Rendered, not quoted.
A belief is a set of N weighted particles {xⁱ, wⁱ} approximating the posterior p(x|z). One recursion:
1 PREDICT push each particle through the motion / prior model. 2 WEIGHT wⁱ ∝ likelihood of the measurement given xⁱ. 3 RESAMPLE draw N new particles ∝ weight — high-weight breed, low-weight die. The weighted mean Σ wⁱxⁱ is the estimate.
Live on the current cloud:
The Monte-Carlo method — approximate an integral by a population of samples — turned into a filter: a population of hypotheses reweighted by evidence, step after step. That is the particle filter.
Where the Kalman family carries one Gaussian and the extended Kalman filter linearises to keep it, the particle cloud needs no linearity and no single peak. Each sphere is the next one's premise.
The blue team's live check: re-run the four engine guarantees — convergence, normalized weights, offspring ∝ weight, two surviving modes. If red tampers, this badge flips.
Two things enter. The prior belief — here a broad Gaussian over the hidden position x — sampled as a particle cloud. And one measurement z. Two sensor models are offered:
| mode | sensor | posterior |
|---|---|---|
| LINEAR | z = x + noise | one Gaussian (closed-form) |
| BEACON | z = |x| + noise | two modes at ±z |
LINEAR is the case where the exact answer is known on paper, so the filter can be graded against truth. BEACON is the case a single Gaussian cannot hold — the reason the cloud exists. Feed either into the panel below.
Weighted cloud shown. Hit resample to redraw N particles ∝ weight — watch the survivors concentrate.
Dot height & brightness = weight. green ▲ = filter estimate · amber ▮ = reference (true posterior mean, or the two modes). Every number is computed on the spot from a fixed-seed cloud — nothing looked up.
What the machine proves: on the LINEAR model the weighted estimate converges to the closed-form posterior mean as N grows (RMS error falls like 1/√N); on the BEACON model it holds both modes at ±z where a single Gaussian sits in the trough. Weights are non-negative and sum to 1; resampling breeds high weight and kills low.
The blue witness (left) confirms these live; the red team (right) tries to make them false.
For a linear-Gaussian system this whole machine is overkill — the Kalman filter gives the exact posterior in a few multiplies. The particle filter earns its cost only where linearity or unimodality fail.
"More particles are always better." Cut. Cost is linear in N but error falls only as 1/√N — halving it costs 4× the particles. Resampling every step can hurt; resample only on low effective sample size.
"The particle filter is the optimal filter." Cut. It is a consistent approximation. Only in the linear-Gaussian case does an exact optimal filter exist in closed form — the Kalman filter — and there the PF merely approaches it.
"Resampling adds information." Kept, corrected. It adds none. It reallocates a fixed sample budget toward high-likelihood regions — trading estimator variance now for particle diversity later.
The red team's move: skip the measurement weighting — give every particle equal weight, so the filter ignores the sensor and the estimate stays stuck at the prior mean. The blue witness (window 7) is watching.
Ignore the measurement and the estimate collapses to the prior mean (~0) instead of the posterior — the converges-to-posterior check fails, the witness recomputes and turns red. Nothing is faked; the attack is real and it is caught.