Extending Bayes' Theorem

Apply Bayes' theorem when the sample space is partitioned into more than two events, using the extended law of total probability to compute the denominator.

Step 1 of 119%

Tutorial

Extended Bayes' Theorem

Suppose the sample space is partitioned into mutually exclusive and exhaustive events A1,A2,,AnA_1, A_2, \ldots, A_n, and we observe an event BB. Ordinary Bayes' theorem says

P(AiB)=P(BAi)P(Ai)P(B).P(A_i \mid B) = \dfrac{P(B \mid A_i)\, P(A_i)}{P(B)}.

Using the extended law of total probability, the denominator can be rewritten as

P(B)=j=1nP(BAj)P(Aj).P(B) = \sum\limits_{j=1}^{n} P(B \mid A_j)\, P(A_j).

Substituting, we obtain the extended form of Bayes' theorem:

P(AiB)=P(BAi)P(Ai)j=1nP(BAj)P(Aj).P(A_i \mid B) = \dfrac{P(B \mid A_i)\, P(A_i)}{\sum\limits_{j=1}^{n} P(B \mid A_j)\, P(A_j)}.

For instance, with three partition events A1,A2,A3A_1, A_2, A_3:

P(A2B)=P(BA2)P(A2)P(BA1)P(A1)+P(BA2)P(A2)+P(BA3)P(A3).P(A_2 \mid B) = \dfrac{P(B \mid A_2)\, P(A_2)}{P(B \mid A_1)\, P(A_1) + P(B \mid A_2)\, P(A_2) + P(B \mid A_3)\, P(A_3)}.

In practice, we know the priors P(Aj)P(A_j) and the likelihoods P(BAj)P(B \mid A_j); the formula combines them into the posterior P(AiB)P(A_i \mid B), updating our belief about which AiA_i occurred once we observe BB.

navigate · Enter open · Esc close · ⌘K/Ctrl K toggle