Fundamentals of Bayesian Data Analysis in R
Rasmus Bååth
Data Scientist
$$\text{p(x)} = {5\choose x}(\frac{1}{6})^x(1-(\frac{1}{6}))^{5-x}$$
number_of_sixes
1 1 0 0 1 0 1 2 0 1 0 0 1 0 0 0 0 0 1 1 1 0 1 1 0 0 2 0
0 1 0 0 1 0 0 1 0 1 2 0 1 0 0 0 1 2 1 2 0 0 1 1 3 3 0 0
1 1 1 1 1 0 0 1 2 0 1 3 1 1 1 0 1 0 1 2 0 1 1 0 1 1 1 0
2 1 0 4 0 1 2 1 1 1 2 0 1 0 1 1 0 0 2 0 0 0 0 0 1 1 0 1
0 0 0 0 2 0 0 0 0 0 1 1 0 0 2 1 1 1 0 2 1 1 1 0 0 1 1 1
...
mean(number_of_sixes)
0.83
posterior <- prop_model(data)
print(posterior)
0.23 0.36 0.20 0.21 0.12
0.10 0.03 0.16 0.09 0.14
0.23 0.05 0.15 0.26 0.22
...
Fundamentals of Bayesian Data Analysis in R