Bayes’ Rule
Probability that some hypothesis h is true, given that some event e has occured. P ph|eq “ P pe|hqP phq
P peq
P peq “ P pe|hqP phq ` P pe|␣hqP p␣hq
Now, since:
we can rewrite this in a form in which it is commonly applied:
P ph|eq “ P pe|hqP phq
P pe|hqP phq ` P pe|␣hqp1 ́ P phqq
where variables are binary valued.
⃝c -Trenn, King’s College London 2
Some examples
From:
⃝c -Trenn, King’s College London
3
The wrong underwear
You live with your partner.
You come home from a business trip to discover a strange pair of un- derwear in your drawer.
What should you think?
⃝c -Trenn, King’s College London 4
In popular culture
(Metro-Goldwyn-Mayer)
Major plot device in the 2003 romantic comedy.
⃝c -Trenn, King’s College London 5
The wrong underwear
What do you think?
⃝c -Trenn, King’s College London 6
What do you think?
What would you guess is the probability? Just a rough estimate…
⃝c -Trenn, King’s College London 7
The wrong underwear
Probability that some hypothesis is true, given that some event has occured. P ph|eq “ P pe|hqP phq
P pe|hqP phq ` P pe|␣hqp1 ́ P phqq
event = underwear hypothesis = partner cheating To apply Bayes rule we need:
‚ Ppe|hq
‚ Ppe|␣hq ‚ Pphq
⃝c -Trenn, King’s College London 8
The wrong underwear
P pe|hq
If they cheated, how likely is the underwear?
Well, if they cheated, then maybe it is likely the underwear would appear. But also, wouldn’t they be more careful?
Say 50% chance.
⃝c -Trenn, King’s College London 9
The wrong underwear
P pe|␣hq
Is there an innocent explanation?
A friend stayed over? Something was left in the dryer? Say 5% chance
⃝c -Trenn, King’s College London 10
The wrong underwear
P phq?
Prior probability they cheated — before there was any evidence. Hard to quantify.
Studies suggest about 4% of married partners cheat in a given year. Say 4%.
⃝c -Trenn, King’s College London 11
The wrong underwear
The verdict?
P ph|eq “ P pe|hqP phq
P pe|hqP phq ` P pe|␣hqp1 ́ P phqq
0.5 ̈ 0.04
“ 0.5 ̈0.04`0.05 ̈p1 ́0.04q
“ 0.294 Low because of the low prior.
⃝c -Trenn, King’s College London 12
The wrong underwear
Now it happens again.
⃝c -Trenn, King’s College London 13
The wrong underwear
What do you think?
⃝c -Trenn, King’s College London 14
The wrong underwear
Well now the prior is 0.294
P ph|eq “ P pe|hqP phq
P pe|hqP phq ` P pe|␣hqp1 ́ P phqq
0.5 ̈ 0.294
“ 0.5 ̈0.294`0.05 ̈p1 ́0.294q
“ 0.806 and the verdict is pretty clear.
⃝c -Trenn, King’s College London 15
A medical example
Let M be meningitis, S be stiff neck:
P pm|sq “
P ps|mqP pmq P psq
0.8 ̈ 0.0001 0.1
“
“ 0.0008
Posterior probability of meningitis still very small, again because of low prior. Common pattern in medical test results.
Note that here we used a slightly different formulation of Bayes Rule.
⃝c -Trenn, King’s College London 16
Bayes rule & knowledge representation
Useful for assessing diagnostic probability from causal probability:
PpCause|Effectq “ PpEffect|CauseqPpCauseq PpEffectq
We saw this in both examples.
⃝c -Trenn, King’s College London
17
Bayes rule & knowledge representation
Often easier to assess causal probabilities.
PpCause|Effectq “ PpEffect|CauseqPpCauseq PpEffectq
Can visualise this as:
Cause Effect
⃝c -Trenn, King’s College London
18
Bayes rule & knowledge representation
Often easier to assess causal probabilities.
PpMeasles|Spotsq “ PpSpots|MeaslesqPpMeaslesq P pSpotsq
Can visualise this as:
Measles Spots
⃝c -Trenn, King’s College London
19
Mathematical!
⃝c -Trenn, King’s College London 20
What we learned so far
Probability is a rigorous formalism for uncertain knowledge
Joint probability distribution specifies probability of every atomic event
Queries can be answered by summing over atomic events
For nontrivial domains, we must find a way to reduce the joint size
Independence and conditional independence provide the tools for efficient computation along with Bayes’ rule.
Next week we’ll look at how they are used.
⃝c -Trenn, King’s College London 21