Fast-BOCPD

Getting Started

  • Installation
    • Requirements
    • Installation Methods
      • Via pip (recommended)
      • From source
    • Troubleshooting
      • Compilation errors
      • Import errors
    • Verifying Installation
  • Quick Start
    • Installation
    • Basic Usage
      • Step 1: Generate Test Data
      • Step 2: Set Up the Detector
      • Step 3: Detect Changepoints
    • Visualizing Results
    • Online (Streaming) Mode
    • Next Steps
    • Common Mistakes
  • Your First Detection
    • 1. Create a toy dataset
    • 2. Instantiate a model and hazard
    • 3. Stream observations
    • 4. Simple alerting
    • 5. Visualize
    • Next steps

User Guide

  • Choosing the Right Observation Model
    • Quick Decision Path
    • Model Comparison Snapshot
    • Observation Model Details
      • GaussianNIG (GaussianNIG)
      • StudentTNG (StudentTNG)
      • PoissonGamma (PoissonGamma)
      • BernoulliBeta (BernoulliBeta) & BinomialBeta (BinomialBeta)
      • GammaGamma (GammaGamma)
    • Hazard Function Interaction
    • Practical Recommendations
      • Bernoulli (Beta Prior)
      • Binomial (Beta Prior)
      • Gamma (Gamma Prior)
    • Common Mistakes to Avoid
    • When in Doubt
    • Next Steps
  • Tuning Parameters
    • General Strategy
    • Hazard Parameter (lambda_)
    • Observation Model Hyperparameters
      • GaussianNIG
      • StudentTNG
      • PoissonGamma
      • Bernoulli/Binomial Beta
      • Gamma-Gamma (Fixed Shape)
    • Practical Workflow
  • Interpreting Results
    • Run-Length Posterior
      • Understanding the Posterior
    • MAP Run Length and Confidence
    • Batch Output
    • Practical Detection Rules
    • Visualising Results
    • Exporting State
    • Interpreting False Positives/Negatives
  • Performance Tips
    • Choose the Right Mode
    • Feed Contiguous NumPy Arrays
    • Set max_run_length Appropriately
    • Avoid Expensive Models When Not Needed
    • Leverage Offline Warm-Up
    • Disabling Strict Validation (Advanced)
    • Profiling Tips

API Reference

  • API Reference
    • Core Classes
      • BOCPD
        • BOCPD
      • OnlineChangeDetector
        • OnlineChangeDetector
    • Observation Models
      • GaussianNIG
        • GaussianNIG
      • StudentTNG
        • StudentTNG
      • PoissonGamma
        • PoissonGamma
      • BernoulliBeta
        • BernoulliBeta
      • BinomialBeta
        • BinomialBeta
      • GammaGamma
        • GammaGamma
    • Hazard Functions
      • ConstantHazard
        • ConstantHazard
    • Utility Functions
      • Changepoint
        • Changepoint.index
        • Changepoint.prev_run_length
        • Changepoint.cp_prob
        • Changepoint.map_run_length
        • Changepoint.map_confidence
        • Changepoint.observation
        • Changepoint.metadata
        • Changepoint.confidence
      • OnlineChangeDetector
        • OnlineChangeDetector.__init__()
        • OnlineChangeDetector.update()
        • OnlineChangeDetector.get_current_run_length()
        • OnlineChangeDetector.get_current_map_run_length()
        • OnlineChangeDetector.get_changepoints()
        • OnlineChangeDetector.get_map_history()
        • OnlineChangeDetector.get_segments()
        • OnlineChangeDetector.reset()
        • OnlineChangeDetector.__repr__()

Theory & Background

  • Bayesian Online Changepoint Detection
    • Notation
    • Goal
    • Run-Length Recursion
    • Hazard Function
    • Predictive Likelihood
    • Algorithm Skeleton
    • Implementation Mapping
  • Conjugate Priors
    • Why Conjugacy?
  • Model Comparison
    • Hazard Interaction
    • Implementation Notes
  • When to Use BOCPD
    • Suitable Scenarios
    • Less Suitable Scenarios
    • Comparison to Other Methods
    • Implementation Mapping

Examples

  • Stock Volatility Detection
    • Why volatility?
    • Dataset
    • Training phase (2008–2020)
    • Streaming deployment (2021–2025)
    • How to reuse
    • Run the example
    • Key takeaways

Performance

  • Benchmark Methodology
    • Data Generation
    • Execution Protocol
    • Performance Metrics
    • Quick Start
    • Historical Tracking
  • Benchmark Results
    • Summary (100k Observations, Online Mode)
      • Gaussian-NIG
      • Student-t (Fixed ν)
      • Student-t (Grid ν)
      • Bernoulli-Beta
      • Binomial-Beta
      • Poisson-Gamma
      • Gamma-Gamma (Fixed Shape)
      • Key Observations
  • Competitor Comparison
    • Competitor Overview
    • dtolpin/bocd (Pure Python)
    • ruptures (Offline Gaussian)
    • promised-ai/changepoint (Rust)
    • hildensia/bayesian_changepoint_detection (PyTorch)
    • Cross-Library Snapshot (100k Observations)
    • Key Takeaways

Contributing

  • Architecture Overview
    • Why We Mix Python and C
    • Layered Architecture
    • High-Level Data Flow
    • Design Principles
    • Where to Go Next
  • C Backend Architecture
    • Source Layout
    • Key Concepts
      • Defensive Programming
    • Adding New Functionality
    • Testing
  • Python–C Bindings
    • Library Loading
    • Struct Definitions
    • Function Signatures
    • NumPy Interoperability
    • Memory Ownership
    • Troubleshooting
  • Adding New Models
    • 1. Design the Sufficient Statistics
    • 2. Implement the Model in C
    • 3. Register the Model with BOCPD
    • 4. Write Tests
    • 5. Update the Documentation
    • Tips and Best Practices
Fast-BOCPD
  • Search


© Copyright 2025, Tiaan Viviers.

Built with Sphinx using a theme provided by Read the Docs.