Summary
Bayes’ rule conditions a declared probability model on observed evidence. For hypothesis or parameter , multiply its prior weight by its evidence likelihood, then normalize:
The evidence normalizer must be positive and finite. For discrete hypotheses, sum their weighted likelihoods; continuous parameters require an integral under the declared measure. Posterior probabilities, a posterior mode, and a chosen action are different outputs.
The classic example
Consider a hypothetical test with sensitivity and specificity . Assume prevalence and random sampling from that population; these are teaching assumptions, not measured clinical evidence. In people, expected branch counts are diseased and healthy. The branches contribute and positive results respectively, so the positive-result population has members.
Learning objective
Only 99 of 1,098 positive results come from the diseased group
Derivation
If disease prevalence rises, which input cohort changes before the test acts?
The healthy posterior is ; together the two posterior masses sum to one.
The four pieces
| Piece | Name | Role |
|---|---|---|
| Prior | Weight before this observation | |
| Likelihood | Evidence model at a candidate parameter | |
| Posterior | Normalized conditional distribution | |
| Evidence | Sum or integral of prior-weighted likelihoods |
The evidence is constant across parameters within one model, so maximizing an unnormalized posterior can locate its mode. It cannot be discarded when reporting posterior probabilities or comparing model evidence. A constant prior density can preserve an MLE maximizer in that parameterization, when the posterior and maximizer exist. This is a prior assumption, not an absence of assumptions.
Change the Requirement
Change the Population
New task: Increase prevalence to one percent while keeping sensitivity and specificity unchanged.
Picture and change: Begin with diseased and healthy people.
Check: Both branches contribute positives; posterior disease probability becomes .
Use when: Screening and referral populations have different base rates and the transported test properties remain justified.
Observe Another Positive
New task: Add a second positive result, conditionally independent of the first given disease status.
Picture and change: Multiply each branch by its second-result likelihood.
Check: Original-population expected double-positive counts are and , giving .
Use when: The observation supplies genuinely new conditional evidence. Copying the same test report is perfectly dependent evidence and leaves the original posterior unchanged.
Conjugate priors
A conjugate prior produces a posterior in the same family, with parameters updated from the observations.
| Likelihood | Conjugate prior | Posterior family |
|---|---|---|
| Bernoulli/binomial | Beta | Beta |
| Categorical/multinomial | Dirichlet | Dirichlet |
| Gaussian (mean, known ) | Gaussian | Gaussian |
| Gaussian precision, known mean | Gamma | Gamma |
| Poisson | Gamma | Gamma |
Used in: Thompson sampling for bandits (Beta-Bernoulli), online recsys updates, conjugate Gibbs samplers.
Approximate inference (when conjugacy fails)
When closed-form conditioning is unavailable, distinguish the approximation from the desired posterior:
- Laplace: approximate a suitable interior mode with a Gaussian using local curvature.
- Variational inference: optimize within a chosen distribution family; the family and divergence affect the approximation.
- MCMC: construct a target-invariant chain; convergence and Monte Carlo uncertainty still require diagnosis.
- Stochastic-gradient samplers: introduce data subsampling and step-size/approximation considerations.
Common pitfalls
- Reversed conditioning. A likelihood does not need to normalize over parameters.
- Prior sensitivity. Weak evidence can leave substantial sensitivity to the prior; small sample size alone does not prove prior dominance.
- Mode-only reporting. A mode omits uncertainty and can change under reparameterization.
- Improper priors. An unnormalized prior can produce either a proper or improper posterior; check the integral.
Reconstruct
Why cannot two copies of one positive report be treated as independent tests?
Once the first report is known, its exact copy is certain under either disease status. The copy supplies likelihood ratio one, not another factor of ninety-nine.