| Scenario | Inputs | Expected outputs (approx.) |
|---|---|---|
| Single hypothesis | P(H)=0.30, P(E|H)=0.80, P(E|¬H)=0.20 | P(E)=0.38, P(H|E)=0.631579 |
| Diagnostic test | Prev=0.01, Sens=0.99, Spec=0.95 | PPV≈0.166667, NPV≈0.999894 |
| Multiple hypotheses | H1:(0.5,0.2), H2:(0.3,0.6), H3:(0.2,0.1) | Posteriors≈[0.333333, 0.600000, 0.066667] |
| Beta–Binomial | α=2, β=2, n=10, k=8, θ₀=0.5 | Mean≈0.714286, CI≈[0.461868,0.909080], P(θ>0.5)≈0.953857 |
- P(H|E) = P(E|H)·P(H) / P(E)
- P(E) = P(E|H)·P(H) + P(E|¬H)·(1−P(H)) (two-hypothesis evidence)
- Posterior odds = Prior odds × Bayes factor, where BF=P(E|H)/P(E|¬H)
- Diagnostic test: PPV=P(D|T+) and NPV=P(¬D|T−) from total probability.
- Discrete hypotheses: P(Hi|E)=P(Hi)·P(E|Hi)/Σ P(Hj)·P(E|Hj)
- Beta–Binomial: Beta(α,β) + Binomial(k|n) ⇒ Beta(α+k, β+n−k)
- Select a model that matches your problem.
- Enter probabilities as decimals between 0 and 1.
- For “Single hypothesis”, choose direct or automatic evidence.
- Click Compute to see results above this form.
- Use the export buttons to download CSV or PDF.
1) What does the posterior mean?
It is your updated probability after seeing evidence. It combines your prior belief with how strongly the evidence favors each hypothesis.
2) When should I use direct evidence P(E)?
Use it when you already know the overall chance of the evidence, independent of hypotheses. Otherwise, compute evidence from alternative likelihoods.
3) Why do priors get normalized in the multi-hypothesis model?
Posteriors require priors to sum to 1. Normalization keeps ratios intact while ensuring a valid probability distribution.
4) What is a Bayes factor?
It measures how much the evidence shifts odds. A Bayes factor greater than 1 favors the hypothesis; less than 1 favors the alternative.
5) How do PPV and NPV relate to base rates?
Even accurate tests can have low PPV when prevalence is low. Base rates strongly influence post-test probabilities.
6) What is the Beta–Binomial model used for?
It updates uncertainty about an unknown probability, like conversion or defect rate, using success/failure counts and a Beta prior.
7) Are credible intervals the same as confidence intervals?
No. A credible interval directly describes probability about the parameter given your prior and data. Confidence intervals describe repeated-sampling behavior.
8) Why do I sometimes see “Not defined” for MAP?
For Beta posteriors with α≤1 or β≤1, the mode can lie on the boundary. In that case, a single interior MAP value is not defined.