Beyond the Cookbook _ Teaching Bayesian Data Analysis with Statistical Rethinking

包含视频讲解

When teaching modern data analysis, the biggest hurdle isn’t the mathematics or the syntax—it is unlearning the “cookbook” approach. For decades, standard statistical education has treated data analysis like a menu: if your data looks like this, run a t-test; if it looks like that, run an ANOVA.

When I set out to teach Richard McElreath’s Statistical Rethinking (2020, Second Edition), the goal was to completely subvert that paradigm.

Richard McElreath, 2020, Statistical Rethinking: A Bayesian Course with Examples in R and Stan

McElreath’s text is exceptional because it treats statistical models not as black boxes, but as engineering artifacts or, as he famously calls them, golems. They are powerful, literal-minded machines that do exactly what we program them to do, which means we must understand their internal mechanics and assumptions intimately.

Why This Curriculum Matters

Teaching this material requires shifting focus from p-values and significance testing to generative workflows and causal inference. In this course iteration, we focused heavily on three foundational pillars:

  • Generative Model Design: Before touching real-world data, we simulate it. If you cannot write a simulation that generates data matching your theoretical assumptions, you do not truly understand your model.
  • Causal Graphs (DAGs): The second edition introduces Directed Acyclic Graphs early on. This is a game-changer for students. It forces an explicit realization that data alone cannot tell you the causal structure; you must inject domain knowledge to correctly handle confounds, colliders, and pipes.
  • The MCMC Engine: Rather than hiding behind optimization shortcuts, we pull back the curtain on Markov Chain Monte Carlo (MCMC) estimation. Understanding why a chain fails to converge tells us something profound about the geometry of our target distribution and the flaws in our model’s parameterization.

Key Takeaways from the Classroom

  • Priors are not a liability; they are an asset. Students initially view selecting priors as subjective guesswork. Once they see how regularizing priors prevent overfitting and handle small sample sizes, the skepticism vanishes.

  • The value of model failure. The most instructive moments in class happen when the Stan engine struggles. A divergent transition is not a software error to be avoided; it is a diagnostic flag revealing that your model is asking a question the data cannot answer.

Teaching this course reinforces a fundamental truth: robust statistical modeling requires equal parts mathematical rigor, software proficiency, and causal humility.

Richard McElreath 2020年发表的贝叶斯统计学书 Statistical Rethinking 第二版 PDF 的视频讲解,使用Julia (而不是书中的R和Stan)来做里面的题目, use (Turing.jl MCMC package).

Videos on YouTube (upload ongoing):

视频列表/Videos on bilibili:

References