Hey everyone! Please pardon the self-promotion. :) I’m excited to announce my new online course for learning direct Stan coding for Bayesian analysis. Available starting this Friday; you can enroll here: https://athlyticz.com/stan-i.
— TL;DR —
- Actual Stan coding, not a high-level interface
- At-your-own-pace Videos: watch me live coding, explaining as I type
- Hosted RStudio session to practice running code alongside me
- Starts with fundamentals, builds to hierarchical models
- Emphasizes a Bayesian workflow
- Modeling applied to sports data
My goal is to make learning Stan as easy as possible.
Details below:
If you — or someone you know — may be keen on mastering Stan and Bayesian analysis at your own pace and modeling sports data, that’s this course.
Here’s what sets my course apart:
It gives you 80 videos to learn by watching me live code for you and walk you through every line of code in R
and Stan
. Along with using cmdstanr
as the interface between these languages, I leverage modern R
/tidyverse
tools for data exploration, posterior review, and more. And you can binge-watch or revisit all lessons as needed.
Starting with fundamental concepts (e.g., probability, distributions, simulation), I gradually introduce you to basic regressions, correlations, and hierarchical modeling. Throughout, I emphasize a Bayesian workflow, culminating in a comprehensive case study.
Unlike courses and textbooks using high-level wrappers (rstanarm
, brms
, ulam
), I guide you to code directly in Stan, supported by handy functions from posterior
, tidybayes
, and ggdist
for easy and efficient posterior handling and visualization. I’ll show you that rvar
objects and functions like spread_draws
make Stan friendlier; no need to “go Houdini”!
To create a smooth learning experience, my course videos are paired with a web-based RStudio session so you can practice with me. This setup lets you run and modify all the code with me interactively, seeing firsthand how your changes impact outcomes. No worrying about setup issues.
In essence, I’ve crafted the course I wish I had when starting out. Feel free to ask any questions about the course here or via DM. I’m currently working on a follow-up, intermediate course. Looking forward to sharing this journey with you! :)
Here’s a general list of topics in the course:
1 Introducing Bayesian analysis for sports
1.1 Introduction
1.2 Course topics
2 Exploring uncertainty and variation
2.1 Example — 100 meter Olympic sprint
2.2 Visualizing the example data
3 Introducing probability, random variables, and distributions
3.1 Concepts in probability
3.2 Random variables
3.3 Discrete distributions
3.4 Bernoulli
3.5 Bernoulli as a special case of Binomial
3.6 Binomial with specific conditions is a Poisson
3.7 Binomial with specific conditions is a Normal
3.8 Continuous distributions
3.9 Continuous uniform distribution
3.10 Beta distribution
3.11 Normal distribution
3.12 Summary statistics
3.13 Two joint distributions
3.14 Marginal distributions
3.15 Conditional distributions
3.16 Independence between variables
3.17 Getting to Bayes rule
4 Priors, likelihoods, and posteriors: Bayes Rule
4.1 Priors
4.2 Likelihoods
4.3 Normalizing constant
4.4 Conjugate priors: e.g., Beta-Binomial
5 Simulating distributions in R
5.1 Randomization
5.2 Transforming random numbers to simulate distributions
6 Representing distributions with the random variable code object
7 Simulation and models in Stan
7.1 Introduction to Stan
7.2 Stan documentation
7.3 Toy Stan example: simulating values
7.4 Compiling, fitting, and reviewing the model in R
7.5 Second example: Beta-Binomial
8 Posterior simulation: example with grid approximation
9 Approximate posteriors with MH and HMC
9.1 Random walk Metropolis Hastings
9.2 Hamiltonian Monte Carlo
10 A language for describing models
11 Simple normal regression
11.1 Overview
11.2 Priors with predictive checks
11.3 Coding a normal regression model
11.4 Compiling and fitting the model
11.5 Checking HMC diagnostics
11.6 Reviewing the model parameters
12 cmdstanr model object, helper functions, model evaluation
12.1 From sampling to Stan model object
12.2 Posterior predictive checks: three approaches
12.3 Model comparison: ELPD and loo-cv
13 Extending normal regression
13.1 Not just linear models!
13.2 Categorical predictors
14 Generalized linear models: conceptual introduction
14.1 Logit link function
14.2 Log link function
15 GLMs: Modeling integer or count outcomes
15.1 Binomially-distributed count outcomes
15.2 Poisson distributed count outcomes
16 More GLMs: Modeling categorical outcomes
17 Hierarchical models, an Introduction
17.1 Parameters sharing information
17.2 Model example
17.3 Diagnostics and reparameterization
18 Workflow recap
19 Case study
19.1 Setup
19.2 The problem
19.3 The data
19.4 Visually exploring the pitch data
19.5 Modeling goals as Bernoulli
19.6 Expanding the model
19.7 Hierarchical modeling
19.8 Using the model: estimates for decisionmaking
20 Next steps: for the case study, and your journey