Applied Bayesian Computing in Python

ROS examples, BDA demos, CmdStanPy, BlackJAX, and Oryx

Published

June 22, 2026

Overview

Applied Bayesian Computing in Python collects Python translations and companion computations for examples from applied regression and Bayesian data analysis.

It combines two Aki Vehtari/Gelman-adjacent code bases:

  • ROS-Examples: applied regression, prediction, causal inference, model checking, and multilevel examples for Regression and Other Stories.
  • BDA_py_demos: Python demos for Bayesian Data Analysis, 3rd ed., including posterior simulation, grid approximations, importance sampling, diagnostics, and CmdStanPy examples.

The organizing principle is practical: reproduce the examples in Python, then show which computational layer is best for each job.

  • pandas / numpy / scipy / scikit-learn for ordinary data work, simulation, and validation utilities.
  • Lapylace for formula-first Bayesian GLMs backed by CmdStanPy, matching the everyday stan_glm workflow used throughout ROS.
  • CmdStanPy for readable Bayesian models and Stan-backed inference.
  • BlackJAX for explicit JAX log-density + sampler workflows.
  • Oryx where generative-program transformations clarify the model.

The examples emphasize reproducible computation: data handling, model fitting, posterior simulation, diagnostics, and comparison across Python Bayesian workflows.