PROBABILITYProbability TheoryStatistics Calculator
๐Ÿ“Š

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.

Concept Fundamentals
P(A|B)ยทP(B)/P(A)
Bayes' Rule
Posterior probability
P(A) โ€” initial belief
Prior
Before evidence
P(B|A)
Likelihood
Evidence given hypothesis
Updated belief
Posterior
After evidence
Calculate PosteriorPrior, Likelihood, Evidence โ€” Step-by-Step Bayesian Reasoning

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
๐Ÿ“
BAYESIAN INFERENCEPrior, Likelihood, Evidence โ€” Step-by-Step

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

e.g., disease prevalence
e.g., sensitivity
e.g., 1 - specificity
bayes.sh
CALCULATED
P(A|B) โ€” Posterior
16.10%
Prior P(A)
1.00%
Posterior P(A|B)
16.10%
P(B)
5.9000%
Likelihood Ratio
19.0000
Prior Odds
0.0101
Posterior Odds
0.1919
Bayes Factor
19.0000
Share:
Bayesian Inference
P(A|B) โ€” Posterior Probability
16.10%
Prior: 1.0%โ†’Posterior: 16.1%LR: 19.00
numbervibe.com/calculators/statistics/bayes-theorem-calculator

Prior vs Posterior

Posterior Probability

๐ŸŒณ Probability Tree

Start
A: 1.0%
โ†’ B|A: 95.0% = 0.95%
โ†’ ยฌB|A: 5.0% = 0.05%
ยฌA: 99.0%
โ†’ B|ยฌA: 5.0% = 4.95%
โ†’ ยฌB|ยฌA: 95.0% = 94.05%
P(B) = P(B|A)P(A) + P(B|ยฌA)P(ยฌA) = 0.0095 + 0.0495 = 5.9000%

๐Ÿ“Š 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.

1. Prior P(A)
P(A)=0.0100P(A) = 0.0100
2. Likelihood P(B|A)
P(BโˆฃA)=0.9500P(B|A) = 0.9500
3. Evidence P(B)
P(B)=P(BโˆฃA)P(A)+P(BโˆฃยฌA)P(ยฌA)=0.009500+0.049500=0.059000P(B) = P(B|A)P(A) + P(B|ยฌA)P(ยฌA) = 0.009500 + 0.049500 = 0.059000
4. Bayes' Theorem
P(AโˆฃB)=P(BโˆฃA)ร—P(A)P(B)=0.0095000.059000P(A|B) = \frac{P(B|A) \times P(A)}{P(B)} = \frac{0.009500}{0.059000}
5. Posterior
P(AโˆฃB)=0.1610(16.10P(A|B) = 0.1610 (16.10%)

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

๐Ÿ›๏ธRev. Thomas Bayes (1702-1761) never published his theorem โ€” his friend Richard Price found it in his papers after his death
โš–๏ธThe prosecutor's fallacy (confusing P(evidence|innocent) with P(innocent|evidence)) has contributed to wrongful convictions worldwide
๐Ÿค–All modern spam filters, recommendation engines, and language models use Bayesian reasoning at their core
๐Ÿ“ŠDuring WWII, Alan Turing used Bayesian methods to break the Enigma code, estimating the probability of rotor settings
๐Ÿงฌ23andMe and other genetic testing services use Bayes' theorem to calculate your probability of having specific genetic traits
๐ŸฅA positive mammogram with 80% sensitivity and 1% prevalence only means ~7.5% chance of actual cancer โ€” base rate matters!
๐Ÿ”Nate Silver's election models (FiveThirtyEight) are fundamentally Bayesian, continuously updating predictions with new polling data

๐Ÿ“– 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

FeatureThis CalculatorProbability CalculatorWolfram AlphaRManual
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

1763
Bayes' Paper Published
7.5%
True + from 80% Test, 1% Disease
10โถ
Spam Emails Filtered Daily
Pโ‰ P
P(A|B) โ‰  P(B|A)

โš ๏ธ 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.

๐Ÿ‘ˆ START HERE
โฌ…๏ธJump in and explore the concept!
AI

Related Calculators