Conditional Probability Playground
Setup: a person either has the condition (C=1) or does not (C=0). The test can come back
positive (T=1) or negative (T=0). The arrow C -> T means the true condition
affects how likely each test result is.
P(C): Probability the condition is present (C = 1)
| C | P(C) |
|---|---|
| 0 | 0.990 |
| 1 | 0.010 |
Conditional P(T | C)
| C | P(T=1|C) | P(T=0|C) |
|---|---|---|
| 1 | 0.950 | 0.050 |
| 0 | 0.050 | 0.950 |
0.010
0.950
0.050
1000
Joint table P(C,T)
| T=0 | T=1 | |
|---|---|---|
| C=0 | 0.941 | 0.050 |
| C=1 | 0.001 | 0.010 |
Evidence and Posterior
Choose observed evidence for T. Posterior updates by Bayes' rule using the normalizer P(T).
P(T=1) = 0.059
P(T=0) = 0.941
Posterior table P(C | T = observed)
| C | P(C | T=1) |
|---|---|
| 0 | 0.839 |
| 1 | 0.161 |
How to read this:
Prior/base rate: starting chance before seeing test data,
Likelihood/CPT: test behavior given condition,
Evidence: pick observed
Posterior: updated belief
Prior/base rate: starting chance before seeing test data,
P(C).Likelihood/CPT: test behavior given condition,
P(T|C).Evidence: pick observed
T.Posterior: updated belief
P(C|T) = (prior x likelihood) / P(T).