Contributing Stan code translations of McElreath's Statistical Rethinking examples

McElreath’s Statistical Rethinking provides a function to see the Stan code behind his convenience functions (rethinking::stancode()), but he doesn’t focus on how to work directly with stanfit objects.

As an exercise, I have translated the examples from his book directly into Stan code, and extracted the information from stanfit objects using R and tidyverse/ggplot2 to recreate McElreath’s graphics too.

The code is organized in R Markdown files by chapter. I’d be happy to contribute.

10 Likes

I would love to link to this from my book homepage. Lots of added value.

2 Likes

Cool. I’ve made the Github repo public:

https://github.com/ssp3nc3r/rethinking

9 Likes

Neat—thanks for sharing!

1 Like

ssp3nc3r–I have found the your stan code for Statistical Rethinking extremely valuable. However there is a new version out. Do you know of any place were stan code for the new edition can be found?

Thanks!

3 Likes

It’s on my todo list. I’ve started a repo for his second edition:

4 Likes