Self-paced course · Advanced · 136 lessons

MODEL ANYTHING.

Becoming a BayeZian II

Ship production-grade Bayesian models, survival analysis, Gaussian processes, physics-constrained systems.

An agent can write the model. This course is about knowing when it is wrong.

Who it is for. Practitioners who finished BayeZian I (or have equivalent Stan experience) and want the advanced, production-grade toolkit.

$499 Enroll now One payment, lifetime access. Included with Membership.
Why take this

Three things you leave with.

Mixture, survival, and ordinal models in Stan

Gaussian processes and Hilbert-space approximations

Physics-constrained and differential-equation models

Not for you if
  • You haven't built a Bayesian model before, start with BayeZian I
  • You want a quick overview, not depth
  • You don't work in R and Stan
  • You want off-the-shelf models, not to build your own
Play with the data

Run the code, in your browser.

The chart on this page, drawn by code you can edit. R runs on webR and Python on Pyodide; nothing loads until you press Run, and nothing you type leaves the page.

Python
This chart is the code's result. Run recomputes it in your browser.
Posterior for each pitch type's average speed after twenty pitches, shaded to the 90% interval; the diamond is the average over all 1,500.

Edit me: Move the prior sd, or change first_n to 200 and run: the data overwhelms the prior.

Data: Pitch speeds by type (pitches_2026.csv). Simulated for practice by AthlyticZ (agents/sim_data.py, seed 20261109). License CC BY 4.0.

The code runs in your browser on Pyodide; nothing you type leaves the page.

What you get

Everything that exists for this course, and nothing that does not.

  • Every lesson136 lessons in 19 sections, yours to keep
  • Project files and codeEvery notebook, dataset and finished build, to keep and adapt
Scott Spencer
Your instructor Scott Spencer

PhD · Lecturer, Applied Analytics @ Columbia University

Teaches the course the way the work is done in the role above. The team page lists everything they teach here.

Also teaches Becoming a BayeZian.

The problem

The real questions do not fit a single simple model: grouped data, counts, mixtures, time, and constraints from the physics of the sport.

Three decisions it teaches
  1. When to pool, and how hierarchical structure changes the answer
  2. Which likelihood fits the data: Poisson scores, mixtures, overdispersion
  3. How to build a model that respects what you know about the game

The artifact. Advanced Bayesian models across sports, each fit, checked and explained.

Pythonagents/viz/becoming-a-bayezian-ii.py
2026-11-09T02:12:20.743313 image/svg+xml Matplotlib v3.10.8, https://matplotlib.org/ 0.10 0.15 0.20 0.25 0.30 0.35 average, first 45 at-bats 0.10 0.15 0.20 0.25 0.30 0.35 posterior mean Partial pooling: every hitter pulled toward 0.249, the hot starts most of all no pooling complete pooling partial pooling
Empirical-Bayes shrinkage on nineteen hitters: how far each moves toward the group, by how little data he has. Drawn at build from the data on this site by the code below.
The code that drew it
# Empirical-Bayes shrinkage on nineteen hitters: how far each moves toward the group, by how little data he has.
import sys, pathlib, csv
sys.path.insert(0, str(pathlib.Path(__file__).parent))
from _palette import plt, emit, GOLD, AQUA, CREAM, MUTE
import numpy as np

rows = list(csv.DictReader(open("site/18-practice/hot-start-hitters/files/batting_2026.csv")))
ab = np.array([int(r["at_bats"]) for r in rows]); h = np.array([int(r["hits"]) for r in rows])
raw = h / ab; m = raw.mean(); v = raw.var(ddof=1); k = m * (1 - m) / v - 1
post = (m * k + h) / (k + ab)
fig, ax = plt.subplots(figsize=(7.2, 4.0))
ax.plot([raw.min(), raw.max()], [raw.min(), raw.max()], color=MUTE, lw=1, ls="--", label="no pooling")
ax.axhline(m, color=MUTE, lw=1, ls=":", label="complete pooling")
ax.scatter(raw, post, color=GOLD, s=40, zorder=3, label="partial pooling")
for r0, p0 in zip(raw, post):
    ax.plot([r0, r0], [r0, p0], color=AQUA, lw=1, alpha=.8)
ax.set_xlabel("average, first 45 at-bats"); ax.set_ylabel("posterior mean"); ax.legend(frameon=False, fontsize=9)
ax.set_title(f"Partial pooling: every hitter pulled toward {m:.3f}, the hot starts most of all")
emit(fig)

Data: Hot-start hitters. Simulated for practice by AthlyticZ (agents/sim_data.py, seed 20261109). License CC BY 4.0.

Curriculum

Every section, every lesson.

From the academy course record, in the order it is taught. The first section is open; the rest fold out.

136 lessons in 19 sections. Every lesson is yours to keep.

Introduction3 items
  1. Welcome to the Course
  2. High-Level Review of First Course Topics
  3. Roadmap of this Course
Workflow5 items
  1. Workflow Introduction
  2. Before Fitting a Model
  3. Fitting a Model and Working with Simulations
  4. Evaluating and Using the Fitted Model
  5. Understanding and Comparing Multiple Models
Mixture Models9 items
  1. Mixture Models Introduction
  2. Overdispersion
  3. Exploring Baseball Scores as Poisson Distributed
  4. Negative Binomial as Mixture of Poisson Distributions
  5. Baseball Scores as Mixture of Poisson Distributions
  6. Zero-Inflation Processes and Hurdle Models
  7. Modeling Three Point Attempts with Poisson and NB Models
  8. Zero-Inflated Poisson
  9. Zero-Inflated Negative Binomial
Rating and Ranking Models10 items
  1. Rating and Ranking Models Introduction
  2. Pairwise Comparisons
  3. Comparing Among Items in a Set
  4. Extended Ranking Models
  5. Fitting Plackett-Luce with stan
  6. Estimating Expectation of Position
  7. Ordinal Regression
  8. General Principles of Ordinal Regression
  9. Ordinal Regression in R and Stan
  10. Simulating Scout Scores in Stan
(A Bit More) Advanced Hierarchical Models4 items
  1. Advanced Hierarchical Models Introduction
  2. Common Approach Omits Information
  3. Multi-level Structure Propagates Uncertainty
  4. Motivating Example
Sufficient Statistics3 items
  1. Sufficient Statistics Introduction
  2. Understanding Sufficient Statistics in Sports Analytics
  3. Using Sufficient Statistics in Practice
(More About) Correlation4 items
  1. (More About) Correlation Introudction
  2. Trivariate Reduction
  3. Marginal Plus Conditional
  4. Copulas
QR Decomposition4 items
  1. QR Reparameterization
  2. Understanding the Problem of Correlated Covariates
  3. Mathematics of QR Decomposition
  4. Practical Implementation in Stan and R
Autoregressive Processes6 items
  1. Autoregressive Processes Introduction
  2. AR Processes with Equal Time between Measures
  3. AR Processes with Irregular Times (Gaps) between Measures
  4. Coding the Model in Stan
  5. Fitting the Model with Data
  6. Multiple AR Processes with Interactions
Survival Analysis16 items
  1. Survival Analysis Introduction
  2. Time-to-Events | Proportional to Power Law
  3. Simulate Time-to-Event Data
  4. General Hazard and Survivor Functions
  5. Weibull Survival Model without Covariates
  6. Weibull Model with Covariates
  7. Modifying the Priors for Baseball
  8. Fitting Model to Baseball Data
  9. Posterior Inference
  10. Interpreting the Coefficients
  11. Discretizing the Weibull Distribution
  12. Discrete Hazard Function
  13. Log-Hazard in Discrete Time
  14. Discrete Time Stan Model
  15. Estimate Parameters from Baseball Data
  16. Posterior Predictive Checks
Differential Equations5 items
  1. Differential Equations Introduction
  2. Example: Usain Bolt's World Record Sprint
  3. Example: Joint Model of Sprinter World Champions
  4. Using the Model
  5. Refactoring the Model for Parallelizing the Likelihood
Difference Equations5 items
  1. Difference Equations Introduction
  2. Modeling Performance: Bannister's Impulse-Response Model
  3. Cycling Power Data for Training
  4. Coding the Model in Stan
  5. Using the Model
Splines15 items
  1. Splines Introduction
  2. Expected Goals Data
  3. Simulating Data for Splines
  4. Model Overview
  5. B-Spline Construction for a Single Variable
  6. Regression on B-Spline using Stan
  7. Counterfactual Data and use of Model
  8. Speeding up the Spline
  9. Tensor Product of Spline Bases
  10. Two-Dimensional Splines
  11. Implementing the Tensor Product in Stan and R
  12. Regression and Kroenecker Product
  13. Prediction for New Data
  14. Model Comparison
  15. Implications
Gaussian Processes10 items
  1. Gaussian Processes Introduction
  2. Likelihood
  3. Gaussian Process Prior for Latent Function
  4. Understanding the Cholesky Decomposition in Gaussian Processes
  5. Using the Cholesky Decomposition
  6. Hyperparameters and Priors
  7. Estimates at New or Counterfactual x
  8. Stan Code for N-Dimensional Gaussian Processes
  9. Testing the Code in One Dimension
  10. Testing the Code in Two Dimensions
Hilbert-Space Approximate GPs12 items
  1. Hilbert-Space Approximate GPs Introduction
  2. Math Refresher, Fourier Transforms
  3. HSGP Basis Functions Generally
  4. Frequencies in Basis Functions
  5. More Math, Spectral Densities
  6. Basis Functions
  7. Weighted Basis Function to Sum Model
  8. Likelihood for Observed Data
  9. Priors for Parameters
  10. Full Model Specification
  11. Visual Walkthrough in r
  12. Implementation of N-Dimensional HSGP in Stan
Physics-Constrained Models9 items
  1. Physics-Constrained Models Introduction
  2. Sail GP Racing
  3. Load and Explore the Data
  4. Physics of Sailing
  5. Coding the Physics in Stan
  6. Checking and Reviewing the Posterior
  7. Golf Putting
  8. Base Running
  9. Umpire Called Strikes
Common Issues10 items
  1. Common Issues Introduction
  2. Outliers and Robustness
  3. Missing Data Imputation
  4. Hit Tracking System Data in Baseball
  5. Constraints in the Measurement Systems
  6. Mathematical Model
  7. Implementation in Stan
  8. Estimating Missing Values with the Model
  9. Censoring and Truncation
  10. Parameter Space Transformations
Computational Performance5 items
  1. Computational Performance Introduction
  2. Coding Optimizations
  3. Within Chain Parallelization
  4. GPU
  5. Memory
Next Steps1 item
  1. Next Steps
What is included

What is yours when you enroll.

  • Lifetime access Every module and lesson, yours to keep and revisit, forever.
  • Project files and code Every notebook, dataset, and finished build, to keep and adapt.
  • All future updates New lessons and refreshes as the tools move, at no extra cost.
  • Self-paced Start today, go at your own pace, no cohort to wait for.

Refunds. If you enrolled and it is the wrong course for you, write to michael@athlyticz.com and a person will answer.

Questions

The ones that stop a purchase.

Is this included with Membership?

Yes. Membership includes this and the entire course catalog, plus the live Masterclass. If you plan to take more than a couple of courses, Membership is the better math.

Is this too advanced, or too basic, for me?

Practitioners who finished BayeZian I (or have equivalent Stan experience) and want the advanced, production-grade toolkit. If the "not for you" list above reads like you, start elsewhere; if the outcome at the top reads like something you could use next week, it is pitched right.

What exactly do I get, and for how long?

19 sections · 136 lessons. Every lesson, the project files and code, and all future updates. Lifetime access: it is yours to keep.

Is it self-paced?

Yes. Start today and go at your own pace, with lifetime access to every lesson and all future updates.

Becoming a BayeZian II

Ship production-grade Bayesian models, survival analysis, Gaussian processes, physics-constrained systems.

This course $499 one payment, lifetime access

19 sections · 136 lessons, the project files, and every future update.

Enroll now
Membership $2,999 a year

This course, the whole catalog, and the Masterclass: every live session and every recording.

Get Membership