Calculator Inputs
Example Data Table
| Scenario | Prior % | Sensitivity % | Specificity % | Observed Result | Posterior % |
|---|---|---|---|---|---|
| Rare screening case | 1.00 | 95.00 | 90.00 | Positive | 8.76 |
| Moderate prevalence review | 20.00 | 80.00 | 85.00 | Positive | 57.14 |
| Moderate prevalence retest | 20.00 | 80.00 | 85.00 | Negative | 5.56 |
| High accuracy signal | 5.00 | 98.00 | 97.00 | Positive | 63.23 |
Formula Used
Bayes' theorem updates a prior belief after new evidence appears. The calculator uses the observed evidence, its likelihood under the hypothesis, and its likelihood under the complement.
Positive evidence: P(H|E) = [P(E|H) × P(H)] ÷ { [P(E|H) × P(H)] + [P(E|¬H) × P(¬H)] }
Negative evidence: P(H|¬E) = [P(¬E|H) × P(H)] ÷ { [P(¬E|H) × P(H)] + [P(¬E|¬H) × P(¬H)] }
Odds form: Posterior Odds = Prior Odds × Bayes Factor
| Symbol | Meaning |
|---|---|
| P(H) | Prior probability that the hypothesis is true. |
| P(E|H) | Chance of observing the evidence when the hypothesis is true. |
| P(E|¬H) | Chance of observing the evidence when the hypothesis is false. |
| P(H|E) | Posterior probability after the evidence is observed. |
| LR+ / LR- | Likelihood ratios describing how strongly the observation shifts the odds. |
How to Use This Calculator
- Select diagnostic mode for sensitivity and specificity inputs, or choose direct mode for custom conditional probabilities.
- Enter the prior probability for the event, condition, or hypothesis before new evidence is observed.
- Choose whether the evidence was present or absent, then enter the reference population and preferred decimal precision.
- Click Calculate Posterior to see the updated probability, evidence probability, odds, likelihood ratios, and expected counts.
- Use the export buttons to download a CSV summary or a PDF report of the visible result section.
Frequently Asked Questions
1. What does Bayes' theorem calculate?
It updates the probability of a hypothesis after new evidence appears. The output shows how the prior belief changes once the observation is included.
2. Why is the posterior lower than the sensitivity?
Sensitivity measures accuracy among true cases. Posterior probability also depends on prevalence and false positives, so it can be much lower when the event is rare.
3. When should I use diagnostic mode?
Use diagnostic mode when you know sensitivity and specificity from a test, screen, sensor, or classification rule and want predictive meaning from the result.
4. When should I use direct conditional mode?
Use it when you already know P(E|H) and P(E|¬H) directly. This suits fraud alerts, clues, alarms, and other nonmedical Bayesian problems.
5. What does the evidence probability mean?
It is the total chance of seeing the selected evidence across all cases. It combines the hypothesis branch and the complement branch.
6. Why are likelihood ratios useful?
Likelihood ratios show how strongly a result shifts the odds. Values above one support the hypothesis, while values below one weaken it.
7. Can I use this for negative evidence?
Yes. Select absent or negative evidence. The calculator will use complementary likelihoods and return the updated probability after a negative observation.
8. Are the expected counts real observations?
They are modeled counts based on your reference population and input rates. They help explain the posterior intuitively but do not replace collected data.