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.
AnimationParticle FilterSensor FusionResampling
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/120Effective Sample Size
0.0 mEstimate Error
WaitingResampling 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
Weighted estimate: initializingThe prior starts with equal weights, so the estimate is the cloud average.ESS: healthyEqual weights make ESS equal to the number of particles.Next: predictUse Step to advance through the cycle, or Play cycle to animate continuously.
Weight updateWeights are proportional to exp(-distance squared divided by twice the measurement variance).Degeneracy signalESS falls when a few particles carry most of the probability mass.Estimate errorThe weighted mean is useful for single clusters but can hide multi-modal ambiguity.Outlier behaviorA biased reading can pull weights away from the true state unless the model handles outliers.Resampling methodSystematic resampling uses one random offset and evenly spaced picks through the CDF.Edge deploymentParticle 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.
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.
Related Practice
Open these next when you want to compare estimation, fusion, and anomaly behaviour.