Lab · c11.s04.L1

Bayes update

A positive test reweights the people who could test positive; the posterior is the share of them who are actually sick.

Question: How do you turn a likelihood into a belief?

Bayes updateOne thousand people fill a grid of forty by twenty-five small squares. The russet squares at the top left are people who have the disease; the rest are healthy. After one positive test, gold hatched squares mark healthy people who also test positive, and at the default settings they outnumber the sick positives. Two bars show belief before the test, 1%, and after it, 15.4%: the belief is the share of positive tests that come from sick people.Bayes updateHow do you turn a likelihood into a belief?1,000 people, 40 by 25 squaresBeliefBEFORE THE TESTAFTER A POSITIVE TESTsick, positivehealthy, positivesick, negativehealthy, negative1%Before the test1% of the 1,000 peoplehave the disease.10 people, in russet.
Synthetic Synthetic: the prevalence and the two test accuracies are chosen teaching values, not measurements. Every posterior, likelihood ratio and head count is computed exactly from Bayes' rule by data/scripts/c11.s04.L1.py. The frames draw the 1,000 people in four groups by who has the disease and who tests positive, then show the belief before and after one positive test.
Lab controls
1%

Arrow keys move one stop, Home selects 0.1%, End selects 40%

90%

Arrow keys move one stop, Home selects 90%, End selects 99%

5%

Arrow keys move one stop, Home selects 1%, End selects 20%

Frame 1 of 4: The prior1% of the 1,000 people have the disease: 10. The grid draws them in russet at the top left; every other square is a healthy person. The bar beside the grid shows the belief before any test.

The prior. 1% of the 1,000 people have the disease: 10. The grid draws them in russet at the top left; every other square is a healthy person. The bar beside the grid shows the belief before any test.

Keyboard: Space plays or pauses, Left and Right step, Home goes to the first frame, End goes to the last frame.

Text description of this lab

One thousand people fill a grid of forty by twenty-five small squares. The russet squares at the top left are people who have the disease; the rest are healthy. After one positive test, gold hatched squares mark healthy people who also test positive, and at the default settings they outnumber the sick positives. Two bars show belief before the test, 1%, and after it, 15.4%: the belief is the share of positive tests that come from sick people.

Return to the section that hosts this lab

Caption status: synthetic. Every lab declares one of published, re-simulated, schematic, synthetic or interpolated.