What is Bayesian Inference?

Bayesian inference is a statistical framework that updates beliefs in light of new evidence.

Unlike classical (frequentist) statistics, Bayesian methods treat parameters as random variables with probability distributions.

In Medical AI, Bayesian inference is used to:

  • Diagnose diseases given test results
  • Update risk estimates as new patient data arrives
  • Quantify uncertainty in AI model predictions
  • Power probabilistic diagnostic tools and clinical decision support systems

Bayes’ Theorem

The foundation of Bayesian inference is Bayes’ Theorem:

\[P(\theta \mid D) = \frac{P(D \mid \theta) \cdot P(\theta)}{P(D)}\]

Where:

  • \(P(\theta)\) = Prior: belief about parameter \(\theta\) before seeing data
  • \(P(D \mid \theta)\) = Likelihood: probability of data \(D\) given \(\theta\)
  • \(P(D)\) = Marginal likelihood (normalizing constant)
  • \(P(\theta \mid D)\) = Posterior: updated belief after observing data

“Yesterday’s posterior is today’s prior.”

Medical Diagnosis Example

Suppose a patient tests positive for a rare disease. Should we be alarmed?

Let:

  • \(P(\text{Disease}) = 0.01\) — prevalence (prior)
  • \(P(+ \mid \text{Disease}) = 0.95\) — sensitivity
  • \(P(+ \mid \text{No Disease}) = 0.05\) — false positive rate

By Bayes’ Theorem:

\[P(\text{Disease} \mid +) = \frac{0.95 \times 0.01}{0.95 \times 0.01 + 0.05 \times 0.99} \approx 0.161\]

Despite a positive test, there is only a ~16% chance the patient actually has the disease!

Prior, Likelihood & Posterior — Visualized

Effect of Disease Prevalence on Diagnosis

Bayesian Updating — Sequential Learning

As more patient tests arrive, the posterior updates iteratively:

\[P(\theta \mid D_1, D_2, \ldots, D_n) \propto P(\theta) \prod_{i=1}^{n} P(D_i \mid \theta)\]

This is especially powerful in Medical AI pipelines where:

  • Each new lab result refines a patient’s risk score
  • Wearable device data continuously updates disease probability
  • Hospital AI systems adapt to new patient populations over time

The Beta-Binomial model is a classic conjugate example:

\[\theta \sim \text{Beta}(\alpha, \beta) \quad \Rightarrow \quad \theta \mid \text{data} \sim \text{Beta}(\alpha + \text{successes},\ \beta + \text{failures})\]

R Code: Simulating Bayesian Updates

# Simulate sequential Bayesian updating
# Prior: Beta(2, 20) — low prior disease probability
alpha0 <- 2; beta0 <- 20

# Observed test results: 1 = positive, 0 = negative
results <- c(1, 1, 0, 1, 1, 1)

alpha <- alpha0
beta  <- beta0
for (r in results) {
  alpha <- alpha + r
  beta  <- beta  + (1 - r)
  cat(sprintf("After result %d: Beta(%d, %d), Mean = %.3f\n",
              r, alpha, beta, alpha / (alpha + beta)))
}

3D Visualization: Posterior Surface

Applications in Medical AI

Bayesian inference is actively used in modern medical AI systems:

Application Bayesian Role
Cancer screening AI Update malignancy probability with imaging + biomarkers
Sepsis early warning Sequential risk updates from vitals streams
Drug dosing systems Pharmacokinetic model parameter estimation
Diagnostic chatbots Symptom-driven posterior probability updates
Clinical trial design Adaptive trials that update enrollment criteria

Bayesian methods are favored in medicine because they naturally quantify uncertainty — critical when decisions affect human lives.

Assumptions & Limitations

For Bayesian inference to work well:

  1. Prior choice matters — a poorly chosen prior can dominate results, especially with small datasets
  2. Conjugate priors simplify computation but may not reflect true beliefs
  3. Computational cost — complex models require MCMC sampling (e.g., Stan, BUGS)
  4. Interpretability — posteriors are richer than p-values but harder to communicate to clinicians

The posterior concentrates around the truth as \(n \to \infty\):

\[P(\theta \mid D_1, \ldots, D_n) \xrightarrow{n \to \infty} \delta(\theta^*)\]

where \(\theta^*\) is the true parameter value — Bayesian and frequentist methods converge with enough data.

Summary

  • Bayes’ Theorem provides a principled way to update disease probability with new evidence
  • The prior encodes existing medical knowledge; the posterior reflects updated belief
  • Even a highly accurate test can yield low PPV when disease prevalence is low
  • Bayesian methods power modern Medical AI by quantifying uncertainty at every step
  • Sequential updating makes Bayesian inference ideal for real-time clinical decision support

Bayesian inference doesn’t just give an answer — it gives a distribution of answers, which is exactly what medicine needs.