Back to Homepage

Credit: Lee Seonghak

Homework 3: Probability with Bayesian Inference

Benji Xie & Greg Nelson

The objective of this homework is to practice the mechanics of Bayesian analysis. You will use R and the statistical Rethinking package for your analysis. By the end of this homework, you should feel comfortable setting up, running, sampling for, and interpretting basic Bayesian inference to build models and find posterior probabilities.

1. Clone the starter repository from GitHub classroom

  1. Access the starter code via GitHub classroom: Link to HW3 on GitHub Classroom.
For this assignment, you will be filling out homework/hw3/hw3.Rmd and filling in each "TODO" in the R markdown file.

2. Bayesian inference in R

You will now do some basic Bayesian inference in R. Everything you need to know should be covered in Week 2 of class (see links to resources below). Complete the remaining "TODO" tasks in the R markdown file. Be sure to provide the code you wrote to get your solutions!

Helpful Resources:

  1. Reading 2.1: Probability Models (especially Ch. 2)
  2. Reading 2.3: Infering probability distributions from data
  3. Code from Lab 2.2 (in R)
  4. Worked example of updating a posterior in R

When you have completed this assignment, don't forget to push the changes to get credit!