Interactive demo · Probabilistic Machine Learning: Advanced Topics · Chapter 13

The bootstrap particle filter: weights, resampling and the evidence

A cloud of N particles is pushed through the dynamics, weighted by how well each one explains the new observation, and (sometimes) resampled. On the linear-Gaussian model the Kalman filter is exact, so the teal band is the truth that the gold particle mean should follow and the exact log evidence is shown next to the particle estimate. Turn resampling off (threshold 0) and the effective sample size collapses to 1: all the weight sits on one particle, the weight degeneracy of sequential importance sampling. Resample at every step and the estimate is good, but the survivors at the final time descend from only a handful of particles at time 1 (path degeneracy). The second data set is the 2-d spiral of the book's Figure 13.1.

Model and data

Number of particles N

Resampling scheme

Resample when ESS < θ N

Length T, state noise q, observation noise r

Try these

Model: zt = 0.9 zt−1 + N(0, q), yt = zt + N(0, r), z1 drawn from the stationary law. The filter proposes from the dynamics (the bootstrap filter) and weights by the likelihood; the evidence estimate is the product of the mean incremental weights. ESS = 1/ΣW2, plotted before any resampling at that step; diamonds mark the steps where the particles were resampled. Dots in the top panel are the first 60 particles, with area proportional to weight. "20 runs" repeats the filter with 20 further seeds and reports the mean and standard deviation. The spiral data are the simulated trajectory and observations of Figure 13.1 (model constants in the notes); the particles start around its initial point.

In the lecture notes