You just did some Bayesian data analysis!

Fundamentals of Bayesian Data Analysis in R

Rasmus Bååth

Data Scientist

Fundamentals of Bayesian Data Analysis in R

Fundamentals of Bayesian Data Analysis in R

Fundamentals of Bayesian Data Analysis in R

Priors & Posteriors

  • A prior is a probability distribution that represents what the model knows before seeing the data.
  • A posterior is a probability distribution that represents what the model knows after having seen the data.
Fundamentals of Bayesian Data Analysis in R

Fundamentals of Bayesian Data Analysis in R

The probability distribution over the number of 6's when rolling 5 dice

$$\text{p(x)} = {5\choose x}(\frac{1}{6})^x(1-(\frac{1}{6}))^{5-x}$$

Fundamentals of Bayesian Data Analysis in R
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
Fundamentals of Bayesian Data Analysis in R
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

Finish off the Zombie drug analysis!

Fundamentals of Bayesian Data Analysis in R

Preparing Video For Download...