Self-paced course · Intermediate to Advanced · 80 lessons

PRIOR. DATA. POSTERIOR.

Becoming a BayeZian

Build real Bayesian models in Stan from the ground up, the skill that separates analysts who can quantify uncertainty from those who only ever point-estimate.

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

Who it is for. Analysts and data scientists who can write R and want to actually build Bayesian models in Stan, hands-on.

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

Three things you leave with.

Bayesian models coded and fit in Stan, from priors to posteriors

GLMs and hierarchical models on real sports data

The judgment to check, compare, and trust your models

Not for you if
  • You want a point-and-click stats tool
  • You've never written R
  • You want frequentist-only methods
  • You want theory without building models
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.

This chart is the code's result. Run recomputes it in your browser.
Each hitter's posterior batting average after 45 at-bats, shaded to the 90% credible interval; the diamond is what they hit the rest of the season.

Edit me: Move the prior strength, or edit prior_strength and run: watch the hot starts pull toward the group.

Data: Hot-start hitters (batting_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 webR or Pyodide; nothing you type leaves the page.

What you get

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

  • Every lesson80 lessons in 20 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 II.

The problem

Every sports question is a question under uncertainty, and a point estimate hides the part a decision-maker most needs to see.

Three decisions it teaches
  1. Prior, data, posterior: how to specify a model you can defend
  2. How to write it in Stan and read what comes back
  3. How to check a model before you believe it

The artifact. Bayesian models on sports data, specified, fit in Stan and checked, with the write-up that explains the uncertainty.

Ragents/viz/becoming-a-bayezian-i.R
0.0 2.5 5.0 7.5 10.0 0.2 0.4 0.6 true batting average density Ivanescu Penhallow prior One prior, two hitters' first 45 at-bats, two posteriors
Prior, data, posterior for two hitters: the same Beta prior, forty-five at-bats each, two different posteriors. Drawn at build from the data on this site by the code below.
The code that drew it
# Prior, data, posterior for two hitters: the same Beta prior, forty-five at-bats each, two different posteriors.
suppressPackageStartupMessages({library(dplyr); library(ggplot2); library(readr); library(tidyr); library(svglite)})
hitters <- read_csv("site/18-practice/hot-start-hitters/files/batting_2026.csv", show_col_types = FALSE) |> mutate(avg = hits / at_bats) |> arrange(desc(avg))
a0 <- 40 * .26; b0 <- 40 * .74           # a league prior: mean .260, worth about forty at-bats
pick <- hitters[c(1, nrow(hitters)), ]
grid <- tibble(x = seq(.05, .6, length.out = 300))
dens <- bind_rows(
  grid |> mutate(who = "prior", d = dbeta(x, a0, b0)),
  grid |> mutate(who = sub(".* ", "", pick$name[1]), d = dbeta(x, a0 + pick$hits[1], b0 + pick$at_bats[1] - pick$hits[1])),
  grid |> mutate(who = sub(".* ", "", pick$name[2]), d = dbeta(x, a0 + pick$hits[2], b0 + pick$at_bats[2] - pick$hits[2])))
p <- ggplot(dens, aes(x, d, color = who)) + geom_line(linewidth = 1.1) +
  scale_color_manual(values = c("#8FA3AA", "#C7BB42", "#5EC0D0"), name = NULL) +
  labs(x = "true batting average", y = "density", title = "One prior, two hitters' first 45 at-bats, two posteriors") +
  theme_minimal(base_size = 11) +
  theme(plot.background = element_rect(fill = "#010B0F", color = NA), panel.background = element_rect(fill = "#010B0F", color = NA),
        panel.grid = element_line(color = "#1B3A42"), text = element_text(color = "#F5F1E6"), axis.text = element_text(color = "#F5F1E6"),
        legend.text = element_text(color = "#F5F1E6"), plot.title = element_text(face = "bold", size = 12), legend.position = "top")
s <- svgstring(width = 7.2, height = 4.2, standalone = FALSE); print(p); invisible(dev.off()); cat(s())

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.

80 lessons in 20 sections, 11 quizzes. Every lesson is yours to keep.

Introducing Bayesian Analysis for Sports2 items
  1. Introduction Welcome to the course!
  2. Course Topics Gearing up to become a BayeZian!
Exploring Uncertainty & Variation4 items
  1. Uncertainty & Variation "That's why they play the game"
  2. Example, 100 Meter Olympic Sprint Introducing the Olympic sprint data
  3. Visualizing the Example Data Time to get coding!
  4. Quiz: Exploring Uncertainty & Variation Assessing our knowledge in uncertainty and variation quiz
Introducing Probability, Random Variables & Distributions16 items
  1. Probability, Random Variables & Distributions
  2. Random Variables Previewing distributions and values unknown
  3. Discrete Bernoulli & Binomial Distributions Heads or tails?
  4. Poisson Distribution A special case of the binomial
  5. Counts Approach Normal Distribution From counts to the normal distribution
  6. Continuous Distributions & the Uniform
  7. Continuous Uniform Distribution Understanding uniform distributions
  8. Beta Distribution There's no beta distribution
  9. Normal Distribution
  10. Summary Statistics Quantitatively describing our data
  11. Joint Distributions A row and column representation
  12. Marginal Distributions Breaking down row and column probability outcomes
  13. Conditional Distributions Probability given another event
  14. Independence between Variables Explaining the conditional and marginal relationship
  15. Getting to Bayes Rule Updating our beliefs
  16. Quiz: Probability, Random Variables, and Distributions Assessing our knowledge in probability, random variables, and distributions quiz
Priors, Likelihoods, and Posteriors5 items
  1. Priors, Likelihoods, and Posteriors Building blocks of Bayesian analysis
  2. Likelihoods Defining likelihood functions
  3. Normalizing Constant Ensuring our probabilities sum to one
  4. Conjugate Priors Perfect pairs
  5. Quiz: Priors, Likelihoods, and Posteriors Assessing our Bayesian knowledge quiz
Simulating Distributions in R4 items
  1. Simulating Distributions in R Intro Getting started with R simulations
  2. Transforming Random Numbers to Distributions From random to real
  3. Discrete Distributions Simulating countable or finite outcomes
  4. Quiz: Simulating Distributions Assessing our knowledge about simulating distributions in R quiz
Random Variable Code Objects1 item
  1. Representing Distributions with a Random Variable Code Object Introducing random variable data types
Simulations and Models in Stan5 items
  1. Simulations and Models in Stan Intro Working through the Stan basics
  2. Stan Documentation The Stan know-how
  3. Toy Stan Example, Simulating Values First steps with Stan
  4. Second Example, Beta Binomial Stan's beta binomial
  5. Quiz: Simulations and Models in Stan Assessing our knowledge in Stan modeling quiz
Posterior Simulation, Example with Grid Approximation1 item
  1. Grid Approximation Example Grid magic
Approximate Posteriors with MH and HMC2 items
  1. Approximate posteriors with MH and HMC Intro MH & HMC: approximations galore
  2. Hamiltonian Monte Carlo Monte Carlo in action
A Language for Describing Models1 item
  1. A Language for Describing Models Intro Stan speak
Simple Normal Regression6 items
  1. Simple Normal Regression Intro The basics of regression
  2. Coding a Normal Regression Model Our first look at this foundation model type
  3. Compiling & Fitting the Model Applying our modeling magic
  4. Checking HMC Diagnostics Ensuring healthy and robust models
  5. Reviewing the Model Parameters A peek behind the parameters
  6. Quiz: Simple Normal Regression Assessing our simple normal regression knowledge quiz
cmdstanr Model Object, Helper Functions, Model Evaluation6 items
  1. cmdstanr Model Object, Helper Functions, Model Evaluation Intro Introducing the basics of cmdstanr
  2. Posterior Predictive Checks, Three (3) Approaches Introducing the triple play
  3. First and a Half Approach Innovative posterior checks
  4. Third Approach Advanced checking
  5. Model Comparison, ELPD, and LOOCV Bayesian model matchups
  6. Quiz: Cmdstanr Model Objects Assessing our cmdstanr knowledge quiz
Extending Normal Regression4 items
  1. Extending Normal Regression Intro Beyond the basics of normal regression
  2. Categorical Predictors Enhancing models with categorical predictors
  3. Multiple Predictors Factoring in multiple model inputs
  4. Quiz: Extending Normal Regression Assessing our normal regression knowledge quiz
Generalized Linear Models, A Conceptual Introduction4 items
  1. Generalized Linear Models Intro GLMs 101
  2. Logit Link Function Learning the logit logic
  3. Log Link Function Having log link fun
  4. Quiz: Generalized Linear Models Assessing our knowledge of generalized linear models quiz
GLMs, Modeling Integer or Count Outcomes10 items
  1. GLMs GLMs unleashed
  2. Binomially-Distributed Count Outcomes Introducing binomial count models
  3. Example Model 1 in Basketball Our first basketball binomial model
  4. Example Model 2 in Basketball Our second basketball binomial model
  5. Example Model 3 in Basketball Our second basketball binomial model
  6. Poisson-Distributed Count Outcomes Our first Poisson count model
  7. Example Two Using Soccer Data Our second Poisson count model
  8. Example Three Using Soccer Data Our third Poisson count model
  9. Example Four Using Soccer Data Our fourth Poisson count model
  10. Quiz: Generalized Linear Models (Part 2) Assessing our knowledge of generalized linear models (part 2) quiz
More GLMs, Modeling Categorical Outcomes4 items
  1. More GLMs: Modeling Categorical Outcomes GLMs for categories
  2. First Categorical Model Our first look at categorical models
  3. Second Categorical Model Our second look at categorical models
  4. Third Categorical Model Our third look at categorical models
Hierarchical Models, an Introduction4 items
  1. Hierarchical Models Intro The basics of hierarchical models
  2. Parameters Sharing Information Shared info
  3. Diagnostics and Reparameterization Checking and tuning our models
  4. Quiz: Hierarchical Models Assessing our knowledge in hierarchical models quiz
Workflow Recap1 item
  1. Workflow Recap Recapping our Bayesian workflow
Case Study: Soccer and Expected Goals10 items
  1. Case Study Intro Soccer stats kickoff
  2. Visually Exploring the Pitch Data Pitch perfect data
  3. Modeling Goals as Bernoulli Goal modeling
  4. Expanding the Model Model expansion
  5. Adding Angle Between the Goal Posts Angles matter
  6. Adding Predictor for Body Part Body language
  7. Modeling Correlation Between Predictors Predictor synergy
  8. Adding Hierarchical Information to the Model Hierarchical insights
  9. Reparameterizing the Model Efficient models
  10. Using the Model Estimates for Decision Making From estimates to action
Next Steps1 item
  1. Next Steps Course reflection and what’s next?
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?

Analysts and data scientists who can write R and want to actually build Bayesian models in Stan, hands-on. 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?

20 sections · 80 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

Build real Bayesian models in Stan from the ground up, the skill that separates analysts who can quantify uncertainty from those who only ever point-estimate.

This course $499 one payment, lifetime access

20 sections · 80 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