Probability & Bayesian Inference • Interactive Calculator

Bayes’ Theorem Calculator

Calculate posterior probability P(A|B), Bayes factors, and multi-hypothesis updates using the law of total probability — with natural frequencies, worked examples, plain-English interpretation, and an APA 7 write-up.

Load example:

Bayes’ Theorem Formulas & Evidence Scale

Standard (2-event) form:

P(A | B) = [ P(B | A) · P(A) ] / [ P(B | A)·P(A) + P(B | ¬A)·P(¬A) ]

General (multiple-hypothesis) form: For mutually exclusive and exhaustive hypotheses H₁, H₂, …, Hₖ:

P(Hᵢ | E) = [ P(E | Hᵢ) · P(Hᵢ) ] / Σj [ P(E | Hj) · P(Hj) ]

Jeffreys’ Bayes Factor (BF₁₀) Interpretation Scale

BF₁₀Strength of EvidenceMeaning
> 100ExtremeDecisive evidence for A over ¬A
30 – 100Very strongVery strong support for A
10 – 30StrongStrong support for A
3 – 10ModerateSubstantial evidence for A
1 – 3AnecdotalWeak / inconclusive evidence
1NoneEvidence does not change prior odds
< 1Against AInvert (BF₀₁ = 1 / BF₁₀) to read support for ¬A

Worked Examples with Interpretation & APA Write-Up

Example 1 — The Base-Rate Fallacy (Rare Disease Screening)

A rare condition has a prevalence of 1% (P(A) = .01). A screening test has 95% sensitivity (P(B|A) = .95) and a 5% false-positive rate (P(B|¬A) = .05, i.e. 95% specificity).

APA 7 write-up

A Bayesian analysis was conducted to update the probability of the rare condition given a positive screening test. Using a prior probability of P(A) = .010, a conditional likelihood of P(B|A) = .950, and a false-positive rate of P(B|¬A) = .050, the marginal probability of the evidence was P(B) = .059. Observing a positive screening test increased the posterior probability of the rare condition to P(A|B) = .161 (16.10%), with a Bayes factor of BF10 = 19.00 (strong evidence in favor of the rare condition); given the absence of a positive screening test, the posterior probability was P(A|¬B) = .001 (0.05%).

Example 2 — Multiple Hypotheses (Factory Quality Control)

Three machines produce microchips: Machine A makes 50% (defect rate 2%), Machine B makes 30% (defect rate 3%), and Machine C makes 20% (defect rate 5%). A randomly chosen chip is defective. Which machine most likely made it?

Common mistake: Confusing P(B|A) with P(A|B) (the prosecutor’s fallacy or confusion of the inverse). Knowing a test is 95% sensitive P(+|Disease) does not mean a positive patient has a 95% chance of having the disease P(Disease|+).

More Statistics & Probability Tools