A fundamental idea in Bayesian computation is that most Markov Chain Monte Carlo (MCMC) algorithms do not require the fully normalized posterior distribution.
Instead, they only require the unnormalized posterior density.
Bayes’ theorem defines the posterior distribution as
\[ p(\theta|y) = \frac{p(y|\theta)p(\theta)} {p(y)}, \]
where
The denominator is
\[ p(y) = \int p(y|\theta)p(\theta)d\theta. \]
This is the normalizing constant that makes the posterior integrate to one.
For simple Bayesian models,
\[ p(y) \]
may be calculated analytically.
However, for complex models,
\[ p(y) = \int p(y|\theta)p(\theta)d\theta \]
is usually impossible to calculate.
For example:
Therefore, we usually only know
\[ p(\theta|y) \propto p(y|\theta)p(\theta). \]
The quantity
\[ \tilde p(\theta) = p(y|\theta)p(\theta) \]
is called the unnormalized posterior.
The key idea of MCMC is:
MCMC algorithms only need relative probabilities, not absolute probabilities.
Suppose
\[ p(\theta) = C f(\theta), \]
where \(C\) is an unknown constant.
The distribution has the same shape as
\[ f(\theta). \]
Only the vertical scale changes.
MCMC algorithms are designed so that this constant cancels.
The Metropolis-Hastings acceptance probability is
\[ \alpha = \min \left( 1, \frac{p(\theta^*|y)} {p(\theta|y)} \frac{q(\theta|\theta^*)} {q(\theta^*|\theta)} \right). \]
Using Bayes’ theorem,
\[ p(\theta|y) = \frac{p(y|\theta)p(\theta)} {p(y)}, \]
we obtain
\[ \alpha = \min \left( 1, \frac{ \frac{p(y|\theta^*)p(\theta^*)}{p(y)} } { \frac{p(y|\theta)p(\theta)}{p(y)} } \frac{q(\theta|\theta^*)} {q(\theta^*|\theta)} \right). \]
The marginal likelihood cancels:
\[ \alpha = \min \left( 1, \frac{ p(y|\theta^*)p(\theta^*) } { p(y|\theta)p(\theta) } \frac{q(\theta|\theta^*)} {q(\theta^*|\theta)} \right). \]
Therefore,
Metropolis-Hastings only requires
\[ p(y|\theta)p(\theta), \]
the unnormalized posterior.
Gibbs sampling works by sampling from full conditional distributions.
Suppose the joint posterior is
\[ p(\theta_1,\theta_2|y) \propto f(\theta_1,\theta_2). \]
The conditional distribution is
\[ p(\theta_1|\theta_2,y) = \frac{ f(\theta_1,\theta_2) } { \int f(\theta_1,\theta_2)d\theta_1 }. \]
The unknown global normalizing constant does not appear.
Only the conditional distribution is required.
Hamiltonian Monte Carlo (HMC) also starts from the unnormalized posterior.
The potential energy is defined as
\[ U(\theta) = -\log p(\theta|y). \]
Since
\[ p(\theta|y) \propto p(y|\theta)p(\theta), \]
we can write
\[ U(\theta) = -\log p(y|\theta) -\log p(\theta) +C. \]
The gradient is
\[ \nabla U(\theta) = -\nabla\log p(y|\theta) -\nabla\log p(\theta). \]
The unknown constant disappears because
\[ \nabla C=0. \]
Therefore, HMC does not need the normalized posterior.
The unnormalized posterior gives information about the shape of the distribution.
It tells us:
However, it does not tell us how to efficiently explore the parameter space.
HMC introduces a physical system:
\[ H(\theta,r) = U(\theta)+K(r), \]
where
The particle then moves through the posterior landscape according to Hamiltonian dynamics.
The complete logic is:
\[ \boxed{ \begin{aligned} \text{Unnormalized posterior} &\rightarrow p(y|\theta)p(\theta) \\ &\rightarrow \text{Log posterior} \\ &\rightarrow \text{Potential energy} \\ &\rightarrow \text{Add momentum} \\ &\rightarrow \text{Hamiltonian dynamics} \\ &\rightarrow \text{Leapfrog integration} \\ &\rightarrow \text{Metropolis correction} \\ &\rightarrow \text{Posterior samples} \end{aligned} } \]
Almost all Bayesian MCMC methods do.
| Algorithm | Uses unnormalized posterior? | Reason |
|---|---|---|
| Random Walk Metropolis | Yes | Acceptance ratio cancels constants |
| Metropolis-Hastings | Yes | Ratio of densities |
| Gibbs Sampling | Yes | Conditional distributions |
| Hamiltonian Monte Carlo | Yes | Gradient removes constants |
| No-U-Turn Sampler (NUTS) | Yes | Extension of HMC |
| Slice Sampling | Yes | Uses relative density |
The normalizing constant is required for some Bayesian tasks.
Examples:
Model comparison requires
\[ p(y|M) \]
which is the marginal likelihood.
Some calculations require the absolute posterior density.
Methods such as:
estimate the missing normalizing constant.
The fundamental contribution of MCMC is:
We do not need to calculate the posterior distribution completely. We only need to know the relative shape of the posterior, and MCMC constructs a Markov chain whose long-run distribution is the desired posterior.
In practice:
\[ \boxed{ \text{Posterior sampling} \neq \text{Computing the posterior density} } \]
Instead,
\[ \boxed{ \text{Posterior sampling} = \text{Constructing a chain that has the posterior as its equilibrium distribution} } \]
This is why modern Bayesian computation is possible even for very complex models.