My (jupyter) notebooks covering Professor Richard McElreath's (https://xcelab.net/rm/statistical-rethinking/ and https://github.com/rmcelreath/rethinking) Statistical Rethinking 2 book and practice problems (2nd edition draft version up to 26th Sept 2019), and the homeworks from his winter 2019 lecture course.
Most of the notebooks are in R; these can be found in the Rcode/ directory. There are also a few notebooks in Python3 (see pythonCode/ directory), where I experiment with using PyMC3. The notebooks in Python cover Chapters 4 and 6, and Homeworks 1, 2, 3, 4 and 5. I use R (and Stan) to cover the rest of the book and homeworks.
The Homework notebooks refer to the homeworks set in Prof McElreath's lecture course available on YouTube (https://www.youtube.com/watch?v=4WVelCswXo4&list=PLDcUM9US4XdNM4Edgs7weiyIguLSToZRI). The homeworks and Prof McElreath's solutions can be found on GitHub (https://github.com/rmcelreath/statrethinking_winter2019).
The Chapter notebooks refer to the draft (up to the 26th September 2019) of the 2nd edition of Prof McElreath's Statistical Rethinking book. I begin each Chapter notebook working through the code copied from the book (occasionally fixing any bugs found in the book). Afterwards, I present my solutions to the book's Practice problems at the end of each chapter. Sometimes I have searched for answers or opinions to the problems online, often using the github repositories https://github.com/jffist/statistical-rethinking-solutions, https://github.com/cavaunpeu/statistical-rethinking and the website https://jmgirard.com/statistical-rethinking-ch2/ as resources. I have tried to cite the sources where I have used them, although I apologise in advance if I have forgotten to reference anything within the notebooks - these notebooks were my personal attempt at working through the book, and I post them publicly here in the hope that others may find them useful.
Note that there are some incorrect numberings of the Practice problems within the draft versions of the 2nd Edition book after Chapter 6; this is because Chapter 6 is new to the 2nd edition of the book and the numbering of the Practice problems have not been updated properly. So for example, Chapter 7 have problems labelled 6E1, 6E2, 6M1, etc. and so forth in the following chapters. In order to avoid confusion with the draft version of the book, I have maintained the same inconsistent numbering system as in the draft version of the book: so in my Chapter 7 notebook, I also label the problems 6E1, 6E2, 6M1 etc. Given that each notebook refers to an individual chapter (except for Chapters 1 to 4, where I have combined them into one notebook), hopefully this won't cause any confusion.
The code runs on my laptop, which has the 12GB RAM and 4 Intel i7-4600U cores. Occasionally the Kernel crashed when running some of the code in the Chapter 16 notebook, so I resorted to Rstudio to run some of the code, which seems more stable.
I also include a spreadsheet ('ConcentrationOfMeasureDemo.xlsx') that graphically demonstrates the concentration of measure phenomenon mentioned in the Statistical Rethinking2 book in section 9.2.2 'High-dimensional sadness'.