Session Ready
Exercise

Exercise 12 - Change the Priors

We had set the prior variance \(\tau\) to 0.01, reflecting that these races are often close.

Change the prior variance to include values ranging from 0.005 to 0.05 and observe how the probability of Trump winning Florida changes by making a plot.

Instructions
100 XP
  • Create a vector of values of taus by executing the sample code.
  • Create a function using function(){} called p_calc that takes the value tau as the only argument, then calculates B from tau and sigma, and then calculates the probability of Trump winning, as we did in the previous exercise.
  • Apply your p_calc function across all the new values of taus.
  • Use the plot function to plot \(\tau\) on the x-axis and the new probabilities on the y-axis.