Exercise

Bayes with another spin

Our current probabilities that the spinner is Spinner A or Spinner B are given by the vector (0.75, 0.25).

Recall that the spinner regions are

regA <- c(1, 2, 3)
regB <- c(3, 2, 1)

where the integers represent the sizes of the red, green, and blue regions, respectively.

Suppose you spin the spinner a second time and again you land in the blue region.

Since you have spun again, you need to update the prior! To do this you run Bayes' rule a second time to find new spinner probabilities.

Instructions

100 XP
  • Define the two vectors Prior and Likelihood.
  • Construct a data frame bayes_df containing variables Model, Prior, and Likelihood, in that order.
  • Use the function bayesian_crank to compute the posterior probabilities of Spinner A and Spinner B.