Hey everyone! I’m excited to announce my new online course for learning direct Stan coding for Bayesian analysis. Available now; enroll here: https://athlyticz.com/stan-i.

TL;DR

  • Actual Stan coding, not a high-level interface
  • At-your-own-pace videos: shows live coding while explaining
  • Hosted RStudio session to practice 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 and fast 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. This setup lets you run and modify all the code with me interactively, seeing firsthand how your changes impact outcomes — without worrying about setup issues.

In essence, I’ve crafted the course I wish I had when starting out. 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. Introduction
    2. Course topics
  2. Exploring uncertainty and variation
    1. Example — 100 meter Olympic sprint
    2. Visualizing the example data
  3. Introducing probability, random variables, and distributions
    1. Concepts in probability
    2. Random variables
    3. Discrete distributions
    4. Bernoulli
    5. Bernoulli as a special case of Binomial
    6. Binomial with specific conditions is a Poisson
    7. Binomial with specific conditions is a Normal
    8. Continuous distributions
    9. Continuous uniform distribution
    10. Beta distribution
    11. Normal distribution
    12. Summary statistics
    13. Two joint distributions
    14. Marginal distributions
    15. Conditional distributions
    16. Independence between variables
    17. Getting to Bayes rule
  4. Priors, likelihoods, and posteriors: Bayes Rule
    1. Priors
    2. Likelihoods
    3. Normalizing constant
    4. Conjugate priors: e.g., Beta-Binomial
  5. Simulating distributions in R
    1. Randomization
    2. Transforming random numbers to simulate distributions
  6. Representing distributions with the random variable code object
  7. Simulation and models in Stan
    1. Introduction to Stan
    2. Stan documentation
    3. Toy Stan example: simulating values
    4. Compiling, fitting, and reviewing the model in R
    5. Second example: Beta-Binomial
  8. Posterior simulation: example with grid approximation
  9. Approximate posteriors with MH and HMC
    1. Random walk Metropolis Hastings
    2. Hamiltonian Monte Carlo
  10. A language for describing models
  11. Simple normal regression
    1. Overview
    2. Priors with predictive checks
    3. Coding a normal regression model
    4. Compiling and fitting the model
    5. Checking HMC diagnostics
    6. Reviewing the model parameters
  12. cmdstanr model object, helper functions, model evaluation
    1. From sampling to Stan model object
    2. Posterior predictive checks: three approaches
    3. Model comparison: ELPD and loo-cv
  13. Extending normal regression
    1. Not just linear models!
    2. Categorical predictors
  14. Generalized linear models: conceptual introduction
    1. Logit link function
    2. Log link function
  15. GLMs: Modeling integer or count outcomes
    1. Binomially-distributed count outcomes
    2. Poisson distributed count outcomes
  16. More GLMs: Modeling categorical outcomes
  17. Hierarchical models, an Introduction
    1. Parameters sharing information
    2. Model example
    3. Diagnostics and reparameterization
  18. Workflow recap
  19. Case study
    1. Setup
    2. The problem
    3. The data
    4. Visually exploring the pitch data
    5. Modeling goals as bernoulli
    6. Expanding the model
    7. Hierarchical modeling
    8. Using the model: estimates for decisionmaking
  20. Next steps: for the case study, and your journey