Skip to content

Mathematics · Ch 7 — Probability

Bayes' Theorem

5

Bayes' Theorem

Motivation: Reversing a Conditional Probability

The total probability theorem finds P(A)P(A) given the conditional probabilities P(A∣Ei)P(A\mid E_i) of an effect AA given each possible cause EiE_i. Bayes' theorem answers the reverse question: having observed that AA has occurred, what is the probability that it was caused by a particular EiE_i? That is, it finds P(Ei∣A)P(E_i\mid A) from the P(Ei)P(E_i) and P(A∣Ei)P(A\mid E_i).

Statement

Let E1,E2,…,EnE_1,E_2,\dots,E_n be a partition of the sample space SS with P(Ei)>0P(E_i)>0 for every ii, and let AA be any event with P(A)>0P(A)>0. Then, for each ii,

P(Ei∣A)=P(Ei) P(A∣Ei)∑j=1nP(Ej) P(A∣Ej).P(E_i\mid A) = \frac{P(E_i)\,P(A\mid E_i)}{\displaystyle\sum_{j=1}^{n} P(E_j)\,P(A\mid E_j)}.

Proof

By the definition of conditional probability and then the multiplication theorem (Section 2),

P(Ei∣A)=P(A∩Ei)P(A)=P(Ei) P(A∣Ei)P(A).P(E_i\mid A) = \frac{P(A\cap E_i)}{P(A)} = \frac{P(E_i)\,P(A\mid E_i)}{P(A)}.

The denominator P(A)P(A) is exactly the quantity given by the total probability theorem (Section 4), P(A)=∑j=1nP(Ej)P(A∣Ej)P(A)=\sum_{j=1}^n P(E_j)P(A\mid E_j). Substituting this expression for P(A)P(A) gives the stated formula. ■\blacksquare

Terminology

The events E1,…,EnE_1,\dots,E_n are called hypotheses; P(Ei)P(E_i), known before any new evidence, is called the priori probability of EiE_i; and P(Ei∣A)P(E_i\mid A), recomputed after the evidence AA is observed, is called the posteriori probability of EiE_i (given AA). Bayes' theorem is precisely the rule for updating a priori belief into posteriori belief in light of new evidence.

Worked Illustration: A Diagnostic Test

Suppose 0.5%0.5\% of a population has a disease (DD), so P(D)=0.005P(D)=0.005 and P(D′)=0.995P(D')=0.995. A test correctly returns positive for 99%99\% of people who have the disease, P(Pos∣D)=0.99P(\text{Pos}\mid D)=0.99, but also incorrectly returns positive for 2%2\% of healthy people, P(Pos∣D′)=0.02P(\text{Pos}\mid D')=0.02. Here {D,D′}\{D,D'\} is a partition of the population, so Bayes' theorem gives

P(D∣Pos)=P(D)P(Pos∣D)P(D)P(Pos∣D)+P(D′)P(Pos∣D′)=(0.005)(0.99)(0.005)(0.99)+(0.995)(0.02)=0.004950.02485≈0.199.P(D\mid \text{Pos}) = \frac{P(D)P(\text{Pos}\mid D)}{P(D)P(\text{Pos}\mid D)+P(D')P(\text{Pos}\mid D')} = \frac{(0.005)(0.99)}{(0.005)(0.99)+(0.995)(0.02)} = \frac{0.00495}{0.02485}\approx 0.199. …