
A particle filter is a method for estimating the hidden state of a system as that system changes over time.
That sounds similar to a Kalman filter, and it is. Both methods are used for filtering. Both methods combine a model of how the system evolves with noisy observations of that system. Both methods are trying to answer the same basic question:
Given everything I have observed so far, what do I believe about the current hidden state?
The difference is how belief is represented.
A Kalman filter represents belief with a Gaussian distribution. In practice, this means it keeps track of a mean and covariance.
A particle filter represents belief with many weighted samples. These samples are called particles.
Each particle is one possible version of the hidden state. The weight attached to that particle tells us how plausible that possible state is.
{xtk, wtk}k=1K
Here, xtk is the k-th particle at time t, wtk is its weight, and K is the total number of particles.
NOTE: A particle is just a sampled hypothesis about the hidden state. A cloud of weighted particles is an approximation to a probability distribution.
What Is a Particle Filter Used For?
Particle filters are used when we need to estimate a hidden state over time, but the uncertainty is too complicated for a simple Gaussian approximation.
They are common in robotics, object tracking, target localization, navigation, nonlinear time-series analysis, ecological modeling, econometrics, signal processing, and fault detection.
A classic example is robot localization.
Suppose a robot is moving through a building. The robot has a map, but it does not know exactly where it is. Its sensors are noisy. Several hallways may look similar. Several locations may explain the same observation.
A particle filter can keep multiple possible robot locations alive at the same time.
- Some particles may represent the robot being in hallway A.
- Some particles may represent the robot being in hallway B.
- Some particles may represent the robot being in a nearby room.
As new observations arrive, the particle filter gives more weight to the particles that better explain the data.
This is the main advantage of particle filters: they do not have to compress uncertainty into one Gaussian blob.
What Problems Are Particle Filters Good For?
Particle filters are useful when uncertainty is complicated.
They are especially good for problems with nonlinear dynamics, nonlinear observations, non-Gaussian noise, ambiguous measurements, multiple possible explanations, tracking under occlusion, sudden changes, or regime switches.
The key idea is that a particle filter can represent a distribution with many shapes.
It can represent skewed uncertainty. It can represent heavy-tailed uncertainty. It can represent uncertainty with several separate modes.
For example, if an object disappears behind another object in a video, there may be several plausible places where it could reappear. A particle filter can keep particles in several of those plausible places until the next observation makes the situation clearer.
A Simple Example: Robot Localization
Suppose a robot is trying to localize itself inside a building.
The hidden state is the robot’s position and orientation.
xt = [x-positiont, y-positiont, orientationt]
The robot receives sensor measurements. These might be distances to walls, visual features from a camera, or laser range measurements.
The observation at time t is:
yt = sensor measurement at time t
At the beginning, the robot may not know where it is. So we initialize many particles across the map.
Each particle is one guess about the robot’s pose.
One particle might say: maybe the robot is in this hallway, facing north.
Another particle might say: maybe the robot is in that room, facing east.
Another particle might say: maybe the robot is near this wall, facing south.
Now the robot moves.
Each particle is moved forward according to the motion model.
xtk ~ p(xt | xt-1k)
This means that the k-th particle at time t is sampled from the transition model, given where that particle was at the previous time step.
In plain language:
Move each possible robot pose forward according to the robot’s motion model, but include motion noise.
Then the robot receives a new sensor measurement.
For each particle, we ask:
If the robot were actually at this particle’s location, how likely would this sensor measurement be?
Particles that explain the measurement well receive high weights. Particles that explain the measurement poorly receive low weights.
wtk ∝ p(yt | xtk)
This says that the weight of particle k is proportional to the likelihood of the observation under that particle.
After computing the weights, we normalize them so they sum to one.
wtk = wtk / Σj=1K wtj
Now the normalized weights can be treated like probabilities over particles.
The Particle Filter Algorithm
The basic particle filter has three main steps.
- Propagate the particles through the motion model.
- Weight the particles using the new observation.
- Resample the particles so that plausible particles survive.
Then repeat.
This is why particle filters are also called Sequential Monte Carlo methods.
“Monte Carlo” means we approximate distributions using samples.
“Sequential” means we update those samples over time as new observations arrive.
Resampling
After a few time steps, many particles may have weights close to zero. Only a few particles may explain the observations well.
This is called particle degeneracy.
Degeneracy means we are wasting computation on particles that no longer matter.
To fix this, particle filters usually resample.
During resampling, high-weight particles are likely to be copied. Low-weight particles are likely to disappear.
Suppose four particles have normalized weights:
[0.05, 0.45, 0.40, 0.10]
The second and third particles are much more likely to survive than the first and fourth particles.
After resampling, we still have the same number of particles, but more of them are concentrated in plausible regions of the state space.
NOTE: Resampling is useful, but it can also reduce diversity. If we keep copying the same high-weight particles, the particle population may lose alternative explanations too quickly.
What Is Required to Set Up a Particle Filter?
To use a particle filter, we need more than just particles. We need to define the probabilistic model that tells the particles how to move, how to compare themselves to data, and how to survive over time.
A particle filter needs five main ingredients.
- A hidden state. This is what we are trying to estimate.
- A transition model. This tells us how the hidden state evolves from one time step to the next.
- An observation model. This tells us how likely an observation is, given a possible hidden state.
- An initial particle distribution. This tells us where the particles should start.
- A resampling rule. This tells us when and how to copy high-weight particles and remove low-weight particles.
The most important modeling choice is the hidden state.
If the state is too small, the filter will not contain enough information to predict the future. If the state is too large, the filter may need an enormous number of particles to work well.
For a robot, the state might be position and orientation:
xt = [x-positiont, y-positiont, orientationt]
For an object in a video, the state might include position, velocity, width, and height.
For a biological or medical time-series problem, the state might include an unobserved disease burden, a latent response level, or a patient-specific trajectory variable.
The key question is:
What information does the filter need to carry forward so that it can explain future observations?
How to Build the Particle Filter
Once the hidden state is defined, the next step is to define the transition model.
The transition model answers:
If the system is currently in this state, where could it plausibly go next?
In notation, we write this as:
xt ~ p(xt | xt-1)
This means the next state is sampled from a distribution that depends on the previous state.
For a robot, this might use a motion model. If the robot moves forward, each particle moves forward too, but with some noise. That noise matters because real movement is imperfect.
After defining the transition model, we define the observation model.
The observation model answers:
If this particle were the true state, how likely would the observed data be?
This is the likelihood:
wtk ∝ p(yt | xtk)
This is where the data enters the filter. A particle survives because it predicts observations that look like the observations we actually received.
Then we normalize the weights, resample particles, and repeat the process at the next time step.
In practice, the workflow looks like this:
- Choose the hidden state.
- Initialize many particles.
- Move each particle forward using the transition model.
- Compare each particle to the new observation.
- Assign a weight to each particle.
- Normalize the weights.
- Resample if the particle population has degenerated.
- Use the resulting particles to estimate the current state.
For example, the current state estimate might be the weighted average of the particles, but that is not always the only useful summary. Sometimes the full particle cloud is more informative than a single average.
NOTE: If the posterior has two modes, the weighted average may fall between them and may not represent a realistic state. In that case, it is better to inspect the particle distribution itself.
What to Look For
When a particle filter is working well, the particles should behave in a sensible way.
Early on, the particles may be spread out because uncertainty is high. As observations arrive, particles should begin concentrating in regions that explain the data well.
Good signs include:
- particles concentrate around plausible states,
- high-weight particles are consistent with observations,
- the filter does not collapse too early,
- multiple hypotheses survive when the data are genuinely ambiguous,
- uncertainty decreases when observations are informative,
- uncertainty increases when observations are missing or noisy.
The particle cloud should tell a story. If the data are clear, the particles should agree. If the data are ambiguous, the particles should preserve that ambiguity instead of pretending to be certain.
What to Watch Out For
Particle filters are flexible, but they can fail in predictable ways.
The first problem is particle degeneracy.
This happens when almost all particles have tiny weights and only a few particles carry most of the probability mass.
A common diagnostic is the effective sample size. It estimates how many particles are actually contributing.
ESS = 1 / Σk=1K (wtk)2
If the effective sample size is low, the filter is relying on too few particles. That usually means resampling is needed.
The second problem is particle impoverishment.
This happens after resampling, when many particles become copies of the same high-weight particles. The filter may look confident, but it has lost diversity.
This can be dangerous because the filter may commit too early to one explanation and lose other plausible hypotheses.
The third problem is a poor transition model.
If the transition model does not allow particles to move into the region where the true state is, then the filter cannot recover. No amount of weighting can save particles that never reach plausible states.
The fourth problem is a poor observation model.
If the likelihood is too sharp, the filter may kill off too many particles. If the likelihood is too broad, the observations may not influence the particles enough.
The fifth problem is too few particles.
Particle filters can struggle in high-dimensional spaces because the number of particles needed may grow very quickly. This is one reason particle filters are powerful but not magical.
In practice, you should watch for these warning signs:
- one particle receives almost all the weight,
- particles collapse into a tiny region too early,
- particles remain spread out even after informative observations,
- the filter is very sensitive to random seed,
- state estimates jump erratically,
- the weighted average gives an impossible or meaningless state.
When these happen, the issue is usually not just the particle filter algorithm. It is often the model setup: the state definition, transition model, observation model, noise assumptions, or number of particles.
A Practical Way to Think About It
A particle filter is not just a computational trick. It is a way of carrying uncertainty through time.
To set it up well, think like this:
What are the possible states of the world?
How can those states evolve?
What observations would each state produce?
Which possible states should survive after seeing the data?
That is the whole logic of the particle filter.
The particles represent possible states. The transition model moves them forward. The observation model scores them. Resampling reallocates computation toward the states that remain plausible.
If those pieces are well designed, the filter can represent complicated uncertainty in a way that a single Gaussian belief cannot.
The Bayesian View
The goal of filtering is to estimate:
p(xt | y1, …, yt)
This is the distribution of the current hidden state, given all observations so far.
A Kalman filter solves this exactly when the model is linear and Gaussian.
A particle filter approximates this distribution using weighted particles.
p(xt | y1, …, yt) ≈ Σk=1K wtk δ(xt − xtk)
This notation says that the posterior distribution is approximated by point masses at the particles, weighted by their normalized weights.
The symbol δ represents a point mass. In plain language, it places probability directly on a particle.
You do not need to love this notation to understand the idea.
The posterior is represented by many weighted guesses instead of by one Gaussian distribution.
Discussion
Particle filters are powerful because they can keep multiple hypotheses alive.
This matters when observations are ambiguous.
Suppose a robot could be in two similar-looking rooms. A Kalman filter may average those two possible locations and place the robot somewhere between them. A particle filter can place some particles in one room and some particles in the other room.
Then, as more observations arrive, the particles in the better location receive higher weights and survive.
So the particle filter does not have to decide too early.
That flexibility is the main advantage.
But flexibility has a cost.
Particle filters can be computationally expensive. If the state space is high-dimensional, we may need many particles to approximate the posterior well.
If we use too few particles, the filter can collapse onto a small number of states. Resampling helps with degeneracy, but it can also reduce diversity.
So particle filters are not automatically better than Kalman filters.
A Kalman filter is usually better when the system is approximately linear, Gaussian, and real-time efficiency matters.
A particle filter is usually better when the posterior is nonlinear, non-Gaussian, multimodal, or ambiguous.
The simplest summary is:
A Kalman filter tracks one Gaussian belief over time.
A particle filter tracks many possible states over time.
Both are Bayesian filters.
They differ mainly in how they represent uncertainty.
