Update Beliefs with Prior, Likelihood, Evidence
From medical diagnosis to spam filters to courtroom evidence — Bayesian reasoning updates beliefs with evidence. Master prior, likelihood, and posterior.
Why This Statistical Analysis Matters
Why: Beliefs should update when new evidence arrives. Bayes' theorem formalizes this: posterior ∝ likelihood × prior. Base rate neglect and the prosecutor's fallacy are common errors.
How: Enter P(A) prior, P(B|A) likelihood, and P(B) evidence (or P(B|¬A) in full mode). Posterior P(A|B) = P(B|A)×P(A) / P(B).
- ●P(A|B) ≠ P(B|A) — prosecutor's fallacy
- ●Base rate matters for rare conditions
- ●Likelihood ratio measures evidence strength
Update Beliefs with Prior, Likelihood, Evidence — Step-by-Step Bayesian Reasoning
From medical diagnosis to spam filters to courtroom evidence — Bayesian reasoning updates beliefs with evidence. Master prior, likelihood, and posterior.
Calculation Mode
Real-World Scenarios — Click to Load
Inputs
Prior vs Posterior
Posterior Probability
🌳 Probability Tree
📊 Interpretation
Low posterior (16.1%): even with positive evidence B, A remains unlikely. This illustrates base rate neglect — a "positive" result doesn't guarantee A when the prior is very low.
For educational and informational purposes only. Verify with a qualified professional.
📋 Key Takeaways
- • Bayes' theorem updates a belief (prior) when new evidence arrives to produce a revised belief (posterior)
- • P(A|B) ≠ P(B|A) — confusing these is called the "prosecutor's fallacy" and has led to wrongful convictions
- • Base rate neglect: ignoring how rare a condition is leads to overestimating the meaning of positive tests
- • The likelihood ratio measures how much stronger evidence is under one hypothesis vs another
- • Bayesian thinking is iterative — each posterior becomes the next prior as new evidence arrives
💡 Did You Know
📖 How It Works
1. Prior Probability
Your initial belief before seeing evidence. P(A) — e.g., disease prevalence in the population.
2. Likelihood
How probable the evidence is if the hypothesis is true. P(B|A) — e.g., test sensitivity.
3. Evidence
Total probability of observing the evidence. P(B) = P(B|A)P(A) + P(B|¬A)P(¬A) via law of total probability.
4. Posterior
Updated belief after seeing evidence. P(A|B) — the answer we seek.
5. Iterative Updating
Each posterior becomes the next prior as new evidence arrives. Bayesian reasoning is inherently sequential.
🎯 Expert Tips
Always consider base rates
A 99% accurate test for a 1-in-10,000 disease still gives mostly false positives.
Use the odds form
Posterior odds = Prior odds × Likelihood ratio is easier for sequential updates.
Beware the prosecutor's fallacy
P(evidence|hypothesis) ≠ P(hypothesis|evidence).
Think about what P(B|¬A) means
The false positive rate dramatically affects the posterior when the prior is low.
⚖️ This Calculator vs. Other Tools
| Feature | This Calculator | Probability Calculator | Wolfram Alpha | R | Manual |
|---|---|---|---|---|---|
| Dedicated Bayes focus | ✅ | ⚠️ Bayes mode only | ✅ | ⚠️ Manual | ✅ |
| Prior vs Posterior charts | ✅ | ❌ | ❌ | ❌ | ❌ |
| Law of total probability mode | ✅ | ❌ | ⚠️ | ✅ | ✅ |
| Likelihood ratio, odds | ✅ | ❌ | ⚠️ | ⚠️ | ✅ |
| Educational content | ✅ | ⚠️ | ❌ | ❌ | ❌ |
| Step-by-step LaTeX | ✅ | ⚠️ | ⚠️ | ❌ | ❌ |
| Example presets | ✅ | ✅ | ❌ | ❌ | ❌ |
| Copy & share | ✅ | ✅ | ❌ | ❌ | ❌ |
❓ Frequently Asked Questions
What is the difference between Bayes' theorem and regular probability?
Regular probability computes P(A) or P(A and B). Bayes' theorem reverses conditionals: given P(B|A), it finds P(A|B). It's the mathematical framework for updating beliefs with evidence.
Why does the base rate matter so much?
When a condition is rare (low P(A)), even a highly accurate test produces many false positives. P(B|¬A) × (1-P(A)) can dominate the denominator, keeping P(A|B) surprisingly low.
What is the prosecutor's fallacy?
Confusing P(evidence|innocent) with P(innocent|evidence). A 1-in-a-million DNA match doesn't mean 1-in-a-million chance of innocence — it depends on the prior and the size of the suspect pool.
How is Bayes' theorem used in medicine?
Diagnostic tests: given sensitivity P(+|disease), specificity (1 - P(+|healthy)), and prevalence P(disease), Bayes computes P(disease|+). Essential for interpreting mammograms, COVID tests, genetic screening.
What is the difference between prior and posterior?
Prior P(A) is your belief before evidence. Posterior P(A|B) is your updated belief after observing B. Bayes' theorem is the update rule.
What is the likelihood ratio and why does it matter?
LR = P(B|A)/P(B|¬A) measures how much more likely the evidence is under A vs ¬A. LR=10 means evidence is 10× more likely if A is true. Posterior odds = Prior odds × LR.
Can Bayes' theorem be applied iteratively?
Yes. After computing P(A|B₁), use it as the new prior for the next piece of evidence B₂: P(A|B₁,B₂) ∝ P(B₂|A,B₁)P(A|B₁). Each posterior becomes the next prior.
How is Bayesian reasoning used in machine learning?
Naive Bayes classifiers, Bayesian networks, probabilistic graphical models. Modern LLMs use transformer attention that can be interpreted as soft Bayesian inference over context. Spam filters, recommendation systems, and A/B testing all rely on Bayesian updating.
📊 Bayes by the Numbers
📚 Official Sources
⚠️ Disclaimer: This calculator provides accurate Bayesian computations for educational and professional reference. For medical diagnosis, legal proceedings, or critical decision-making, consult qualified experts. Base rates and test characteristics vary by population and context.
Related Calculators
Bertrand's Box Paradox
Interactive Bertrand's Box Paradox simulator. Explore why the probability of the other coin being gold is 2/3, not 1/2, with Monte Carlo simulation and Bayesian proof.
StatisticsConditional Probability Calculator
Compute P(A|B) = P(A∩B)/P(B) with visual probability tables, tree diagrams, and Venn representations. Three input modes: direct, contingency table, from...
StatisticsBoy or Girl Paradox
Interactive Boy or Girl Paradox (Two-Child Problem). Explore why 'the older child is a boy' gives P=1/2 while 'at least one is a boy' gives P=1/3. With Monte Carlo simulation.
StatisticsFalse Positive Paradox Calculator
Understand why a positive test for a rare condition is usually a false positive. Uses Bayes' theorem to compute PPV from sensitivity, specificity, and prevalence. Natural frequency table, charts, and educational content.
StatisticsProbability Calculator
Calculate single event, multiple event, conditional, and complementary probabilities. Supports union, intersection, and Bayes' theorem calculations with visual probability diagrams.
StatisticsMonty Hall Problem Calculator
Interactive Monty Hall Problem simulator. Choose a door, host reveals a goat, switch or stay. Run Monte Carlo simulation to prove switching wins 2/3.
Statistics