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

Bayesian online changepoint detection

Between changepoints the data are Gaussian around a segment mean; at a changepoint the mean jumps to a new value drawn from the prior. The state is the run length rt, the number of earlier readings in the current segment. At each reading the posterior over rt is updated exactly: every run length is weighted by how well its segment predicts the new reading, and mass flows to r = 0 at the hazard rate. The bottom panel shows the run-length posterior (dark = likely): a changepoint appears as the ridge dropping back to zero. The top line lists the changepoints read off the most probable run length.

Data

Model (what BOCPD assumes)

Try these

The segment mean has a conjugate Gaussian prior, so each run length predicts the next reading with a Gaussian (29.65)–(29.67); the update is (29.69)–(29.70) with a constant hazard H = 1/λ (29.64). Cost per step grows with t, so the whole run is O(T2). The log evidence is the sum of the one-step predictive log densities.

In the lecture notes