skip to content
Ben Lau statistics . machine learning . programming . optimization . research
Trace plot

Bayesian Change Point Detection

1 min read Updated: Demo Code
  • Implemented several hierarchical Bayesian models to detect change points in time series data
  • Tried linear regression, Gaussian processes, Kalman filter, Gaussian mixture, and Student’s t mixture models

Baseline Model

A simple linear regression model is used to fit the data.

Trace plot is shown below:

trace plot

Fitted as:

Fitted

First model

Model architecture:

Model architecture

Trace plot is shown below:

trace plot

Fitted as:

Fitted

Second model

Model architecture:

Model architecture

Trace plot is shown below:

trace plot

Fitted as:

Fitted

Comparison

modelrankweightlood_loo
switchpoint00.971818-72.9917310.000000
baseline10.028182-158.43089985.439168

Rank is the rank-order of the models with 0 being the best model. Weight can be loosely interpreted as the probability of each model (among the compared model) given the data. As a result, the switchpoint model is much better than the baseline model.