Bayesian Statistics
Bayesian Statistics
Bayesian Statistics
Alireza Akhondi-Asl
MSICU Center For Outcomes
Department of Anesthesiology, Critical Care and Pain Medicine
Learning Objectives
Frequentist Subjective
Frequentist
Probability
• Relative Frequency of an Event in
long run:
#𝑡𝑖𝑚𝑒𝑠 𝑒 ℎ𝑎𝑝𝑝𝑒𝑛𝑑
𝑃 𝑒 = lim
𝑛→∞ 𝑛
It is inside the head probability
We should be coherent.
Conditional probability
S
A
B
Law of total probability
If 𝐴1 , 𝐴2 , …, 𝐴4 is a partition of the sample space, then for
any event B we have:
S
𝐴2 𝐴3
𝐴1
𝐵
𝐴4
Bayes’ Rule
S
A
B
Bayes’ Rule
S
A
B
Bayes’ Rule
S
A
B
Bayes’ Rule S
𝐴2 𝐴3
𝐴1
𝐵
𝐴4
Bayes’ Rule S
𝐴2 𝐴3
𝐴1
𝐵
𝐴4
Bayes’ Rule S
𝐴2 𝐴3
𝐴1
𝐵
𝐴4
Medical Test
• A certain disease affects about 1 out of 1000 people in a
population.
• P()=0.001
• P(☺)=0.999
• There is a test to check whether the person has the
disease. The test has very high sensitivity and specificity. In
particular, we know that:
• P(T+|)=0.98
• P(T+|☺)=0.01
Medical Test
A) 98 Percent
B) Less than 10 percent
Medical Test
P(T+|)P()
P(|T+)=
P(T+)
Medical Test
P(T+|)P()
P(|T+)=
P(T+|)P()+P(T+|☺)P(☺)
Medical Test
P(T+|)P() 0.98×0.001
P(|T+)= = = 0.089
P(T+|)P()+P(T+|☺)P(☺) 0.98×0.001+0.01×0.999
Medical Test
P(T+|)P() 0.98×0.001
P(|T+)= = = 0.089
P(T+|)P()+P(T+|☺)P(☺) 0.98×0.001+0.01×0.999
The test updates your chances of having the diseases from 0.001 to 0.089.
Medical Test
A) 98 Percent
B) Less than 10 percent
What does present evidence
tell?
Richard
Royall’s Three What should we believe?
Questions
The uncertainty is
due to sampling
variation.
Frequentist
• 𝑃 𝐷𝑎𝑡𝑎 𝜃
• Maximum Likelihood Estimation
• P-values : 𝑃 𝐷𝑎𝑡𝑎 𝜃 = 𝜃0
• Confidence Intervals, Effect Size
• No probability statement about 𝜃
Bayesian
𝑃 𝐷𝑎𝑡𝑎 𝜃 𝑃(𝜃)
𝑃 𝜃 𝐷𝑎𝑡𝑎 =
𝑃(𝐷𝑎𝑡𝑎)
Bayesian
• Update our belief in a parameter using new evidence or data.
• Based on Bayes’ rule
Prior
𝑃 𝐷𝑎𝑡𝑎 𝜃 𝑃(𝜃)
𝑃 𝜃 𝐷𝑎𝑡𝑎 =
𝑃(𝐷𝑎𝑡𝑎)
Prior
Bayesian
• Update our belief in a parameter using new evidence or data.
• Based on Bayes’ rule
Likelihood Prior
𝑃 𝐷𝑎𝑡𝑎 𝜃 𝑃(𝜃)
𝑃 𝜃 𝐷𝑎𝑡𝑎 =
𝑃(𝐷𝑎𝑡𝑎)
Prior Model
Bayesian
• Update our belief in a parameter using new evidence or data.
• Based on Bayes’ rule
Likelihood Prior
𝑃 𝐷𝑎𝑡𝑎 𝜃 𝑃(𝜃)
𝑃 𝜃 𝐷𝑎𝑡𝑎 =
𝑃(𝐷𝑎𝑡𝑎)
Evidence
Likelihood Prior
Posterior
𝑃 𝐷𝑎𝑡𝑎 𝜃 𝑃(𝜃)
𝑃 𝜃 𝐷𝑎𝑡𝑎 =
𝑃(𝐷𝑎𝑡𝑎)
Evidence
Summarizes
Model
everything
Comparison
we know
Prediction Hypothesis
• Posterior Testing
predictive • Region of
distribution practical
equivalence
Example
𝑎−1 𝑏−1
𝑝 𝜃 𝑎, 𝑏 = beta a, b ∝ 𝜃 1−𝜃 ,0 ≤ 𝜃 ≤ 1
𝑎
• Mean=𝑎+𝑏
Conjugate Prior • Mode=𝑎+𝑏−2
𝑎−1
𝑝 𝑑𝑎𝑡𝑎 𝜃 = beta a + E, b + N − E
Example:
Stopping N is fixed. Binomial
Rules
Negative
E is fixed. Binomial
Fixed N
Fixed E
Uniform
Prior
Subjectivity
• Uniform prior.
• We believe all 0 ≤ 𝜃 ≤ 1
have the same prior
probability.
• We might think that this prior
is “uninformative”.
• Change the 𝜃 which is the
probability metric to odds
𝜃
𝑞=
1−𝜃
Weakly Informative
Informative priors
Objective Priors
• Jeffreys Prior
• Reference Prior
Jeffreys Prior
• Jeffreys proposed an “objective”
prior that is invariant under
monotone transformations of the
parameter.
• Based on Fisher information
• It is not uninformative
• For example, for binomial
distribution, Jeffreys Prior is
beta(0.5,0.5).
Jeffreys
prior
Reading Suggestions
• Kruschke, John K. (Ed.) (2014): Doing Bayesian data analysis.
A tutorial with R, JAGS, and Stan. Academic Press.
• Some of the simulations was based on the codes from this book.
• Lambert, Ben (2018): A student's guide to Bayesian
statistics. 1st. Los Angeles: SAGE.
• McElreath, Richard (2020): Statistical rethinking. A Bayesian
course with examples in R and Stan. Taylor and Francis CRC
Press.
• SOBER, ELLIOTT (2008): Evidence and evolution. The logic
behind the science. Cambridge, UK: Cambridge University
Press.
Conclusions