From a Prior and Likelihood to a Posterior
Bayes’ formula is often introduced as a ratio of probabilities or densities. At the level of probability kernels, its central role is broader: it constructs a conditional law of an unknown random element given an observed one.
Let \(E\) be the state space of an unknown quantity and \(F\) the observation space. Suppose both are standard Borel spaces, \(\mu\) is a probability measure on \(E\), and \(L\) is a probability kernel from \(E\) to \(F\). The measure \(\mu\) describes the prior law, while \(L(x,\cdot)\) describes the observation law when the unknown value is \(x\).
Together they determine a joint law: first draw a value according to \(\mu\), then draw an observation according to \(L\) at that value. The observation’s marginal law is
A posterior kernel \(\Pi\) is a conditional law of the unknown value given the observation. It is a probability kernel from \(F\) to \(E\), and it satisfies
for every measurable \(A\subseteq E\) and \(B\subseteq F\). This identity says that the joint probability of the unknown lying in \(A\) and the observation lying in \(B\) can be computed by either conditioning on the observation or integrating the likelihood over prior values in \(A\).
The Kernel Form of Bayes’ Formula
The general formula can be expressed using Radon–Nikodym derivatives. For each measurable set \(A\subseteq E\), define a finite measure on \(F\) by
Since \(0\leq \nu_A(B)\leq \nu(B)\), the measure \(\nu_A\) is absolutely continuous with respect to \(\nu\). The posterior probability of \(A\), as a function of the observation, is a version of the derivative \(d\nu_A/d\nu\).
This is the kernel form of Bayes’ formula. It requires no density for the observation law and no pointwise likelihood function. In particular, it applies when the observation distribution is discrete, continuous, or neither.
Worked Example: A Finite Discrete Model
Worked Example: A Finite Discrete Model
Let \(E=\{a,b,c\}\) and \(F=\{0,1\}\). Assign prior probabilities \(\mu(\{a\})=0.5\), \(\mu(\{b\})=0.3\), and \(\mu(\{c\})=0.2\). Suppose the likelihood of observing \(1\) at the three possible values is \(0.8\), \(0.4\), and \(0.1\), respectively. The likelihood of observing \(0\) is the complement in each case, so each likelihood is a probability distribution.
The probability of observing \(1\) is
Because this observation has positive probability, the posterior probabilities are the prior-weighted likelihoods divided by \(0.54\):
These numbers sum to one, since \(20/27+6/27+1/27=1\). The posterior favors \(a\), whose likelihood for the observed outcome is greatest, while still reflecting the prior weights.
Density-Based Bayes’ Formula
A familiar ratio formula follows when the likelihood kernel has a density with respect to a common reference measure. Let \(\lambda\) be a \(\sigma\)-finite measure on \(F\). Suppose there is a jointly measurable function \(\ell:E\times F\to[0,\infty]\) such that, for every \(x\in E\) and measurable \(B\subseteq F\),
The function \(\ell(x,y)\) is the likelihood density at observation \(y\) for parameter value \(x\). Integrating it against the prior gives the marginal density, also called the evidence:
To verify the posterior identity, let \(A\subseteq E\) and \(B\subseteq F\) be measurable. The exceptional observations do not affect integration with respect to \(\nu\). On the remaining set, the denominator \(m(y)\) cancels the marginal density:
This is Bayes’ formula in density form. The numerator combines the prior and the likelihood restricted to \(A\); the denominator normalizes the result to a probability measure.
Worked Example: Gaussian Prior and Gaussian Observation
Worked Example: Gaussian Prior and Gaussian Observation
Let the unknown value \(X\) have prior law \(N(0,\tau^2)\), where \(\tau^2>0\). Given \(X=x\), suppose \(Y\) has law \(N(x,\sigma^2)\), where \(\sigma^2>0\). With Lebesgue measure as reference, the prior density is proportional to \(\exp(-x^2/(2\tau^2))\), and the likelihood density at \(y\) is proportional to \(\exp(-(y-x)^2/(2\sigma^2))\). As a function of \(x\), their product has exponent
Collecting the terms involving \(x\) and completing the square yields
The last term does not depend on \(x\), so it contributes only to the normalizing constant. The coefficient of the squared term is the reciprocal of \(\tau^2\sigma^2/(\tau^2+\sigma^2)\). Therefore the posterior is
The posterior mean is a weighted version of the observation: it is closer to zero when prior uncertainty is small, and closer to \(y\) when observation noise is small.
Worked Example: An Observation with an Atom and a Density
Worked Example: An Observation with an Atom and a Density
Let \(E=[0,1]\) and let the prior be uniform on this interval. Let the observation space be the disjoint union of a single symbol \(c\) and the positive real line. Given \(x\), the observation equals \(c\) with probability \(x\); otherwise it has density \((1-x)e^{-y}\) for \(y>0\). This is a valid likelihood kernel because
Use the reference measure that assigns mass one to \(c\) and agrees with Lebesgue measure on \((0,\infty)\). The likelihood density relative to this measure is \(x\) at \(c\) and \((1-x)e^{-y}\) at \(y>0\).
At the atom, the evidence is \(\int_0^1x\,dx=1/2\). Thus the posterior density of \(x\) given \(Y=c\) is
For a continuous observation \(y>0\), the evidence density is
Consequently, for every \(y>0\), the posterior density is
Indeed, \(2x\) and \(2(1-x)\) each integrate to one on \([0,1]\). The atom and the continuous part have different likelihoods, so their posterior laws differ. Treating the entire observation as if it had an ordinary Lebesgue density would miss the mass at \(c\).
Versions, Null Observations, and Interpretation
A conditional law is determined only almost surely under the observation law \(\nu\). If a particular observation has probability zero, the posterior value assigned at that observation is not fixed by the defining integral identity. In the density formula, observations with zero evidence are exactly of this kind: they have zero probability under the marginal law. The formula should therefore be read as an almost-everywhere statement, not as a claim that the data determine a unique posterior at every conceivable observation.
A second important distinction is between the general kernel formula and the density ratio. The Radon–Nikodym statement applies to arbitrary likelihood kernels. The ratio involving \(\ell(x,y)\) requires a common reference measure and a jointly measurable likelihood density. When such a density exists, the ratio is a convenient explicit version; when it does not, the kernel formulation remains valid.
Bayes’ formula is useful because it keeps the modeling steps separate. The prior describes uncertainty before observing data; the likelihood specifies how data arise at each possible state; and the posterior is the conditional law induced by those two ingredients. The observation law also matters: it identifies which observations occur with positive probability and hence where the posterior is determined up to null sets.
Check Your Understanding
Use the definitions and calculations above to answer these questions.
- How is the observation marginal \(\nu\) obtained from a prior \(\mu\) and likelihood kernel \(L\)?
- Why is the measure \(\nu_A\) absolutely continuous with respect to \(\nu\), and what does its Radon–Nikodym derivative represent?
- In the density formula, why can observations with zero evidence be assigned an arbitrary posterior probability measure?
- For the finite example, what is the posterior probability of \(b\) after observing \(1\), and how is it calculated?
- Why does the mixed observation example require a reference measure that includes both an atom and Lebesgue measure?