Summary and Schedule
This is a new lesson built with The Carpentries Workbench.
Setup Instructions | Download files required for the lesson | |
Duration: 00h 00m | 1. Short introduction to Bayesian statistics | How are statistical models formulated and fitted within the Bayesian framework? |
Duration: 01h 08m | 2. Stan | How can posterior samples be generated using Stan? |
Duration: 02h 12m | 3. Markov chain Monte Carlo | How does Stan generate the posterior samples? |
Duration: 03h 15m | 4. Hierarchical models | How does Bayesian modeling accommodate group structure? |
Duration: 03h 29m | 5. Model comparison | How can competing models be compared? |
Duration: 04h 31m | 6. Gaussian processes | How to do probabilistic non-parameteric regression? |
Duration: 05h 34m | 7. Stan extensions | Which packages take advantage of Stan and how to use them? |
Duration: 05h 46m | 8. Exercises | How can I get routine in probabilistic programming? |
Duration: 05h 58m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
Welcome to an introductory course on probabilistic programming! The aim of this course is to learn the basics of the topic with an application-oriented approach. Theoretical details are provided to a minimal extent. However, links to textbooks are provided and it’s recommended that the student follow these texts along with the lesson material.
In order to make most of this lesson, the student should have a good grasp of basic concepts in probability and statistics (distribution, probability density, Bayes’ rule, basic summary statistics) programming with R, including data manipulation and visualization.
The primary sources in preparing the material were A. Gelman et al., “Bayesian Data Analysis” (3rd ed.), and R. McElreath’s “Statistical Rethinking” (2nd edition). The Stan User’s Guide and the website of Aki Vehtari’s course Bayesian Data Analysis were also utilized.
The lesson makes use of two programming languages: R and Stan. While Stan is compatible with Python, Julia, and several other interfaces, our focus here will be on its integration with R. Make sure you are using the latest version of R. It’s also recommended to use RStudio, an integrated development environment, that makes using R easier.
Instructions for installing Stan can be found here.
For the lessons, you’ll need to have some R packages installed and loaded. Run the following code to load the libraries and to set the graphical theme.
R
package_list <- c("magrittr", "tidyverse", "cowplot", "grafify", "rstan",
"mvtnorm", "loo", "bayesplot", "brms")
for (p in package_list){
if(!p %in% installed.packages()){
install.packages(p)
}
require(p, character.only = TRUE)
}
theme_set(theme_bw(15))
prior_color <- "#009E73"
likelihood_color <- "#E69F00"
posterior_color <- "#56B4E9"
Data sets
The data sets used in the lesson can be accessed here
where you can find them packaged in lesson-data.zip
.