This site shows the Julia versions of the Bayesian models described in Statistical Rethinking Edition 1 (McElreath, 2016) and 2 (McElreath, 2020). The models are listed at Models.
We have tried our best to let this site be without mistakes. However, if you find a mistake on this website, please let us know. The code for this website is available on GitHub.
This website is built with Julia 1.7.3 and
CSV 0.10.8
CategoricalArrays 0.10.7
DataFrames 1.4.4
DifferentialEquations 7.6.0
Distributions 0.25.79
Franklin 0.10.51
NodeJS 1.3.0
RData 1.0.0
StatsFuns 1.1.1
StatsPlots 0.15.4
Turing 0.23.1
The models are listed below. Each page aims to contain all the code required to reproduce the results. In other words, it should be possible to get the same output by just copying the code and the accompanying dataset. Furthermore, we try to stick to Julia styling conventions where possible. Therefore, we use unicode symbols in the models. For example, where the book lists alpha
, we will use α
because the Julia language allows that. As another example, we call DataFrame variables df
, which is also the convention in R and Python.
Before you look at the models below, you might want to look at the Basic Example.
globe.qa: Globe tossing
m4.1: Gaussian model of height
m8.1: Africa first candidate model
m12.1: Beta-binomial
m13.1: Varying intercepts Reedfrogs
m13.1: Varying slopes cafes
m13.2: Multinomial Poisson regression
m13.3: Varying intercepts admission decisions
m2.1: Globe tossing
m4.1: Gaussian model of height
m8.1: Africa
m8.2: Wild chain
m8.3: Weakly informative priors
m8.4: Non-identifiable model
m10.3: Chimpanzees
m10.4: Estimate handedness for each Chimpanzee
m10.10: Oceanic tool complexity
m10.10c: Centered Oceanic tool complexity
m10.yyt: Admit or reject
m10.good: Nonsense estimates for strong associations
m11.5: Beta-binomial
m11.7: Multinomial Poisson regression
m12.1: Varying intercepts Reedfrogs
m12.2: Multilevel Reedfrogs
m12.3: Partial-pooling estimates
m12.4: Varying intercepts Chimpanzees
m12.5: Multi-multilevel Chimpanzees
m12.6: Over-dispersed Oceanic
m13.4: Ignoring gender for admittance
m13.6: Multivariate Chimpanzees priors
m13.6nc: Non-centered Chimpanzees
m13.7: Spatial autocorrelation in Oceanic tools
m14.1: Varying slopes cafes
McElreath, R. (2016). Statistical Rethinking: A Bayesian Course with Examples in R and Stan. CRC press. https://doi.org/10.1201/9781315372495
McElreath, R. (2020). Statistical Rethinking: A Bayesian Course with Examples in R and Stan. CRC press. https://doi.org/10.1201/9780429029608