Adjust prior probability, true positive rate, and false positive rate to calculate posterior probability in real time. Intuitively understand probability updating from evidence in medical testing, quality control, and machine learning.
Parameters
P(A|B) Posterior probability (positive predictive value)
75.0%
Results
P(B) Positive test rate
—
Bayes Factor K
—
Specificity 1-P(B|¬A)
—
Negative predictive value P(¬A|¬B)
—
Probability Tree
Prior to posterior
Population Grid
Tree
Probability tree. Line thickness represents probability magnitude.
Prior
How posterior probability P(A|B) changes as prior probability P(A) changes.
Population
Virtual population of 1000 people. Blue = true positive, orange = false positive, gray = negative.
💬 Conversation about Bayes' Theorem
🙋
Bayes' theorem sounds difficult, but what is it in simple terms?
🎓
It is a formula for calculating how much an original expectation (prior probability) should be updated after new evidence is observed. A physician revising a diagnosis after a test result, or a spam filter updating spam probability from new email features, are both Bayesian ways of thinking.
🙋
In the "rare disease test" preset, even with a prevalence of 1% and sensitivity of 99%, the positive predictive value is only about 50%. That's puzzling.
🎓
That is the base-rate fallacy. In a population of 1000 people with 1% prevalence, a test with 99% sensitivity and 95% specificity finds about 9.9 true positives among 10 patients, but also about 49.5 false positives among 990 healthy people. Of the 59.4 positives, only 9.9 are true positives, about 17%. Even with high sensitivity, positive predictive value stays low when the prior probability is low.
🙋
I heard Bayes' theorem can be used repeatedly. What does that mean?
This is Bayesian updating. The posterior probability from the first test can be used as the prior probability for the second test. Repeating the same test increases confidence. The same principle appears in online learning in machine learning, where parameter probability distributions are updated as data are added one by one.
🙋
Is it also used in CAE and simulation?
🎓
It is used in uncertainty quantification (UQ). For example, when a material elastic modulus is not known exactly, engineers set a prior distribution, compare it with experimental measurements, and update the parameter distribution through Bayesian estimation. This ultimately quantifies confidence intervals for simulation outputs. It is an important approach in digital twins and model verification and validation (V&V).
Frequently Asked Questions
If the prior probability is set to 0% or 100%, the posterior probability will not change regardless of the presence or absence of evidence (test results). Also, if the true positive rate and false positive rate are the same, the evidence has no discriminatory power, so the posterior probability matches the prior probability. Please return the slider to an intermediate value and try again.
Because the prevalence (prior probability) is as low as 1%, the absolute number of false positives (healthy individuals incorrectly identified as positive) exceeds that of true positives. Specifically, out of 1000 people, about 10 of the 10 patients are true positives, and about 10 of the 990 healthy people are false positives, resulting in a positive predictive value of approximately 50%.
You can simulate sequential Bayesian updates by manually setting the posterior probability calculated in one step as the prior probability on the slider for the next step. For example, by setting the positive predictive value obtained from the first test as the prior probability and then inputting the result of a second test, you can experience the effect of accumulating evidence.
In CAE, 'Bayesian calibration' is performed to probabilistically correct the parameters of a simulation model using experimental data. The flow of 'prior probability → evidence → posterior probability' learned with this tool is precisely the process of updating the uncertainty of design parameters based on experimental results.
What is Bayes Theorem Visualizer?
Bayes Theorem Visualizer is a fundamental topic in engineering and applied physics. This interactive simulator lets you explore the key behaviors and relationships by directly manipulating parameters and observing real-time results.
By combining numerical computation with visual feedback, the simulator bridges the gap between abstract theory and physical intuition — making it an effective learning tool for students and a rapid-verification tool for practicing engineers.
Physical Model & Key Equations
The simulator is based on the governing equations behind Bayes' Theorem Visualizer. Understanding these equations is key to interpreting the results correctly.
Each parameter in the equations corresponds to a slider in the control panel. Moving a slider changes the equation's solution in real time, helping you build a direct connection between mathematical expressions and physical behavior.
Real-World Applications
Engineering Design: The concepts behind Bayes' Theorem Visualizer are applied across mechanical, structural, electrical, and fluid engineering disciplines. This tool provides a quick way to estimate design parameters and sensitivity before committing to full CAE analysis.
Education & Research: Widely used in engineering curricula to connect theory with numerical computation. Also serves as a first-pass validation tool in research settings.
CAE Workflow Integration: Before running finite element (FEM) or computational fluid dynamics (CFD) simulations, engineers use simplified models like this to establish physical scale, identify dominant parameters, and define realistic boundary conditions.
Common Misconceptions and Points of Caution
Model assumptions: The mathematical model used here relies on simplifying assumptions such as linearity, homogeneity, and isotropy. Always verify that your real system satisfies these assumptions before applying results directly to design decisions.
Units and scale: Many calculation errors arise from unit conversion mistakes or order-of-magnitude errors. Pay close attention to the units shown next to each parameter input.
Validating results: Always sanity-check simulator output against physical intuition or hand calculations. If a result seems unexpected, review your input parameters or verify with an independent method.