Skip to content

Files

Latest commit

fd8df6d · Jun 4, 2024

History

History

Rethinking_2

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Nov 12, 2022
Jan 3, 2023
Jun 4, 2024
Jul 22, 2022
Jul 22, 2022
Jul 22, 2022
Jul 21, 2022
Sep 11, 2022
Sep 11, 2022
Sep 11, 2022
Sep 11, 2022
Jun 1, 2022
Nov 4, 2022
Nov 4, 2022
Nov 4, 2022
Nov 12, 2022
Mar 23, 2022
May 1, 2022
Jun 4, 2024
Mar 23, 2022
Nov 12, 2022

Statistical Rethinking (second edition) with Python and PyMC

Statistical Rethinking is an incredible introductory book to Bayesian Statistics. It follows a Jaynesian and practical approach with very good examples and clear explanations.

In this repository we port the book's original code in R and Stan to Python and PyMC. We attempt to reproduce the examples as faithfully as possible while expressing them in a Pythonic and PyMConic way.

Display notebooks

Binder

Contributing

All contributions are welcome!

Feel free to send PRs to fix errors, improve the code, or make comments that could help users of this repository and readers of the book. When submitting PRs, please make sure the notebooks are formatted according to the PyMC NB style guide.

You can also join the discussion on Gitter.

Installing the dependencies

To install the dependencies to run these notebooks, you can use Anaconda. Once you have installed Anaconda, run:

conda env create -f environment.yml

to install all the dependencies into an isolated environment.

Activate the environment by running:

source activate stat-rethink2-pymc

To use the notebooks you first have to register your new environment as a valid notebook kernel:

python -m ipykernel install --user --name stat-rethink2-pymc3 --display-name "Python 3.10 (stat-rethink2-pymc3)"

You can start a notebook by running:

jupyter notebook

or use the more modern jupyter lab:

jupyter lab

from the root directory.

PyMC v4 Updates

Work is on-going to update these notebooks to be compatible with PyMC v4. Currently chapters 2 through 14 have been converted.

If you wish to run these notebooks, please create the v4 environment by running:

conda env create -f environment_v4.yml

and activate it with:

source activate stat-rethink2-pymc_v4

Creative Commons License
Statistical Rethinking with Python and PyMC by All Contributors is licensed under a Creative Commons Attribution 4.0 International License.