Skip to main content

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.

Metadata

Release files for multivariate-bocd 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for multivariate-bocd 0.1.0
File Size Uploaded Provenance Actions
multivariate_bocd-0.1.0.tar.gz 2.1 MB Without provenance Details for multivariate_bocd-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for multivariate-bocd 0.1.0
File Interpreter ABI Platform Actions
multivariate_bocd-0.1.0-py3-none-any.whl Python 3 none any Details for multivariate_bocd-0.1.0-py3-none-any.whl

Total release size: 4.1 MB

Release files / multivariate_bocd-0.1.0.tar.gz

Download URL multivariate_bocd-0.1.0.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
18e94a04ad5018f5412f9ac11a9aefcabe2ea5e146d0fe4a60a55191b0b8f954
BLAKE2b-256 checksum
How to use checksums
06344c95242bd5a62ae058b60b60a1bcb02d2c236f3620fda60d84b3248d8d35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.8

Release files / multivariate_bocd-0.1.0-py3-none-any.whl

Download URL multivariate_bocd-0.1.0-py3-none-any.whl
Size 2.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0d27eca0b6baefb47ff4d796d3c75901b5e17f78c15317a95e61b45e74317718
BLAKE2b-256 checksum
How to use checksums
9095f58c46de4f96bd248c959cf12e920c539d7e4bc5cd49aea90916684bfdd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.8

Security for multivariate-bocd 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page