Bayesian Prior Calculator
Apply Bayes' theorem to update a prior probability given test sensitivity and false positive rate. Calculate the posterior probability after a positive or negative result.
Inputs
Results
Posterior P(A | positive test)
0.16
Posterior P(A | negative test)
0
How to Use This Calculator
- Enter the Prior Probability — your belief that the condition is present before seeing the test result (e.g., disease prevalence).
- Enter the Sensitivity (true positive rate) — the probability the test is positive given the condition is present.
- Enter the False Positive Rate — the probability the test is positive when the condition is absent (1 − Specificity).
- Bayes' theorem updates the prior: P(condition | positive test) = (sensitivity × prior) / P(positive test).
- The Posterior Probability is the updated belief after a positive result; it depends heavily on the prior.
- Low prevalence dramatically reduces the positive predictive value even for highly sensitive tests — this is the base rate fallacy.
How the result changes with Prior Probability P(A)
| Prior Probability P(A) | Posterior P(A | positive test) | Posterior P(A | negative test) |
|---|---|---|
| 0.1 | 0.68 | 0.01 |
| 0.35 | 0.91 | 0.03 |
| 0.65 | 0.97 | 0.09 |
| 0.9 | 0.99 | 0.32 |
What each input means
- Prior Probability P(A)
- Your initial belief about the probability before seeing evidence. E.g., disease prevalence.
- Sensitivity (True Positive Rate)
- Probability of a positive test given the condition is present. Also called recall or TPR.
- False Positive Rate
- Probability of a positive test given the condition is absent. Equal to 1 - specificity.
How this is calculated
Worked example, using the default values
- Identify Input ParametersPrior Probability P(A) = 0.01, Sensitivity (True Positive Rate) = 0.95, False Positive Rate = 0.05 = 3 input(s) provided
- Calculate Posterior PPosterior P0.161 = 0.161
- Calculate Posterior PPosterior P0.0005 = 0.0005
- Calculate Positive Likelihood RatioPositive Likelihood Ratio = Math19 = 19
- Calculate Negative Likelihood RatioNegative Likelihood Ratio0.0526 = 0.0526
Engine last updated . Checked against 2 independently-derived tests — how we verify calculators.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
ROC Curve Calculator
Calculate sensitivity, specificity, PPV, NPV, accuracy, F1 score, and approximate AUC from a confusion matrix (TP, FP, TN, FN).
StatisticsFisher's Exact Test Calculator
Perform Fisher's exact test on a 2x2 contingency table to determine if there is a significant association between two categorical variables.
Machine Learning & AIBayesian Inference Calculator
Calculate posterior probability, Bayes factor, likelihood ratio, and evidence strength using Bayes' theorem.
Forensic ScienceDNA Match Probability Calculator
Calculate random match probability and likelihood ratio for DNA evidence based on loci matched, population size, and allele frequencies.
StatisticsZ-Score Calculator
Calculate the z-score (standard score) for any value in a normal distribution. Find the percentile ranking and probability associated with your data point.
More in Math & Statistics.