Skip to Content
BayesiaLabKey ConceptsBayes' Rule (Bayes' Theorem)

Bayes’ Rule (Bayes’ Theorem)

Context

“Bayesian inference is important because it provides a normative and general-purpose procedure for reasoning under uncertainty.” Inductive Reasoning: Experimental, Developmental, and Computational Approaches, edited by Aidan Feeney and Evan Heit

Bayesian inference refers to an approach first proposed by Rev. Thomas Bayes  (1702-1761), whose rule allows calculating the probability of an event AA upon observing an event BB.

Bayes’ Rule

Bayes’ rule relates the conditional and marginal probabilities of events AA and BB. When P(B)>0P(B)>0, it gives the probability of AA given BB from the probability of BB given AA and the marginal probabilities.

P(A∣B)=P(A)P(B∣A)P(B)P(A \mid B) = P(A)\frac{P(B \mid A)}{P(B)}

Posterior

The posterior probability P(A∣B)P(A \mid B) is the conditional probability of event AA given event BB.

“Posterior” describes the probability after conditioning on BB. The events AA and BB can occur in either order.

Loading SVG...

In the 592-student sample, 94 students have both traits. Among the 215 blue-eyed students, 43.7% have blond hair. Among the 127 blond students, 74.0% have blue eyes. Each bar shows the size of the group being considered.

Prior

The prior probability P(A)P(A) is the marginal probability of event AA before conditioning on BB. The unconditional probability P(A)P(A) was first called “a priori” by Sir Ronald A. Fisher .

The marginal probability P(B)P(B) is the probability of event BB.

“Prior” describes when the probability is assessed relative to conditioning.

Likelihood ratio

P(B∣A)P(B)\frac{P(B \mid A)}{P(B)}

This ratio is the multiplier that takes the prior probability P(A)P(A) to the posterior probability P(A∣B)P(A \mid B). Its denominator is the marginal probability of BB.

Loading SVG...

Blue eyes occur in 74.0% of blond students and 36.3% of all students. Dividing these rates gives the probability multiplier of about 2.04. Applying it to the prior of 21.5% gives a posterior of 43.7%, using unrounded values.

A Bayes factor compares the likelihood of the same evidence under two hypotheses. For hypotheses H1H_1 and H0H_0, the ratio P(B∣H1)/P(B∣H0)P(B \mid H_1)/P(B \mid H_0) multiplies the prior odds of H1H_1 versus H0H_0 to give the posterior odds. Kass and Raftery, Bayes Factors 

Loading SVG...

Compare the frequency of blue eyes in the blond group with their frequency in the other hair-color group. Blue eyes are about 2.84 times as likely in the blond group. Multiplying the prior odds by this Bayes factor gives posterior odds of 94 to 121.

Learn more