Professional Documents
Culture Documents
Bayes' Rule: A Short Lecture by Alex Robinson
Bayes' Rule: A Short Lecture by Alex Robinson
• Suppose that we have a belief about the weather tomorrow: there is a 50%
chance that it will rain.
• The weather forecast says that it will rain tomorrow.
• How should we update our initial prediction about tomorrow’s weather?
What is Bayes’ Rule?
• Let’s
call our initial prediction P(A) (called the prior), where A represents
rain tomorrow.
• We want to know P(A|B) (called the posterior), or the probability of rain
given what the forecast said.
• B represents the forecast, and P(B|A) measures how accurate the forecast
usually is.
Why does Bayes’ Rule matter?
• Any time we make a prediction or perform a test, Bayes’ Rule is important! Weather
forecasts, medical tests, DNA tests, etc.
• PROBLEM: Often, the accuracy of the test is confused with the updated probability.
• Example: If you test positive forP(A|B)
Covid,≠ does
P(B|A)that always mean you have Covid?
• Example: Brandon Mayfield and the 2004 Madrid Train Bombings.
𝑃 ( 𝐵| 𝐴 ) 𝑃 ( 𝐴 )
𝑃 ( 𝐴|𝐵 ) =
𝑃 ( 𝐵)
True Positives and True Negatives
• We can measure how good a test is with the True Positive Rate (Sensitivity) and the True Negative Rate
(Specificity)
• True Positive Rate = (Total # of True Positives)/(Total # Days it Rained)
• True Negative Rate = (Total # of True Negatives)/(Total # Days it Didn’t Rain)
• True Positive and True Negative Rates don’t tell the whole story… also need to know how often it rains, on
average
Updating Probabilities: Strep Throat
• Suppose you have a sore throat and take a rapid strep throat test.
• A rapid strep throat test will read positive for about 86% of strep throat
cases.
• It will read negative for 95% of non-strep throat cases.
• On average, about 15% of sore throats are due to strep.
• Assuming you test positive, how likely is it that you have strep?
Strep Throat Example
• Imagine 10,000 patients with sore throats take a strep throat test.
• On average, 15% of the patients have strep throat: 0.15 x 10,000 = 1,500
Strep Throat No Strep Throat Totals
Test Positive True Positives False Positives Total Positives
Test Negative False Negatives True Negatives Total Negatives
Totals 1,500 8,500 10,000
Strep Throat Example
• The test has a True Positive Rate of 86% - so 86% of the 1,500 Strep Throat
cases will test positive.
0.86 x 1,500 = 1290. This means the remaining 1,500 – 1,290 = 210 Strep
cases are False Negatives
• The test has a True Negative Rate of 95% - so 95% of the 8,500 Non-Strep
Throat cases will test negative.
0.95 x 8,500 = 8075. This means the remaining 8,500 – 8,075 = 425 Non-
Strep cases are False Positives
Strep Throat No Strep Throat Totals
Test Positive 1,290 425 Total Positives
Test Negative 210 8,075 Total Negatives
Totals 1,500 8,500 10,000
Strep Throat Example
P(N | H) = 0.95
P(S) = 0.15
𝑃 ( 𝐵| 𝐴 ) 𝑃
Conclusions 𝑃 ( 𝐴 |𝐵 ) =
𝑃 ( 𝐵)