Quant Memo
Advanced

Sequential Monte Carlo and Particle Filters

A method for tracking a hidden, evolving state from noisy observations over time by maintaining a swarm of weighted guesses that gets reweighted by new evidence and periodically resampled to keep the swarm alive where it matters.

Prerequisites: Markov Chains, The Law of Large Numbers

A model for volatility, a hidden regime, or an interest-rate factor is often a state that isn't directly observed — only noisy signals related to it are. If the model is linear and the noise is Gaussian, the Kalman filter tracks that hidden state exactly and cheaply. Real financial state-space models are usually neither linear nor Gaussian, and the Kalman filter's clean formulas break down. Sequential Monte Carlo, better known as the particle filter, tracks the hidden state anyway, using not one estimate but a whole swarm of candidate guesses that gets pruned and refreshed as new data arrives.

An analogy: a search party with shifting confidence

Imagine a search party looking for a lost hiker along a trail, starting with searchers spread out evenly since nobody knows where the hiker is. Each searcher represents a guess. When a clue comes in — a footprint, a sighting — searchers near that clue become more "confident" (get more weight) and searchers far from it become less confident, without anyone physically moving yet. Once confidence gets too lopsided (a few searchers holding almost all the credibility, the rest useless), the party regroups: it disbands the low-confidence searchers and redeploys fresh searchers near the high-confidence ones, ready for the next clue. That regroup step is resampling, and the whole cycle — spread, reweight by evidence, resample — is exactly sequential Monte Carlo.

The method, one symbol at a time

Maintain a set of NN particles, xt(1),,xt(N)x_t^{(1)}, \dots, x_t^{(N)}, each a candidate value for the hidden state at time tt, with an associated weight wt(i)w_t^{(i)} summing to 1 across particles. At each new observation yty_t: (1) propagate each particle forward through the model's dynamics to get a candidate for xt+1x_{t+1}; (2) reweight each particle by the likelihood of the new observation given that particle's state, wt+1(i)wt(i)p(yt+1xt+1(i))w_{t+1}^{(i)} \propto w_t^{(i)} \cdot p(y_{t+1} \mid x_{t+1}^{(i)}) — particles that would have made the observation likely get heavier; (3) resample — draw a new set of NN particles, with replacement, choosing each existing particle with probability proportional to its weight, then reset all weights equal. The weighted particle swarm at each step approximates the true posterior distribution of the hidden state given all data seen so far, and that approximation gets better as NN grows.

Worked example 1: one reweighting step by hand

Suppose 5 particles represent guesses for a hidden state: x=(1,2,3,4,5)x = (1, 2, 3, 4, 5), all starting with equal weight 0.20.2. A new observation arrives and, based on the model's noise assumption, the likelihood of seeing that observation given each state is (0.1,0.3,0.4,0.15,0.05)(0.1, 0.3, 0.4, 0.15, 0.05). Unnormalized new weights: 0.2×0.1=0.020.2 \times 0.1 = 0.02, 0.2×0.3=0.060.2 \times 0.3 = 0.06, 0.2×0.4=0.080.2 \times 0.4 = 0.08, 0.2×0.15=0.030.2 \times 0.15 = 0.03, 0.2×0.05=0.010.2 \times 0.05 = 0.01. Sum =0.20= 0.20. Normalized weights: 0.10,0.30,0.40,0.15,0.050.10, 0.30, 0.40, 0.15, 0.05. The particle at x=3x=3 now carries 40% of the total belief, up from a flat 20%, because it best explains the new observation.

Worked example 2: resampling from those weights

Using the weights above (0.10,0.30,0.40,0.15,0.05)(0.10, 0.30, 0.40, 0.15, 0.05), lay out cumulative bins: [0,0.10)x=1[0,0.10)\to x{=}1, [0.10,0.40)x=2[0.10,0.40)\to x{=}2, [0.40,0.80)x=3[0.40,0.80)\to x{=}3, [0.80,0.95)x=4[0.80,0.95)\to x{=}4, [0.95,1.0)x=5[0.95,1.0)\to x{=}5 (this is inverse transform sampling applied to the particle weights). Five uniform draws U=0.05,0.25,0.55,0.70,0.90U = 0.05, 0.25, 0.55, 0.70, 0.90 land in bins giving the new particle set (1,2,3,3,4)(1, 2, 3, 3, 4) — the low-weight particles at x=1x=1 and x=5x=5 mostly vanish, while x=3x=3 is duplicated, concentrating the swarm's computational effort where the evidence says the state most likely is.

Path explorer
13055time →
end (bold path) 100.38spread of ends 58.966 independent paths, same settings

Picture each sampled path above as one particle's trajectory through time; a particle filter runs many such paths in parallel and continuously culls the ones that stop matching incoming data.

weights after reweighting 0.10 0.30 0.40 0.15 0.05 particles after resampling x=2 x=3 x=3 x=4 x=1
Resampling replaces the weighted swarm with an equally-weighted one, drawing each new particle with probability proportional to its old weight — heavy particles get duplicated, light ones tend to vanish.

What this means in practice

Particle filters are used to track latent volatility, filter noisy signals in nonlinear state-space models, and estimate parameters online in models too irregular for a Kalman filter. Their accuracy depends heavily on particle count and how well the propagation step covers the region the true state is likely to move into next; too few particles or a badly-tuned propagation step causes particle degeneracy, where all the weight collapses onto one or two particles and the swarm stops usefully representing uncertainty.

A particle filter tracks a hidden, evolving state by maintaining a weighted swarm of candidate guesses that gets reweighted by how well each guess explains new data, then resampled to concentrate particles where the evidence points — approximating the true posterior distribution of the state at each point in time.

The classic failure mode is particle degeneracy: after several reweighting steps without resampling, almost all the weight can concentrate on a single particle, so the "swarm" of thousands of particles is effectively representing the state with just one. This isn't visible from the particle count alone — you have to check the effective sample size (roughly 1/i(w(i))21/\sum_i (w^{(i)})^2) or the weight distribution directly, and resample often enough to prevent it, or the filter silently degrades into tracking a single, possibly wrong, trajectory rather than a genuine distribution of belief.

Related concepts

Practice in interviews

Further reading

  • Doucet, de Freitas & Gordon, Sequential Monte Carlo Methods in Practice
  • Gordon, Salmond & Smith, Novel Approach to Nonlinear/Non-Gaussian Bayesian State Estimation
ShareTwitterLinkedIn