Bayesian Inference Calculator
Bayesian Inference Calculator computes posterior probabilities using Bayes’ theorem \( P(H|D) = \frac{P(D|H) \cdot P(H)}{P(D)} \). Enter prior probabilities, likelihoods, and evidence for one or more hypotheses. Results are visualized as a bar chart with p5.js, and computational steps are displayed with MathJax.
Bayesian Inference Calculator
This calculator computes posterior probabilities using Bayes’ theorem \( P(H|D) = \frac{P(D|H) \cdot P(H)}{P(D)} \). Input prior probabilities \( P(H) \), likelihoods \( P(D|H) \), and evidence \( P(D) \) (optional). For multiple hypotheses, enter values as comma-separated lists (e.g., “0.4,0.6”). If evidence is not provided, it is computed as \( P(D) = \sum_i P(D|H_i) \cdot P(H_i) \). Results are visualized as a bar chart using p5.js, and steps are shown with MathJax. Share or embed results as needed.
Example 1: Single Hypothesis
Parameters: \( P(H) = 0.5 \), \( P(D|H) = 0.8 \), \( P(D) = 0.6 \).
Result: Posterior \( P(H|D) = \frac{0.8 \cdot 0.5}{0.6} \approx 0.6667 \).
Example 2: Two Hypotheses
Parameters: \( P(H_1) = 0.4 \), \( P(H_2) = 0.6 \), \( P(D|H_1) = 0.8 \), \( P(D|H_2) = 0.3 \), \( P(D) \) blank.
Step 1: Compute evidence \( P(D) = 0.8 \cdot 0.4 + 0.3 \cdot 0.6 = 0.5 \).
Result: Posteriors \( P(H_1|D) \approx 0.64 \), \( P(H_2|D) \approx 0.36 \).
Example 3: Medical Test
Parameters: \( P(\text{Disease}) = 0.01 \), \( P(\text{Positive|Disease}) = 0.95 \), \( P(\text{Positive|No Disease}) = 0.05 \), \( P(\text{Positive}) \) blank.
Result: Computes posterior probability of disease given a positive test.