Bayes' theorem (aka Bayes' rule) is a useful tool for calculating conditional probabilities.
Definition. Let A1, A2, ... , An be a set of mutually exclusive events that together form the sample space S. Let B be any event from the same sample space, such that P(B) > 0. Then,
P( Ak | B ) =
P( Ak ∩ B )
P( A1 ∩ B ) + P( A2 ∩ B ) + . . . + P( An ∩ B )
A simple form is: P(A|B) = P(B|A) P(A) / P(B)
Note: Invoking the fact that P( Ak ∩ B ) = P( Ak )P( B | Ak ), Baye's theorem can also be expressed as
P( Ak | B ) =
P( Ak ) P( B | Ak )
P( A1 ) P( B | A1 ) + P( A2 ) P( B | A2 ) + . . . + P( An ) P( B | An )
Example:
Let D+ denote having disease and "T+" denote the positive test. Let P(T+|D+) = 0.95, so the false negative rate, P(T-|D+), is 5%. Let P(T+|D-) = 0.05,, so the false positive rate is also 5%. Suppose the disease is rare: P(D+) = 0.01 (1%). Then