Particle Filter Resampling Animation

Step through prediction, measurement weighting, ESS, and systematic resampling for IoT tracking

animation
particle-filter
resampling
estimation
tracking
sensor-fusion
interactive
Interactive particle filter workbench with prediction, measurement weighting, effective sample size, systematic resampling, scenarios, formula trace, and mobile-safe references.
Animation Particle Filter Sensor Fusion Resampling

Particle Filter Resampling Animation

Step through a full Sequential Monte Carlo cycle. Particles start as competing hypotheses, prediction spreads them with motion uncertainty, measurement weighting changes their importance, ESS detects degeneracy, and systematic resampling rebuilds a useful particle cloud.

120/120 Effective Sample Size
0.0 m Estimate Error
Waiting Resampling State

Particles are hypotheses

Each dot is one possible state. A cloud represents uncertainty rather than one fixed answer.

Prediction adds process noise

The motion model moves every particle, then uncertainty spreads the cloud.

Measurements change weights

Particles closer to the observation receive larger normalized weights.

ESS triggers resampling

Low effective sample size means too few particles matter, so resampling may be needed.

1

Prior

Start with a particle cloud that represents belief before the next observation.

2

Predict

Move the hidden state and particles through the motion model.

3

Measure

Draw a noisy sensor observation around the true state.

4

Weight

Use a Gaussian likelihood to reward particles near the measurement.

5

ESS

Measure degeneracy with 1 divided by the sum of squared weights.

6

Resample

Copy high-weight particles and reset weights with systematic resampling.

1 PriorBelief before the next observation.
2 PredictMotion model plus process noise.
3 MeasureNoisy sensor reading around true state.
4 WeightLikelihood creates unequal particle weights.
5 ESSDegeneracy score decides whether to resample.
6 ResampleHigh-weight hypotheses are copied.

Particle Filter Field

Prior: particles encode the current belief before prediction and measurement update.

Prior
Particle filter animation field Particles, true position, measurement circle, weighted estimate, ESS gauge, and systematic resampling visualization. true state weighted estimate higher weight lower weight
Weighted estimate: initializing The prior starts with equal weights, so the estimate is the cloud average.
ESS: healthy Equal weights make ESS equal to the number of particles.
Next: predict Use Step to advance through the cycle, or Play cycle to animate continuously.
Weight update Weights are proportional to exp(-distance squared divided by twice the measurement variance).
Degeneracy signal ESS falls when a few particles carry most of the probability mass.
Estimate error The weighted mean is useful for single clusters but can hide multi-modal ambiguity.
Outlier behavior A biased reading can pull weights away from the true state unless the model handles outliers.
Resampling method Systematic resampling uses one random offset and evenly spaced picks through the CDF.
Edge deployment Particle count, resampling frequency, and roughening are practical tuning levers on IoT devices.

Formula Trace

The active stage maps directly to the equations used in a standard particle filter.

prediction: x_i(t) = f(x_i(t-1), u_t) + process noise
likelihood: l_i = exp(-distance_i^2 / (2 * sigma_z^2))
normalized weight: w_i = l_i / sum(l_j)
estimate: x_hat = sum(w_i * x_i)
Effective Sample Size: ESS = 1 / sum(w_i^2)
threshold: resample when ESS < threshold ratio * N
systematic resampling positions: u_j = u_0 + j / N

Reference Material

Use these quick cards to connect the animation with implementation decisions.

Particle Filter Quick Reference
StateThe unknown quantity to estimate, such as robot position or asset location.
ParticleOne sampled hypothesis about the state.
WeightA normalized probability-like importance value for each hypothesis.
PredictionApplies a motion or process model before the next observation.
Measurement updateScores each particle against the latest sensor reading.
PosteriorThe weighted cloud after the observation has been processed.
Resampling and Degeneracy Checklist
ESS near NWeights are even; the cloud still has useful diversity.
ESS near 1Almost all probability mass sits on one particle.
ThresholdCommon practice is to resample below roughly 30% to 60% of N.
Systematic methodUses one random start and evenly spaced CDF positions.
ImpoverishmentRepeated copies can remove diversity after resampling.
RougheningAdds small noise to copied particles when diversity is too low.
Technical Accuracy Notes
Likelihood modelThis page uses an isotropic Gaussian measurement model in metres.
NormalisationWeights are divided by their total so sum(w_i) equals 1.
Estimate choiceThe mean is shown, but MAP or clustering may be better for multi-modal cases.
OutliersReal systems often gate measurements or mix in an outlier probability.
ComplexityPrediction, weighting, ESS, and systematic resampling are O(N).
Kalman comparisonKalman filters fit linear Gaussian assumptions; particle filters handle non-linear and non-Gaussian cases.