Aan de slagGa gratis aan de slag

Coin flips with prop_model

The function prop_model has been loaded into your workspace. It implements a Bayesian model that assumes that:

  • The data is a vector of successes and failures represented by 1s and 0s.
  • 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)

Deze oefening maakt deel uit van de cursus

Fundamentals of Bayesian Data Analysis in R

Cursus bekijken

Praktische interactieve oefening

Zet theorie om in actie met een van onze interactieve oefeningen.

Begin met trainen