= Bayesian posterior
{c}
{title2=$p(\theta\mid d)=p(d\mid\theta)\pi(\theta)/m(d)$}
{wiki=Posterior_probability}
= Posterior distribution
{synonym}
= Posterior
{synonym}
The <Bayesian posterior> is the <conditional probability> distribution of an unknown <statistical parameter> after observing data. Suppose a continuous <prior distribution> has <prior density> $\pi(\theta)$ relative to <Lebesgue measure> $d\theta$, and $p(d\mid\theta)$ is the sampling <probability mass function> or <probability density function> of the observed data $d$ in the <statistical model>. <Bayes' theorem> gives
$$
p(\theta\mid d)=\frac{p(d\mid\theta)\pi(\theta)}{m(d)},\qquad
m(d)=\int p(d\mid t)\pi(t)\,dt,\qquad 0<m(d)<\infty.
$$
The <Bayesian model evidence> $m(d)$ is the <normalization constant> making the <posterior density> integrate to one. The strict positive, finite condition is essential: a zero or infinite normalizer does not define this <posterior distribution>, even if the unnormalized expression can be written down. Other reference measures give the corresponding density formula; discrete parameter values replace the integral by a sum. The <posterior propriety> article gives examples where normalization fails.
With $d$ fixed, $L(\theta;d)=p(d\mid\theta)$ is a <likelihood function> of $\theta$. Its normalization as a sampling distribution is over possible data, not over parameter values. In particular, a <likelihood function> is not a <probability density function> for $\Theta$ and need not integrate to one over $\theta$. The <prior density> supplies the probability weighting, and the <Bayesian model evidence> normalizes their product. This distinction prevents a tempting mistake: reversing the conditioning merely by exchanging the words “data” and “parameter”.
For eight heads among ten conditionally independent <Bernoulli trials>, take the observed data to be the heads count $D=8$. Its <binomial distribution> <likelihood function> and the $\operatorname{Beta}(2,2)$ <prior density> give
$$
L(\theta;8)=\binom{10}{8}\theta^8(1-\theta)^2=45\theta^8(1-\theta)^2,\qquad
L(\theta;8)\pi(\theta)=270\theta^9(1-\theta)^3.
$$
Using the <Euler beta function> $B(10,4)=1/2860$, the <Bayesian model evidence> and normalized <posterior density> are
$$
m(8)=270B(10,4)=\frac{27}{286},\qquad
p(\theta\mid D=8)=2860\theta^9(1-\theta)^3,\quad 0<\theta<1.
$$
Thus the <posterior distribution> is $\operatorname{Beta}(10,4)$. If the data are instead one particular ordered sequence with eight heads and two tails, its <likelihood function> omits the factor 45 and its <Bayesian model evidence> becomes $3/1430$. The factor cancels in <Bayes' theorem>, leaving the same <posterior distribution>; these two data descriptions have different sampling probabilities but identical information about $\theta$ here.
\Image[/bayesian-prior-likelihood-posterior.png]
{title=Beta(2,2) prior, peak-normalized Bernoulli likelihood, and Beta(10,4) posterior after eight heads and two tails}
The <prior density> and <posterior density> use the left axis and each integrate to one. The dashed <likelihood function> uses the right axis and is divided by its maximum solely to compare its shape; it is not a parameter <probability density function>. The <likelihood function> peaks at $8/10$, while the <posterior mode> is $9/12=3/4$ and the <posterior mean> is $5/7$. Multiplying by the <prior density> shifts the preferred values toward one half while preserving a range of possibilities.
The resulting <posterior variance> is $10\cdot4/(14^2\cdot15)=2/147\approx0.0136054$, compared with <prior> <variance> $1/20$. In this example the update reduces uncertainty. The <posterior predictive probability> of heads on the next conditionally independent toss is $\mathbb E[\Theta\mid D=8]=5/7$, and the <credible interval> above reports a 95% range. These are summaries of the same <posterior distribution>, rather than competing estimates of one density peak.
Back to article page