🎲 Bayesian Posterior Probability
Update a posterior probability from a prior and a likelihood using Bayes theorem. Applies to medical screening, spam filtering and any belief-updating task.
📐 計算公式 / 原理
P(B) = 先驗 × 敏感度 + (1 − 先驗) × (1 − 特異度);後驗 P(A|B) = 先驗 × 敏感度 / P(B);NPV = (1 − 先驗) × 特異度 / [(1 − 先驗) × 特異度 + 先驗 × (1 − 敏感度)]
貝葉斯定理在檢測場景的直接應用:即便試劑敏感度、特異度都很高,若疾病先驗極低,陽性預測值仍可能很小(假陽性佔多數)——這是"篩查陽性≠患病"的數學根據,也是高危人群篩查才有意義的理由。
📐 計算公式與說明
P(A|B) = P(B|A)·P(A) / P(B)
P(B) = P(B|A)P(A) + P(B|¬A)P(¬A)
P(B) = P(B|A)P(A) + P(B|¬A)P(¬A)
即使靈敏度和特異度都很高,低先驗也會使後驗較低。