Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tmastny/Statistical-Rethinking-Notes


https://github.com/tmastny/Statistical-Rethinking-Notes

Last synced: 20 days ago
JSON representation

Awesome Lists containing this project

README

        

code{white-space: pre;}

pre:not([class]) {
background-color: white;
}

if (window.hljs && document.readyState && document.readyState === "complete") {
window.setTimeout(function() {
hljs.initHighlighting();
}, 0);
}

h1 {
font-size: 34px;
}
h1.title {
font-size: 38px;
}
h2 {
font-size: 30px;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 16px;
}
h6 {
font-size: 12px;
}
.table th:not([align]) {
text-align: left;
}

.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
code {
color: inherit;
background-color: rgba(0, 0, 0, 0.04);
}
img {
max-width:100%;
height: auto;
}
.tabbed-pane {
padding-top: 12px;
}
button.code-folding-btn:focus {
outline: none;
}

$(document).ready(function () {
window.buildTabsets("TOC");
});


Statistical-Rethinking-Notes


This is my collection of notes on Statistical Rethinking: A Bayesian Course with Examples in R and Stan. These are offered without assurances, besides the guarantee of mistakes and typos.



How to use


There is a folder for each chapter and in each folder there are files for notes and exercises. There are two types of files, .Rmd and .md. To see the results in formatted html open the .md files on github. Some code or warnings may be suppressed. For the complete code, see the .Rmd files.




Other sets of notes


Self-study is difficult without feedback. I used the following sets of notes to check my understanding of the material.


https://github.com/cavaunpeu/statistical-rethinking


https://github.com/rlabbe/statistical-rethinking


http://scs.math.yorku.ca/index.php/SCS_Reads_2016-2017




Why my notes are different


The book follows a traditional r-base style along with some added utility and Stan functions from the rethinking package. The other notes mostly conform to this style. This is an effective way to introduce R and Stan since it is a low barrier to entry.


One downside to this approach is that other useful packages and powerful tools are ignored. As my notes progress I adopt more packages, while trying to verify that I get the same results using the expected methods. I thought this was a good way to build confidence and experience with the new tools.


Here are some of the packages that I incorporate:




  1. tidyverse: This is a collection of packages that attempt to make a consistent data science workflow. In particular, I explore



    1. ggplot2 for visualization.


    2. dplyr for tidying data frames.


    3. modelr for data_grid to easily generate new data for models.




  2. tidybayes to extend the tidy philosophy to Bayesian tools.


  3. brms as an alternative interface to Stan. This package allows you to construst full Bayesian models in Stan using the standard formula syntax, while offering some additional functionality to rethinking::map2stan. The package comes with a suite of helper functions that automate many of the common processes in the book, such as building the link function and calculating percentiles. For a comparsion to the rethinking package, check out the brms overview.





Contact and Discussion


If you have any questions or suggestions you can reach me anytime at [email protected], or you can leave an issue on this repo.


For more general Rethinking questions Lotty Brand recently started a Rethinking chat room on slack. The author Richard McElreath has also joined the forum.



// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
});

(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();