Multivariate Bayesian Online Changepoint Detection
multivariate-bocd is a Python package for Multivariate Bayesian Online Changepoint Detection (MBOCD). It is intended for streaming data where each observation is a vector and you want to update changepoint beliefs one sample at a time. The current predictive model uses a Gaussian-Wishart style prior for multivariate observations.
This implementation is derived from the multivariate BOCD module used in the IJRR paper Situationally-Aware Dynamics Learning and its companion source repository, AlejandroMllo/situationally_aware_dynamics_learning. If this repository is useful in your research, please cite the IJRR paper. Parts of this implementation are also inspired by Gregory Gundersen’s univariate Gaussian BOCD work*.
Installation
For local development from a clone, use a virtual environment and install in editable mode:
python -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev,examples]"
Editable mode links the installed package to this checkout, so edits under src/multivariate_bocd are picked up immediately. Inside a virtual environment this should not disturb your system Python. Remove it with python -m pip uninstall multivariate-bocd.
Install the package from PyPI with:
pip install multivariate-bocd
Quick Start
from multivariate_bocd import BOCD, MultivariateGaussianWishartModel, load_wamv_orientation
# Load bundled roll/pitch orientation sample data from the IJRR experiments.
data = load_wamv_orientation()[:1300]
data = 100.0 * data
prior_steps = 150
prior = MultivariateGaussianWishartModel.init_from_data(
data[:prior_steps],
reset_prior_on_changepoint=True,
)
bocd = BOCD(model=prior, hazard=1 / 250)
bocd.fit(data[prior_steps:])
print(bocd.changepoints)
print(bocd.run_length_probabilities().shape)
Examples
Two runnable examples are included:
python examples/wamv_orientation.py
python examples/synthetic_multivariate.py
The WAM-V example uses the bundled roll/pitch orientation data. The synthetic example generates a multivariate Gaussian stream with known changepoints, which is useful for checking that the detector and plotting pipeline work on a clean toy problem.
Repository Layout
src/multivariate_bocd/ Package source
src/multivariate_bocd/data/ Bundled sample CSV data
examples/ Runnable tutorials
tests/ Smoke and API tests
Notes on the Model
The detector follows the online recursion from Adams and MacKay (2007). The multivariate predictive model keeps a parameter history for each run-length hypothesis and can optionally refresh the prior when a changepoint is detected. This package keeps the implementation lightweight and focused on online use; for the complete situational-awareness robotics pipeline, see the companion IJRR repository linked above.
Testing
From a fresh virtual environment:
python -m pip install -e ".[dev,examples]"
python -m pytest
python -m compileall -q src examples tests
Before publishing, build the wheel and install it in a separate clean environment. Maintainer publishing notes can live in an ignored local file such as PUBLISHING_LOCAL.md.
Citation
Plain text:
Alejandro Murillo-Gonzalez and Lantao Liu. "Situationally-Aware Dynamics Learning." The International Journal of Robotics Research. 2026. doi:10.1177/02783649261431863
BibTeX:
@article{murillo2026situationalawareness,
author = {Alejandro Murillo-Gonzalez and Lantao Liu},
title = {Situationally-Aware Dynamics Learning},
journal = {The International Journal of Robotics Research},
volume = {0},
number = {0},
pages = {02783649261431863},
year = {2026},
doi = {10.1177/02783649261431863},
URL = {https://doi.org/10.1177/02783649261431863},
eprint = {https://doi.org/10.1177/02783649261431863}
}
License
MIT. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multivariate_bocd-0.1.0.tar.gz.
File metadata
- Download URL: multivariate_bocd-0.1.0.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18e94a04ad5018f5412f9ac11a9aefcabe2ea5e146d0fe4a60a55191b0b8f954
|
|
| MD5 |
11ce54e1b9402b16a8ddad30b2191379
|
|
| BLAKE2b-256 |
06344c95242bd5a62ae058b60b60a1bcb02d2c236f3620fda60d84b3248d8d35
|
File details
Details for the file multivariate_bocd-0.1.0-py3-none-any.whl.
File metadata
- Download URL: multivariate_bocd-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d27eca0b6baefb47ff4d796d3c75901b5e17f78c15317a95e61b45e74317718
|
|
| MD5 |
60544e2bf7a638dafceb3e3f4cc1faf4
|
|
| BLAKE2b-256 |
9095f58c46de4f96bd248c959cf12e920c539d7e4bc5cd49aea90916684bfdd1
|