{
    "name": "Bayesian Posterior Probability Calculator",
    "url": "https://calculators.geekmidst.com/calculators/bayesian-posterior-probability-calculator",
    "markdown": "https://calculators.geekmidst.com/calculators/bayesian-posterior-probability-calculator.md",
    "category": "Statistics & probability",
    "description": "Update a prior probability with new evidence using Bayes’ theorem: enter P(H), P(E | H) and P(E | not H) to get P(H | E), P(E) and the likelihood ratio.",
    "summary": "Bayes’ theorem turns a starting belief and the reliability of a piece of evidence into an updated probability. It explains why a positive result from a good test can still mean a low chance when the condition is rare.",
    "also_called": [
        "Bayes’ theorem calculator",
        "Bayes rule calculator"
    ],
    "applies_to": "Worldwide",
    "last_updated": "2026-10-29",
    "computation": "Results are computed in the visitor’s browser on the HTML page. This API describes the calculator; it does not compute results.",
    "inputs": [
        {
            "name": "prior",
            "label": "Prior probability P(H)",
            "type": "number",
            "default": "1",
            "unit": "%"
        },
        {
            "name": "p_e_h",
            "label": "P(evidence | H true)",
            "type": "number",
            "default": "80",
            "unit": "%"
        },
        {
            "name": "p_e_not_h",
            "label": "P(evidence | H false)",
            "type": "number",
            "default": "9.6",
            "unit": "%"
        }
    ],
    "outputs": [
        {
            "key": "posterior",
            "label": "Posterior P(H | evidence)",
            "format": "percent"
        },
        {
            "key": "p_evidence",
            "label": "Overall chance of the evidence P(E)",
            "format": "percent"
        },
        {
            "key": "posterior_not_e",
            "label": "P(H | evidence not seen)",
            "format": "percent"
        },
        {
            "key": "likelihood_ratio",
            "label": "Likelihood ratio P(E | H) ÷ P(E | not H)",
            "format": "text"
        },
        {
            "key": "prior_odds",
            "label": "Prior odds",
            "format": "text"
        },
        {
            "key": "posterior_odds",
            "label": "Posterior odds",
            "format": "text"
        }
    ],
    "formula": {
        "text": "P(H | E) = P(E | H)·P(H) ÷ P(E), where P(E) = P(E | H)·P(H) + P(E | ¬H)·(1 − P(H));  posterior odds = prior odds × likelihood ratio",
        "variables": {
            "P(H)": "prior probability of the hypothesis",
            "P(E | H)": "chance of the evidence if H is true",
            "P(E | ¬H)": "chance of the evidence if H is false",
            "P(H | E)": "posterior probability"
        }
    },
    "worked_example": {
        "inputs": {
            "prior": "1",
            "p_e_h": "80",
            "p_e_not_h": "9.6"
        },
        "steps": [
            "P(E) = 0.80 × 0.01 + 0.096 × 0.99 = 0.008 + 0.09504 = 0.10304.",
            "P(H | E) = 0.008 ÷ 0.10304 = 0.07764, about 7.8%.",
            "If the test is negative: P(H | not E) = 0.20 × 0.01 ÷ 0.89696 = 0.22%."
        ],
        "result": "With a 1% base rate, a test with 80% sensitivity and a 9.6% false positive rate gives only a 7.8% chance of the condition after a positive result."
    },
    "interpretation": "The posterior depends heavily on the prior. When the hypothesis starts out rare, most positive evidence comes from false positives, so the posterior stays low even for a fairly accurate test. A likelihood ratio above 1 means the evidence supports H; how far it moves you depends on where you started.",
    "assumptions": [
        "There are two mutually exclusive possibilities: H is true or it is false.",
        "The probabilities you enter apply to the situation at hand (for a test, to people like the one tested)."
    ],
    "limitations": [
        "For more than two competing hypotheses, or repeated pieces of evidence that are not independent, the calculation needs to be extended.",
        "This is a probability calculation, not a diagnosis."
    ],
    "rules": null,
    "faqs": [
        {
            "question": "Why is the posterior so low when the test is 80% accurate?",
            "answer": "Because 99% of people tested do not have the condition, and 9.6% of them test positive. That is about 95 false positives per 1,000 people versus 8 true positives."
        },
        {
            "question": "Can I chain results?",
            "answer": "Yes. Use the posterior from one independent piece of evidence as the prior for the next."
        }
    ],
    "sources": [],
    "related": [
        {
            "name": "Bayes Factor Calculator",
            "url": "https://calculators.geekmidst.com/calculators/bayes-factor-calculator"
        },
        {
            "name": "Probability Calculator",
            "url": "https://calculators.geekmidst.com/calculators/probability-calculator"
        },
        {
            "name": "Binomial Probability Calculator",
            "url": "https://calculators.geekmidst.com/calculators/binomial-probability-calculator"
        },
        {
            "name": "Conditional Probability Calculator",
            "url": "https://calculators.geekmidst.com/calculators/conditional-probability-calculator"
        }
    ],
    "disclaimer": null,
    "publisher": "GM¹X CalcVerse"
}