Ecosyste.ms: Awesome

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

https://github.com/avehtari/BDA_R_demos

Bayesian Data Analysis demos for R
https://github.com/avehtari/BDA_R_demos

bayesian bayesian-data-analysis bayesian-inference mcmc monte-carlo r stan

Last synced: 4 months ago
JSON representation

Bayesian Data Analysis demos for R

Lists

README

        

# Bayesian Data Analysis R Demos

The [BDA_R_demos repository](https://github.com/avehtari/BDA_R_demos) contains some R demos and additional notes for the book [Bayesian Data
Analysis, 3rd ed by Gelman, Carlin, Stern, Dunson, Vehtari, and Rubin (BDA3)](http://www.stat.columbia.edu/~gelman/book/). See also [Bayesian Data Analysis course material](https://github.com/avehtari/BDA_course_Aalto).

Currently there are demos for BDA3 Chapters 2, 3, 4, 5, 6, 10, 11 and 12.
Furthermore there are demos for
[CmdStanR](https://github.com/stan-dev/cmdstanr),
[RStan](https://github.com/stan-dev/rstan)
[RStanARM](https://github.com/stan-dev/rstanarm).

The initial demos were originally written for Matlab by [Aki
Vehtari](http://users.aalto.fi/~ave/) and translated to R by [Markus
Paasiniemi](https://github.com/paasim). Recently more demos have been
added for [CmdStanR, RStan and RStanARM](demos_rstan).
Unless otherwise specified in specific files all code licensed
under BSD-3 and all text, slides and figures licensed under CC-BY-NC 4.0.

The corresponding [Python demos](https://github.com/avehtari/BDA_py_demos)
and the corresponding [Matlab/Octave demos](https://github.com/avehtari/BDA_m_demos).

See also [Model Selection tutorial](https://avehtari.github.io/modelselection/).

List of demos (not including [rstan and rstanarm demos](demos_rstan))
- [Chapter 2](demos_ch2)
- [demo2_1: Probability of a girl birth given placenta previa (BDA3 p. 37)](https://avehtari.github.io/BDA_R_demos/demos_ch2/demo2_1.html)
- [demo2_2: Illustrate the effect of prior in binomial model](https://avehtari.github.io/BDA_R_demos/demos_ch2/demo2_2.html)
- [demo2_3: Illustrate simulation based inference](https://avehtari.github.io/BDA_R_demos/demos_ch2/demo2_3.html)
- [demo2_4: Illustrate grid and inverse-cdf sampling](https://avehtari.github.io/BDA_R_demos/demos_ch2/demo2_4.html)
- [Chapter 3](https://avehtari.github.io/BDA_R_demos/demos_ch3)
- [demo3_1_4: Normal model with unknown mean and variance (BDA3 section 3.2 on p. 64)](https://avehtari.github.io/BDA_R_demos/demos_ch3/demo3_1_4.html)
- [demo3_5: Estimating the speed of light using normal model BDA3 p. 66](https://avehtari.github.io/BDA_R_demos/demos_ch3/demo3_5.html)
- [demo3_6: Binomial regression and grid sampling with bioassay data (BDA3 p. 74-)](https://avehtari.github.io/BDA_R_demos/demos_ch3/demo3_6.html)
- [Chapter 4](https://avehtari.github.io/BDA_R_demos/demos_ch4)
- [demo4_1: Normal approximation for binomial regression model and Bioassay data](https://avehtari.github.io/BDA_R_demos/demos_ch4/demo4_1.html)
- [Chapter 5](https://avehtari.github.io/BDA_R_demos/demos_ch5)
- [demo5_1: Hierarchical model for Rats experiment (BDA3, p. 102)](https://avehtari.github.io/BDA_R_demos/demos_ch5/demo5_1.html)
- [demo5_2: Hierarchical model for SAT-example data (BDA3, p. 102)](https://avehtari.github.io/BDA_R_demos/demos_ch5/demo5_2.html)
- [Chapter 6](https://avehtari.github.io/BDA_R_demos/demos_ch6)
- [demo6_1: Posterior predictive checking of normal model for light data](https://avehtari.github.io/BDA_R_demos/demos_ch6/demo6_1.html)
- [demo6_2: Posterior predictive checking for independence in binomial trials](https://avehtari.github.io/BDA_R_demos/demos_ch6/demo6_2.html)
- [demo6_3: Posterior predictive checking of normal model with poor test statistic](https://avehtari.github.io/BDA_R_demos/demos_ch6/demo6_3.html)
- [demo6_4: Marginal posterior predictive checking with PIT test](https://avehtari.github.io/BDA_R_demos/demos_ch6/demo6_4.html)
- Chapter 7
- See [model selection tutorial](https://github.com/avehtari/modelselection_tutorial)
- [Chapter 10](https://avehtari.github.io/BDA_R_demos/demos_ch10)
- [demo10_1: Rejection sampling](https://avehtari.github.io/BDA_R_demos/demos_ch10/demo10_1.html)
- [demo10_2: Importance sampling](https://avehtari.github.io/BDA_R_demos/demos_ch10/demo10_2.html)
- [demo10_3: Importance sampling with normal distribution as a proposal for Bioassay model](https://avehtari.github.io/BDA_R_demos/demos_ch10/demo10_3.html)
- [Chapter 11](https://avehtari.github.io/BDA_R_demos/demos_ch11)
- [demo11_1: Gibbs sampling illustration](https://avehtari.github.io/BDA_R_demos/demos_ch11/demo11_1.html)
- [demo11_2: Metropolis sampling + convergence illustration](https://avehtari.github.io/BDA_R_demos/demos_ch11/demo11_2.html)
- [demo11_3_4: Metropolis sampling + convergence illustration](https://avehtari.github.io/BDA_R_demos/demos_ch11/demo11_3_4.html)
- [demo11_5: Diagnostics with posterior and bayesplot packages](https://avehtari.github.io/BDA_R_demos/demos_ch11/demo11_5.html)
- [Chapter 12](https://avehtari.github.io/BDA_R_demos/demos_ch12)
- [demo12_1: Static Hamiltonian Monte Carlo illustration](https://avehtari.github.io/BDA_R_demos/demos_ch12/demo12_1.html)
- [demo12_2: NUTS / Dynamic Hamiltonian Monte Carlo illustration](https://avehtari.github.io/BDA_R_demos/demos_ch12/demo12_2.html)
- [CmdStanR, RStan, RStanARM](https://avehtari.github.io/BDA_R_demos/demos_rstan)