Status: Codes in this repository have not been updated to the latest Pyro versions. Please check out https://github.com/fehiepsi/rethinking-numpyro repository for the updated codes of 2nd edition in NumPyro.
Statistical Rethinking is an excellent book for applied Bayesian data analysis. The accompanying codes for the book are written in R and Stan. They are then ported to Python language using PyMC3. Recently, Pyro emerges as a scalable and flexible Bayesian modeling tool (see its tutorial page), so to attract statisticians to this new library, I decided to make a Pyronic version for the codes in this repository. Inspired by the PyMC3onic version, I keep the codes in this repository as close as possible to the original codes in the book.
To say a bit more about Pyro, it is a universal probabilistic programming language which is built on top of PyTorch, a very popular platform for deep learning. If you are familiar with numpy, the transition from numpy.array
to torch.tensor
is rather straightforward (as demonstrated in this tutorial).
-
Read on the site: https://fehiepsi.github.io/rethinking-pyro/
-
Use GitHub's renderer: https://github.com/fehiepsi/rethinking-pyro/tree/master/notebooks/
-
Use Jupyter's nbviewer: https://nbviewer.jupyter.org/github/fehiepsi/rethinking-pyro/tree/master/notebooks/
pip install jupyter pandas pyro-ppl seaborn torch