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 specified 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. Survival Analysis |
What are survival models and how do they handle censored time-to-event
data? How can Bayesian survival models be implemented and interpreted using Stan? ::: |
| Duration: 05h 46m | 8. Stan extensions | Which packages take advantage of Stan and how to use them? |
| Duration: 05h 58m | 9. Exercises | How can I get routine in probabilistic programming? |
| Duration: 06h 10m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
Welcome to this introductory course on probabilistic programming and Bayesian data analysis. The course takes an application-oriented approach, introducing the theoretical background only where needed. Links to textbooks and other resources are provided for learners who wish to explore the topics in greater depth.
The central aim of these lessons is to introduce Stan, a probabilistic programming language for specifying and fitting a wide range of statistical models. Stan can be used through interfaces for Python, Julia, R, and several other languages. Here, we focus on its integration with R through the CmdStanR package.
Instructions for installing CmdStanR and Stan are available here.
The lessons require relatively little prior knowledge. However, familiarity with basic concepts in probability and statistics (summary statistics, probability densities etc.). Learners should also have a solid working knowledge of R, including data wrangling 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 Bayesian Data Analysis course were also consulted.
The lessons also require some additional R packages. Run the following code to install and load the packages and set the graphical theme.
R
package_list <- c("tidyverse", "cowplot", "grafify", "cmdstanr",
"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.