Coin flips with prop_model
The function prop_model has been loaded into your workspace. It implements a Bayesian model that assumes that:
- The
datais a vector of successes and failures represented by1s and0s. - There is an unknown underlying proportion of success.
- Prior to being updated with data any underlying proportion of success is equally likely.
Assume you just flipped a coin four times and the result was heads, tails, tails, heads. If you code heads as a success and tails as a failure then the following R codes runs prop_model with this data
data <- c(1, 0, 0, 1)
prop_model(data)
Este exercício faz parte do curso
Fundamentals of Bayesian Data Analysis in R
Exercício interativo prático
Transforme a teoria em ação com um de nossos exercícios interativos
Começar o exercício