Code Monkey home page Code Monkey logo

rer98 / statistical_rethinking2 Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 2.0 177.48 MB

Notebooks (mostly R but some PyMC3) covering Prof Richard McElreath's Statistical Rethinking 2 book (draft version up to 26th Sept 2019) and Homeworks from his winter 2019 lecture course

R 0.01% Stan 0.02% Jupyter Notebook 99.84% HTML 0.13% CSS 0.01%
bayesian-inference bayesian-statistics causal-inference markov-chain-monte-carlo bayesian-data-analysis statistics statistical-rethinking r stan pymc3 data-science

statistical_rethinking2's Introduction

statistical_rethinking2

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'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.