Domain 2: Segment Models, Priors, and Predictive Distributions
Why the Segment Model Matters
BOCPD is only as good as the predictive distribution it uses within a segment. The standard construction pairs a conjugate prior with a likelihood so that the posterior over segment parameters has a closed form and the predictive $p(x_t \mid \text{segment data})$ can be computed exactly.
For Gaussian data with unknown mean and variance, use a Normal-Inverse-Gamma prior: the mean is Normal conditional on the variance, and the variance has an Inverse-Gamma prior. The predictive is a Student-t distribution, whose heavy tails are important: they prevent a single outlier from instantly forcing a changepoint.
For Bernoulli or count data, use a Beta or Gamma prior; the predictive is a Beta-Bernoulli or negative-binomial form. For multivariate data, the Normal-Inverse-Wishart prior gives a multivariate Student-t predictive.
Concepts to Master
- How prior hyperparameters (prior mean $\mu_0$, pseudo-count $\kappa_0$, shape $\alpha_0$, scale $\beta_0$) act as pseudo-observations and control sensitivity.
- Sufficient statistics updating: each run length carries its own running statistics, so a changepoint simply starts a fresh set from the prior.
- The trade-off between a diffuse prior (slow to detect, robust) and a tight prior (fast detection, more false alarms).
- Handling of missing data and outliers through the predictive likelihood.
Traps
A common error is using a plug-in Gaussian predictive with estimated mean and variance instead of the true Student-t predictive; this understates tail mass and inflates false changepoints. Another is forgetting that the prior parameters are reset at each hypothetical changepoint, so the run-length-zero predictive is the prior predictive, not the current segment's predictive. Questions may also ask what happens as $\kappa_0 \to \infty$: the model becomes rigid and insensitive to changes.
Worked Example
Suppose a Normal-Inverse-Gamma prior with $\mu_0 = 0$, $\kappa_0 = 1$, $\alpha_0 = 1$, $\beta_0 = 1$. After observing $x = 2$, the updated mean is $(\kappa_0\mu_0 + x)/(\kappa_0+1) = 1$, and the scale parameter grows by the squared deviation. The predictive for the next point is Student-t with $2\alpha = 2$ degrees of freedom, centered at 1, with scale reflecting both prior and data uncertainty.