Bayesian Inference

Statistics
Introduced by
Thomas Bayes; Pierre-Simon Laplace
Year
1763
Type
Probabilistic inference paradigm

What does it do?

Bayesian inference is a statistical paradigm in which probability represents degrees of belief rather than long-run frequencies.

It encodes prior knowledge about parameters in a prior distribution, combines that prior with the likelihood of observed data via Bayes' theorem, and produces a posterior distribution that quantifies updated uncertainty. The foundational theorem was published posthumously by Thomas Bayes in 1763 and was subsequently developed by Pierre-Simon Laplace in his 1812 Théorie analytique des probabilités.

The intuition behind the method

Suppose you want to estimate an unknown quantity, such as the efficacy of a new drug. Before seeing any new data you may already have some expectation based on earlier studies, and Bayesian inference expresses that expectation as a probability distribution. As patient data arrive, the distribution is updated by Bayes' theorem: observations consistent with high efficacy shift probability toward higher values, and discordant observations shift it away. The result is not a single point estimate but a full distribution over plausible values, from which you can read the most probable value, uncertainty intervals, and direct probability statements about the parameter, such as the probability that the effect exceeds a threshold of interest.

History

The foundational result appeared in Thomas Bayes' posthumous 1763 paper communicated by Richard Price to the Royal Society, establishing the inverse probability rule for inferring the parameter of a Bernoulli process. Pierre-Simon Laplace independently rediscovered and vastly extended the framework in his 1812 Théorie analytique des probabilités, developing what is now recognized as the general form of Bayes' theorem and applying it to problems in celestial mechanics, demography, and jurisprudence. The approach fell out of mainstream favor through much of the twentieth century as frequentist methods associated with Fisher, Neyman, and Pearson became dominant. A revival began with Harold Jeffreys' 1939 Theory of Probability and accelerated in the 1980s and 1990s when computational advances made posterior computation feasible for complex models. These advances included sampling-based methods such as the Gibbs sampler, popularized in statistics by Gelfand and Smith (1990), and the broader MCMC toolkit. The publication of Gelman et al.'s Bayesian Data Analysis (first edition 1995, third edition 2013) provided a comprehensive applied treatment that anchored modern Bayesian practice. Today Bayesian inference is a mainstream and increasingly dominant alternative to frequentist statistics across biomedical research, cognitive science, econometrics, and machine learning.

When to use it

Bayesian inference is appropriate when prior information exists and should be incorporated explicitly, when uncertainty about parameters must be carried through to predictions rather than summarized by a single p-value, or when the data have hierarchical or multilevel structure. It is also a natural choice for sequential analyses, where new data update an existing posterior without restarting the analysis. It is less suitable when a prior cannot be justified and the analysis must be insensitive to that choice, when a simple frequentist estimate is adequate and no prior information is available, or when there is no capacity to run and check the computational procedures needed for the posterior. The distributional model, including its likelihood family, must be stated explicitly and checked with posterior predictive simulations.

Limitations and considerations

  • Results depend on the prior distribution; poorly chosen or unjustified priors can dominate inference, particularly with small samples.
  • Computing the posterior is analytically intractable for most realistic models and requires MCMC, variational inference, or other approximation methods, which can be computationally expensive.
  • Diagnosing MCMC convergence (R-hat, effective sample size, trace plots) and validating the model requires expertise and adds workflow overhead.
  • Communicating probabilistic results and credible intervals to non-statistical audiences can be more challenging than reporting a p-value.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Produces a full posterior distribution over parameters, enabling direct probability statements and complete uncertainty quantification rather than binary accept/reject decisions.
  • Incorporates prior knowledge formally, which is especially valuable in small samples, rare events, or settings where earlier experiments have been conducted.
  • Handles hierarchical and multilevel models naturally, shrinking estimates toward group-level means in a principled way.
  • Supports sequential updating: the posterior from one study becomes the prior for the next, making cumulative evidence synthesis straightforward.
  • Prediction is based on the posterior predictive distribution, which averages over parameter uncertainty rather than conditioning on a single point estimate.

Applications

  • Clinical trial analysis and adaptive trial designs, where information from earlier phases can inform current estimates and sequential updating is natural.
  • Hierarchical modeling of nested data such as students within schools or patients within hospitals, where partial pooling shrinks group estimates toward a shared population distribution.
  • Epidemiological estimation of disease prevalence, incidence, and reproduction numbers from surveillance data with known reporting limitations.
  • Psychometric and cognitive modeling, where individual-level parameters are drawn from a population distribution estimated jointly with the data.
  • Machine learning and probabilistic graphical models, including Bayesian neural networks, Gaussian processes, and latent Dirichlet allocation for topic modeling.
  • Physical and astronomical parameter estimation, where the posterior over model parameters is the primary inferential target.

How it works

How it works

1

The analysis begins by specifying a prior distribution p(θ) over the unknown parameter or parameter vector θ. The prior captures existing knowledge or, in weakly informative settings, expresses broad uncertainty without strongly constraining the inference. Prior choice, whether informative, weakly informative, or non-informative, is a modeling decision that should be documented and checked with prior predictive simulations.

Formula
p(\theta) \quad \text{(prior distribution over parameters)}
2

The likelihood function p(y | θ) quantifies how probable the observed data y are for each candidate value of θ, given the assumed data-generating model. This component is shared with frequentist maximum-likelihood estimation; the Bayesian distinction lies in what is done with it.

Formula
p(y \mid \theta) \quad \text{(likelihood of observed data given parameters)}
3

Bayes' theorem combines the prior and the likelihood to form the posterior distribution p(θ | y), which is proportional to the product of the likelihood and the prior. The denominator p(y), the marginal likelihood, is a normalizing constant that ensures the posterior integrates to one. In conjugate models it is available in closed form; in most applied settings the posterior is approximated numerically, and the normalizing constant is usually not needed.

Formula
p(\theta \mid y) = \frac{p(y \mid \theta)\, p(\theta)}{p(y)} \propto p(y \mid \theta)\, p(\theta)
4

The marginal likelihood p(y) integrates the likelihood over all parameter values, weighted by the prior. It is analytically tractable mainly for conjugate families (for example, Beta–Binomial or Normal–Normal). For complex models it is rarely computed directly: MCMC samples from the posterior without evaluating p(y), while variational inference and Laplace approximation provide approximations to the posterior itself. Although it is not needed for posterior sampling, p(y) plays an important role in model selection. Comparing the marginal likelihoods of candidate models yields Bayesian evidence, and the ratio of two such values is the Bayes factor.

Formula
p(y) = \int p(y \mid \theta)\, p(\theta)\, d\theta
5

The posterior distribution is summarized through its mean or median as a point estimate, its variance as a measure of remaining uncertainty, and a Highest Density Interval (HDI) or credible interval as the Bayesian analogue of a confidence interval. Unlike a frequentist confidence interval, the 95% credible interval carries the direct interpretation that there is a 95% posterior probability that θ lies within it.

Formula
\text{E}[\theta \mid y],\quad \text{Var}[\theta \mid y],\quad \text{HDI}_{95\%}(\theta \mid y)

Common pitfalls

  • Using a diffuse or flat prior without checking whether it is genuinely non-informative on the scale of the parameter — flat priors on transformed scales can be strongly informative on the natural scale.
  • Failing to run prior predictive checks, which can reveal that the chosen prior implies implausible data before any observations are made.
  • Interpreting a posterior mean or MAP estimate as if it were a frequentist point estimate and discarding the rest of the distribution.
  • Running MCMC chains without checking convergence diagnostics (R-hat < 1.01, bulk and tail ESS) and mistaking a non-converged chain for a valid posterior.
  • Conflating the 95% credible interval with a 95% confidence interval; only the credible interval carries the direct probability statement about the parameter.

Frequently asked questions

How does a Bayesian credible interval differ from a frequentist confidence interval?

A 95% Bayesian credible interval contains the parameter with 95% posterior probability, which is a direct probability statement about the parameter itself. A 95% frequentist confidence interval means that 95% of intervals constructed by the same procedure across repeated samples would contain the true parameter; the parameter is fixed and the interval is random. The two intervals can be numerically similar, but their interpretations are fundamentally different.

Does Bayesian inference require a large sample to work?

No, this is one of its advantages in small-sample settings. Frequentist results such as the Central Limit Theorem justify normal approximations for estimators only as sample size grows. Bayesian inference yields a posterior for any sample size, given the specified model; with little data the posterior simply reflects more uncertainty. Informative priors are especially valuable here, because they can keep the posterior away from implausible parameter values when data are scarce.

What is the difference between an informative and a non-informative prior?

An informative prior concentrates probability on a range of parameter values consistent with previous knowledge or domain expertise. A non-informative (or weakly informative) prior tries to let the data dominate by spreading probability broadly. Fully flat priors are often improper (they do not integrate to one) and can yield improper posteriors, and a prior that looks flat on one parameter scale can be strongly informative on another. Weakly informative priors that gently regularize estimates are commonly preferred in applied work.

When should I use MCMC versus an analytical solution?

Analytical posterior solutions exist only for conjugate prior–likelihood pairs; for example, a Beta prior with a Binomial likelihood yields a Beta posterior. For most applied models, including regression, hierarchical models, and mixture models, the posterior has no closed form and must be approximated. MCMC methods such as Metropolis–Hastings or Hamiltonian Monte Carlo produce draws from the posterior that become accurate as the number of samples grows and the chains converge; variational inference is faster but approximate. Use MCMC unless computation time is prohibitive, and check convergence diagnostics before interpreting the results.

Related methods

Sources

  1. Bayes, T. (1763). An essay towards solving a problem in the doctrine of chances. Philosophical Transactions of the Royal Society of London, 53, 370–418.

    Open publication reference
  2. Laplace, P.-S. (1812). Théorie analytique des probabilités. Courcier, Paris.

    Open publication reference
  3. Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian Data Analysis (3rd ed.). Chapman & Hall/CRC.

    ISBN: 978-1439840955