Bayesian Decision Analysis
At PyData Global 2025 I presented a workshop on Bayesian Decision Analysis with PyMC. The video is available now.
This workshop is based on the first session of the Applied Bayesian Modeling Workshop I teach along with my colleagues at PyMC Labs. If you would like to learn more, it is not too late to sign up for the next offering, starting Monday January 12.
Resources:
- The slides are here
- The GitHub repository with the workshop material is here
- You can run the notebooks on Colab: notebook without solutions, notebook with solutions
Here’s the abstract and description of the workshop.
Bayesian Decision Analysis with PyMC: Beyond A/B Testing
This hands-on tutorial introduces practical Bayesian inference using PyMC, focusing on A/B testing, decision-making under uncertainty, and hierarchical modeling. With real-world examples, you’ll learn how to build and interpret Bayesian models, evaluate competing hypotheses, and implement adaptive strategies like Thompson sampling. Whether you’re working in marketing, healthcare, public policy, UX design, or data science more broadly, these techniques offer powerful tools for experimentation, decision-making, and evidence-based analysis.
Description
Bayesian methods offer a natural and interpretable framework for updating beliefs with data, and PyMC makes it easy to apply these techniques in practice. In this tutorial, we’ll walk through a series of examples that demonstrate the core concepts:
- Bayesian A/B Testing with the Beta-Binomial Model
- Represent prior beliefs with the beta distribution
- Use binomial likelihoods to model observed outcomes
- Understand posterior distributions and credible intervals
- Bayesian Bandits and Thompson Sampling
- Go beyond hypothesis testing: estimate the probability of one version outperforming another
- Use Thompson sampling to guide decision-making
- Simulate and visualize an adaptive email campaign
- Hierarchical Models for Partial Pooling and Prediction
- Learn how to share information across variants
- Use posterior predictive distributions to quantify uncertainty
- Understand second-order probabilities
Hands-On Learning
Participants will follow along in Jupyter notebooks (hosted on Colab — no installation required). Exercises are embedded throughout, with guided solutions. Code is based on PyMC, ArviZ, and standard scientific Python libraries.
Prerequisites
- Intermediate Python: basic familiarity with NumPy, plotting, and Jupyter notebooks
- No prior experience with Bayesian statistics or PyMC is assumed
- All materials run on Colab (no setup required)