Teorema de Bayes
P(A|B) = P(B|A)·P(A) / [P(B|A)·P(A) + P(B|¬A)·P(¬A)].
P(A|B)
—
Bayes' theorem
Bayes' theorem tells you how to revise a belief once new evidence comes in. The formula is P(A|B) = P(B|A) · P(A) / P(B), where P(A) is the prior, P(B|A) the likelihood and P(A|B) the posterior. Take a rapid COVID test that is 95% sensitive and 95% specific, used on a population where prevalence sits at 1%. Get a positive result and the chance you actually have the disease is roughly 16%, not 95%. Because the disease is so rare, most of the positives that show up are false alarms. That result feels wrong to most people, and the gap is exactly what base-rate neglect describes; it is also why low-prevalence screening tends to over-diagnose.
Applications
It shows up in medicine, where the difference between sensitivity and positive predictive value drives screening decisions. Spam filters lean on it through Naive Bayes, the approach Paul Graham popularised in "A Plan for Spam" back in 2002. Forensic analysts use it to read DNA evidence correctly and steer clear of the prosecutor's fallacy. You will also find it under the hood of probabilistic machine learning (Bayesian networks, MCMC), in risk assessment, in A/B testing that starts from priors, and really anywhere a decision has to be made without full information.
FAQ
Why isn't a 95% test 95% accurate? What you get out of the test depends on the prior going in. With a rare disease, even a tiny false-positive rate produces more false positives than true ones, and the positive predictive value falls apart.
How is P(B) computed? You get it from the law of total probability: P(B) = P(B|A)·P(A) + P(B|¬A)·P(¬A). The calculator handles that step for you.
What's the difference from frequentist statistics? For a frequentist, the parameters are fixed and the data is what varies. A Bayesian flips that around: the parameters carry uncertainty and you keep refining them with data through Bayes' theorem.
Related Tools
Rent Adjustment Calculator
Compute annual rent adjustment by IGP-M or IPCA accumulated in the last 12 months (manually configurable).
Pregnancy Calculator
Compute estimated due date (EDD), gestational age and trimester from the last menstrual period (LMP).
Fertile Period Calculator
Compute fertile window and ovulation day from the first day of the last cycle and the average cycle length.