Bayesian inference

Intermediate

What you need first. Nothing else on this path comes first. This page is part of Bayesian statistics.

In Bayesian statistics, Bayesian inference is the derivation of a probability distribution for unknowns from a joint model and the observed data. Bayesian inference is the step that takes a joint probability model for data and unknowns and returns a probability distribution for the unknowns once the data are known. The distribution covers parameters and any observations that have not yet been seen. Gelman and coauthors open with that description: fit a probability model, then summarise the result by a probability distribution on the parameters and on unobserved quantities.[1]

Bayesian inference

Bayesian inference
Fact Value
Topic Bayesian statistics
Listed on Bayesian statistics
Worked example 1

Motivating example

A woman has an affected brother, so her mother carries an X-linked hemophilia gene, and an unaffected father, so before any information about her own children she is a carrier with probability 1/21/2 and a non-carrier with probability 1/21/2. She then has two sons, neither affected. Each son would have had probability 1/21/2 of being affected if she were a carrier, and probability essentially 11 of being unaffected if she were not. The mutation rate is small enough, in this example, to ignore. The inference is the probability, after those two sons, that she is a carrier.[1]

Definition

Let θ\theta denote the unknowns and yy the observed data. A joint distribution is required first,

p(θ,y)=p(θ) p(y∣θ),p(\theta,y)=p(\theta)\,p(y\mid\theta),

with p(θ)p(\theta) the prior distribution and p(y∣θ)p(y\mid\theta) the sampling distribution. Conditioning on the observed data gives the posterior

p(θ∣y)=p(θ) p(y∣θ)p(y),p(\theta\mid y)=\frac{p(\theta)\,p(y\mid\theta)}{p(y)},

wherever the marginal p(y)=∫p(θ) p(y∣θ) dθp(y)=\int p(\theta)\,p(y\mid\theta)\,d\theta is positive and finite. A discrete unknown replaces the integral by a sum. Dropping the factor p(y)p(y), which does not depend on θ\theta, leaves the unnormalised posterior p(θ∣y)∝p(θ) p(y∣θ)p(\theta\mid y)\propto p(\theta)\,p(y\mid\theta). The data enter this product only through the likelihood, the sampling distribution read as a function of θ\theta at the observed yy.[1]

The same conditioning produces a distribution for a new observation y~\tilde y. The posterior predictive distribution averages the sampling distribution of y~\tilde y over the posterior of θ\theta, when yy and y~\tilde y are conditionally independent given θ\theta. Dodge writes the same step for a new observation xn+1x_{n+1}: its density given the data is the sampling density averaged against the posterior of the parameter.[1][2]

Properties

Posterior odds between two values θ1\theta_1 and θ2\theta_2 equal prior odds times the likelihood ratio p(y∣θ1)/p(y∣θ2)p(y\mid\theta_1)/p(y\mid\theta_2). Gelman and coauthors record the identity as equation (1.5). The marginal p(y)p(y) cancels, so the comparison of two point values does not need the normalising integral.[1]

If a new observation arrives, the current posterior may be used as the prior for that observation. The result matches the posterior that would have been obtained by conditioning on the combined sample in one step. Gelman and coauthors call this the ease of a sequential analysis: the previous posterior is the new prior.[1]

On the carrier example the arithmetic is small enough to see both forms. The likelihood of two unaffected sons is 0.250.25 if she is a carrier and 11 if she is not. The prior probabilities are 1/21/2 and 1/21/2. The unnormalised posterior weights are 0.25×0.5=0.1250.25\times 0.5=0.125 and 1×0.5=0.51\times 0.5=0.5. Their sum is 0.6250.625, and

Pr⁡(carrier∣y)=0.1250.625=0.2=15.\Pr(\text{carrier}\mid y)=\frac{0.125}{0.625}=0.2=\frac15.

The prior odds are 11, the likelihood ratio is 0.250.25, and the posterior odds are 0.250.25, which converts back by 0.25/(1+0.25)=0.20.25/(1+0.25)=0.2.[1]

Statistical use

The input is a Bayesian model: an explicit prior and a sampling distribution. The output used in a report is a posterior probability for a set of parameter values, a posterior mean or another posterior point summary, a Bayesian credible interval, or a posterior predictive distribution. Within one chosen model, the data affect these summaries only through the likelihood function. Checking whether that model is adequate is a later part of Bayesian statistics. Gelman and coauthors separate that check from the conditioning step: the three-step outline is to write the joint model, condition on the data, and then evaluate the fit.[1]

Dodge lists the same practical products once the posterior density is in hand: a point summary such as the mean under squared error, a region that holds a stated posterior probability, and a test of a hypothesis about the parameter, tied to a loss function. The region that holds posterior probability α\alpha is what replaces, in that account, the confidence interval of the sampling theory.[2]

Worked example

The carrier probability starts at 1/21/2. The likelihood of two unaffected sons is 1/41/4 if she is a carrier and 11 if she is not. The unnormalised posterior weights are

14⋅12=18,1⋅12=12.\tfrac14\cdot\tfrac12=\tfrac18, \qquad 1\cdot\tfrac12=\tfrac12.

Their sum is 5/85/8, so the posterior probability that she is a carrier is (1/8)/(5/8)=1/5(1/8)/(5/8)=1/5. That is the same number as 0.125/0.625=0.20.125/0.625=0.2.[1]

Your turn. A third son is also unaffected. Using the posterior above as the new prior, what is the probability that she is a carrier?

The new unnormalised weights are (1/2)⋅(1/5)=1/10(1/2)\cdot(1/5)=1/10 for the carrier and 1⋅(4/5)=4/51\cdot(4/5)=4/5 for the non-carrier. The probability is (1/10)/(1/10+4/5)=1/9(1/10)/(1/10+4/5)=1/9.

Common misconceptions

The likelihood at a parameter value is the probability of the observed data given that value. A posterior probability is the probability of the parameter value given the data, after the prior has reweighted every value and the weights have been made to sum to one. A posterior probability for a parameter is also a different object from the long-run error rate of a procedure. A Bayesian interval is read as a probability that the unknown lies in the interval. A confidence interval, as Gelman and coauthors contrast it, is read in relation to a sequence of similar inferences in repeated practice.[1]

The identities assume a joint distribution in which the prior does not depend on the data and the marginal probability of the observed sample is positive and finite. The likelihood principle, that the data enter only through p(y∣θ)p(y\mid\theta), is a fact inside the model that was chosen. It does not say that the model is adequate. The third step of the analysis is the check of that model.[1]

Connections

The arithmetic identity is Bayes’ rule. The probability attached to a set of unknowns after conditioning is a posterior probability. The proportionality p(θ∣y)∝p(θ) p(y∣θ)p(\theta\mid y)\propto p(\theta)\,p(y\mid\theta) is the kernel of a density in the parameter, and p(y)p(y) is its normalizing constant. The historical name for reading probability from the data back to the unknown is inverse probability. The joint specification that the conditioning step takes as given is a Bayesian model.[1][2]

Check yourself

Try these questions before opening an answer.

The factor that cancels

In the posterior odds between two parameter values, which factor from Bayes’ theorem does not need to be computed?

The marginal probability of the data, because it is the same for both values and cancels.

A further observation

When a new observation arrives, what may be used as its prior so that the result matches conditioning on the combined sample?

The posterior from the observations already in hand.

History

The first published analysis of this form is Bayes’s 1763 solution for an unknown binomial probability. Laplace developed the same reversal for counts. Dodge dates the inferential tradition that includes this reversal to,[3] de Moivre (1718),,[4] and.[5] The calculation above, updating a carrier probability from the sons’ affection status, is the same conditioning step applied to a two-point unknown, as set out by Gelman and coauthors.[1][2]

See also

Line chart · Apriori algorithm · Asymptotic analysis · Average treatment effect · Base rate · Bayesian model · Bayesian probability · Bayesian statistics

Glossary and index

References

  1. ^ a b c d e f g h i j k l m a. (p. 1) b. (p. 9, §1.4) c. (pp. 6–7) d. (p. 7) e. (p. 8, (1.5)) f. (p. 9) g. (p. 9) h. (pp. 3, 7, §1.1) i. (p. 9) j. (p. 3) k. (pp. 3, 7, §1.1) l. (pp. 6–7) m. (p. 9) Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A. & Rubin, D. B. (2013). Bayesian Data Analysis. Chapman and Hall/CRC. https://doi.org/10.1201/b16018
  2. ^ a b c d a. (p. 33) b. (pp. 33–34) c. (p. 33) d. (pp. 32, 263) Dodge, Yadolah (2008). The Concise Encyclopedia of Statistics. Springer. https://doi.org/10.1007/978-0-387-32833-1
  3. ^ Bayes, T. (1763). An essay towards solving a problem in the doctrine of chances. By the late Rev. Mr. Bayes, F. R. S. communicated by Mr. Price, in a letter to John Canton, A. M. F. R. S. Philosophical Transactions of the Royal Society of London, 370–418. https://doi.org/10.1098/rstl.1763.0053
  4. ^ Gauss, C. F. (1809). Theoria motus corporum coelestium in sectionibus conicis solem ambientium. Perthes und Besser, Hamburg. https://archive.org/details/bub_gb_ORUOAAAAQAAJ
  5. ^ Laplace, P.-S. (1812). Théorie analytique des probabilités. Courcier, Paris. https://openlibrary.org/works/OL2395821W
Cite this page
Plain text
StatWiki (2026). "Bayesian inference." StatWiki. Last updated 2 December 2026. https://www.statwiki.io/articles/bayesian-inference.html
BibTeX
@misc{statwiki_bayesian_inference,
  author = {{StatWiki}},
  title = {{Bayesian inference}},
  year = {2026},
  url = {https://www.statwiki.io/articles/bayesian-inference.html},
  urldate = {2026-12-02},
  note = {StatWiki, last updated 2 December 2026}
}