Exercise

# Comparing & contrasting Beta priors

The Beta(\(a\),\(b\)) distribution is defined on the interval from 0 to 1, thus provides a natural and flexible prior for your underlying election support, \(p\). You can *tune* the Beta shape parameters \(a\) and \(b\) to produce alternative prior models. Below you will compare your original Beta(45,55) prior with two alternatives: Beta(1, 1) and Beta(100, 100). The original 10,000 `prior_A`

samples drawn from Beta(45,55) are in your workspace.

Instructions

**100 XP**

- Sample 10,000 draws from the Beta(1,1) prior. Assign the output to
`prior_B`

. - Sample 10,000 draws from the Beta(100,100) prior. Assign the output to
`prior_C`

. - The
`prior_sim`

data frame combines the`prior_A`

,`prior_B`

, and`prior_C`

prior`samples`

with a corresponding indicator of the`priors`

. To construct a`ggplot()`

density plot of these 3*separate*prior`samples`

on the same frame, specify`fill = priors`

in`aes()`

.