Problem Set 1

This problem set is due on January 31, 2022 at 11:59am.

Step 1: Download this file locally.

Step 2: Complete the assignment

Step 3: Knit the assignment as either an html or pdf file.

Step 4: Submit your file here through this canvas link.


  • Name:
  • UNCC ID:
  • Other student worked with (optional):

Question 1

  1. Your friend just became interested in Bayesian statistics. In one paragraph or less (no code), explain the following to them:
  • Why/when is Bayesian statistics useful?
  • What are the similarities in Bayesian and frequentist statistics?
Hint: If you need ideas, go to References/Readings in Bayesian Statistics and choose 1 paper. No need to read entire paper - focus on introduction or opening paragraphs to justify. Focus on ones with either or

Question 2

  1. Suppose the globe tossing data (Chapter 2) had turned out to be 4 water and 11 land. Construct the posterior distribution, using grid approximation. Use the same flat prior as in the book. Plot the posterior. Use 1000 grid approximations and set the set as set.seed(100).

Question 3

  1. Now suppose the data are 4 water and 2 land. Compute the posterior again, but this time use a prior that is zero below p = 0.5 and a constant above p = 0.5. This corresponds to prior information that a majority of the Earth’s surface is water. Plot the new posterior. Use 1000 grid approximations and set the set as set.seed(100).

Question 4

  1. For the posterior distribution from 3, compute 89% percentile and HPDI intervals. Compare the widths of these intervals. Which is wider? Why? If you had only the information in the interval, what might you misunderstand about the shape of the posterior distribution?

Optional (not graded)

Suppose there is bias in sampling so that Land is more likely than Water to be recorded. Specifically, assume that 1-in-5 (20%) of Water samples are accidentally recorded instead as “Land.” First, write a generative simulation of this sampling process. Assuming the true proportion of Water is 0.70, what proportion does your simulation tend to produce instead? Second, using a simulated sample of 20 tosses, compute the unbiased posterior distribution of the true proportion of water.

Previous
Next