- Prior P(A)
- 0.01
- Likelihood P(B|A)
- 0.9
- Likelihood P(B|¬A)
- 0.05
0.153846
Open with these values0.153846
Result: 0.153846Bayes' theorem turns a belief held before the evidence into one held after it. The surprise is how much the prior weighs: with a 1 % prior, a test that catches 90 % of cases and cries wolf on 5 % leaves the posterior at 15 %, not at 90 %.
0.153846
Open with these values0.890625
Open with these values0.090164
Open with these valuesP(A|B) = P(B|A)·P(A) ÷ [P(B|A)·P(A) + P(B|¬A)·(1 − P(A))]
Bayes' theorem answers the question a test result raises but does not answer by itself: given a positive result, how likely is the condition? The calculator gets there by weighing two groups against each other. Take the values set here. A prior of 0.01 means one person in a hundred is affected; a likelihood of 0.9 means nine of every ten of those test positive. Out of ten thousand people that is 100 affected, 90 of whom test positive. The other 9,900 are unaffected, and a false-positive rate of 0.05 puts 495 of them in the positive column as well. The denominator of the formula is nothing more than the sum of those two streams — 90 + 495 = 585 positive results in all — and the posterior is the genuine share of them: 90 ÷ 585 = 0.153846. What the calculator never checks is where the prior came from. The theorem is an updating rule, not a source of belief: feed it a prior plucked from the air and it hands back a posterior of the same quality, neatly carried to six decimals. And it weighs exactly two hypotheses against exactly one piece of evidence. A third possibility, or a second test whose result is tied to the first, needs more than this page.
A test that catches 90 % of cases gives you P(B|A). What a positive result is worth is P(A|B), and with a prior of 0.01 and a 5 % false-positive rate that is 0.153846.
When the prior is small, most positive evidence comes from the far larger group in which A is false. A prior of 0.001 with a 0.99 likelihood and a 0.01 false-positive rate still lands at 0.090164.
With a prior of 0.01, a likelihood of 0.9 and 0.05 false positives give 0.153846. With a prior of 0.3, a likelihood of 0.95 and the same 0.05 give 0.890625.
Zero times any likelihood stays zero, so no evidence brings back a hypothesis already ruled out. A prior of 1 stays 1 for the same reason.
The test catches 90 % of cases, so a positive result makes me 90 % likely to have it.
Those are two different probabilities: 90 % is P(B|A), while the question asks for P(A|B). With a prior of 0.01 and 5 % false positives the answer is 0.153846.
With a good enough test the prior hardly matters.
It is usually the strongest lever. A prior of 0.001 with a 0.99 likelihood and 0.01 false positives gives 0.090164 — under ten percent, from an excellent test.
A posterior of 0.154 shows the test is unreliable.
The test is doing its job; the base rate is doing the rest. Most positive results come from the 99 % of cases in which A is false.
| Prior, P(B|A), P(B|¬A) | Situation | Posterior |
|---|---|---|
| 0.01, 0.9, 0.05 | Rare condition, decent test | 0.153846 |
| 0.001, 0.99, 0.01 | Very rare, excellent test | 0.090164 |
| 0.1, 0.8, 0.2 | Uncommon, mediocre test | 0.307692 |
| 0.3, 0.95, 0.05 | Common, excellent test | 0.890625 |
| 0.5, 0.9, 0.1 | Coin-flip prior | 0.900000 |
Multiply the likelihood of the evidence given A by the prior of A, then divide by the total probability of that evidence. Enter the three probabilities as decimals between 0 and 1 and the calculator returns the posterior P(A|B).
The posterior P(A|B) is the probability of A after the evidence B has been observed. It updates the prior P(A) using how likely the evidence is when A is true versus when A is false.
That is the base-rate effect. When the prior is small, most of the positive evidence comes from the much larger group in which A is false, so even a high P(B|A) leaves the posterior modest. A prior of 0.01 with a likelihood of 0.9 and a false-positive rate of 0.05 gives about 0.154.
Three probabilities, each a decimal between 0 and 1: the prior P(A), the likelihood P(B|A) — the true-positive rate — and the likelihood P(B|¬A), the false-positive rate. The complement P(¬A) = 1 − P(A) is worked out for you.
Only when the evidence is impossible under both hypotheses, which makes the denominator zero and the posterior undefined. The calculator shows zero there, because an event that never occurs updates nothing.
Information, not professional advice.
Diese Seite gibt es auch auf Deutsch.
Zu Deutsch wechseln