Welcome to the Statistical Rethinking with PyMC interactive textbook companion! This resource brings Richard McElreath's exceptional Statistical Rethinking course to Python developers.
Statistical Rethinking is an incredible resource for learning Bayesian Statistics, written by Richard McElreath, Full Professor of Anthropology at the Max Planck Institute for Evolutionary Anthropology.
The original textbook uses R and Stan for its code examples. The core PyMC development team created Python ports of these examples, and we've taken it one step further:
✨ Each notebook includes comprehensive summaries of the textbook material alongside the Python code, eliminating the need to constantly switch between the book and notebooks.
This approach makes Statistical Rethinking accessible to anyone proficient in Python, reducing friction and making your learning journey as seamless as possible.
- Bayesian Thinking: Build intuition for probabilistic reasoning
- PyMC Modeling: Hands-on experience with modern Bayesian tools
- Causal Inference: Understand DAGs and causal relationships
- Practical Skills: Apply these techniques to real-world data
Navigate through chapters using the sidebar. Each chapter includes:
- 📖 Detailed explanations of statistical concepts
- 💻 Python/PyMC code implementations
- 📊 Visualizations and examples
- 🎓 Exercises to test your understanding
Every notebook can be opened in Google Colab! Just click the Colab button at the top of any chapter to:
- Run code interactively
- Modify examples
- Experiment with your own data
Clone the repository to work offline:
git clone https://github.com/vanislekahuna/Statistical-Rethinking-PyMC.git
cd Statistical-Rethinking-PyMCTo get the most from this material:
- Python: Basic understanding of Python syntax
- NumPy/Pandas: Familiarity with these libraries is helpful
- Statistics: Some exposure helpful, but Bayesian knowledge not required!
- Curiosity: A genuine interest in understanding data through a Bayesian lens
The book follows Richard McElreath's textbook structure:
Part I: Foundations
- Chapters 1-3: Bayesian basics and sampling
- Chapter 4: Linear models
Part II: Linear Models
- Chapters 5-8: Multiple regression, causality, interactions
Part III: Generalized Linear Models
- Chapters 9-11: MCMC, maximum entropy, count data
Part IV: Advanced Topics
- Chapters 12-17: Multilevel models, measurement error, missing data
Ready to begin your Bayesian journey? Head to Chapter 1: The Golem of Prague to start learning!
This work builds upon:
- Richard McElreath: For the incredible original textbook and course
- PyMC Team: For porting the R/Stan code to Python
- Community Contributors: Everyone who has helped improve these materials
McElreath, R. (2020). Statistical Rethinking: A Bayesian Course with Examples in R and Stan (2nd ed.). CRC Press.
- Statistical Rethinking Book
- Richard McElreath's Video Lectures
- PyMC Documentation
- PyMC Resources Repository
Questions or feedback? Open an issue on our GitHub repository