BOCPD study materials
BOCPD study resources

BOCPD: Domain 1: Foundations of Bayesian Online Changepoint Detection

BOCPD · Work through your exam, one topic at a time.

All guide sections

Domain 1: Foundations of Bayesian Online Changepoint Detection

The Core Idea

Bayesian online changepoint detection (BOCPD) treats a data stream as a sequence of segments, each generated by a fixed model, with abrupt switches at changepoints. The central quantity is the run length $r_t$: the number of observations since the most recent changepoint. At each step you maintain a posterior over run lengths, $P(r_t \mid x_{1:t})$, and update it recursively.

The recursion has two ingredients. The hazard function $H(r)$ gives the prior probability that a changepoint occurs now, given the current run length. The underlying predictive $p(x_t \mid r_{t-1}, x_{1:t-1})$ is the probability of the new datum under a segment model conditioned on the data since the last changepoint. The growth probability (no change) is the predictive times $(1 - H)$, and the changepoint probability (reset to run length zero) is the predictive times $H$, summed over all previous run lengths.

Concepts to Master

  • The conjugate exponential family setup: a Normal-Inverse-Gamma prior for a Gaussian segment model, a Beta prior for Bernoulli data, and how the posterior parameters update incrementally.
  • The constant hazard assumption (geometric run-length prior) versus time-varying hazards.
  • The distinction between the run-length posterior, the changepoint probability at each step, and the MAP run length.
  • Computational cost: naive BOCPD is $O(t)$ per step, or $O(t^2)$ overall, motivating pruning and truncation.

Traps

Questions often confuse the hazard rate with the changepoint probability: the hazard is a prior, while the reported changepoint probability is a posterior that also depends on how poorly the current segment explains the data. Another trap is forgetting that the run-length posterior must be renormalized after each update. A third is treating the MAP run length as the changepoint location, when the full posterior mass near zero is what signals a change.

Rule of Thumb

With a constant hazard $1/\lambda$, the prior expected segment length is $\lambda$ observations. Choose $\lambda$ near the typical segment length you expect, and check that the predictive model is not so diffuse that it absorbs genuine changes without flagging them.