Pseudo-marginal Metropolis–Hastings algorithm explained

In computational statistics, the pseudo-marginal Metropolis–Hastings algorithm[1] is a Monte Carlo method to sample from a probability distribution. It is an instance of the popular Metropolis–Hastings algorithm that extends its use to cases where the target density is not available analytically. It relies on the fact that the Metropolis–Hastings algorithm can still sample from the correct target distribution if the target density in the acceptance ratio is replaced by an estimate. It is especially popular in Bayesian statistics, where it is applied if the likelihood function is not tractable (see example below).

Algorithm description

\pi(\theta)

. The algorithm follows the same steps as the standard Metropolis–Hastings algorithm except that the evaluation of the target density is replaced by a non-negative and unbiased estimate. For comparison, the main steps of a Metropolis–Hastings algorithm are outlined below.

Metropolis–Hastings algorithm

See also: Metropolis–Hastings algorithm.

Given a current state

\thetan

the Metropolis–Hastings algorithm proposes a new state according to some density

\theta'\simQ(\mid\thetan)

. The algorithm then sets

\thetan+1=\theta'

with probability

a(\thetan,\theta')=min\left(1,

\pi(\theta')
\pi(\thetan)
Q(\thetan\mid\theta')
Q(\theta'\mid\thetan)

\right)

otherwise the old state is kept, that is,

\thetan+1=\thetan

.

Pseudo-marginal Metropolis–Hastings algorithm

If the density

\pi

is not available analytically the above algorithm cannot be employed. The pseudo-marginal Metropolis–Hastings algorithm in contrast only assumes the existence of an unbiased estimator

\hat{\pi}\theta

, i.e. the estimator must satisfy the equation

E[\hat{\pi}\theta]=\pi(\theta).

Now, given

\thetan

and the respective estimate
\hat{\pi}
\thetan
the algorithm proposes a new state according to some density

\theta'\simQ(\mid\thetan)

. Next, compute an estimate

\hat{\pi}\theta'

and set

\thetan+1=\theta'

with probability

a(\thetan,\theta')=min\left(1,

\hat{\pi
\theta'
} \frac\right)

otherwise the old state is kept, that is,

\thetan+1=\thetan

.

Application to Bayesian statistics

In Bayesian statistics the target of inference is the posterior distribution

p(\theta\midy)=

p\theta(y)p(\theta)
p(y)

,

where

p\theta

denotes the likelihood function,

p

is the prior and

p(y)

is the prior predictive distribution.Since there is often no analytic expression of this quantity, one often relies on Monte Carlo methods to sample from the distribution instead. Monte Carlo methods often need the likelihood

p\theta(y)

to be accessible for every parameter value

\theta

. In some cases, however, the likelihood does not have an analytic expression. An example of such a case is outlined below.

Example: Latent variable model

Consider a model consisting of i.i.d. latent real-valued random variables

Z1,\ldots,Zn

with

Zi\simf\theta()

and suppose one can only observe these variables through some additional noise

Yi\midZi=z\simg\theta(\midz)

for some conditional density

g

. (This could be due to measurement error, for instance.) We are interested in Bayesian analysis of this model based on some observed data

y1,\ldots,yn

. Therefore, we introduce some prior distribution

p(\theta)

on the parameter. In order to compute the posterior distribution

p(\theta\midy1,\ldots,yn)\proptop\theta(y1,\ldots,yn)p(\theta)

we need to find the likelihood function

p\theta(y1,\ldots,yn)

. The likelihood contribution of any observed data point

y

is then

p\theta(y)=\intg\theta(y\midz)f\theta(z)dz

and the joint likelihood of the observed data

y1,\ldots,yn

is

p\theta(y1,\ldots,yn)=

n
\prod
i=1

p\theta(yi)=

n
\prod
i=1

\intg\theta(yi\midzi)f\theta(zi)dzi.

If the integral on the right-hand side is not analytically available, importance sampling can be used to estimate the likelihood. Introduce an auxiliary distribution

q

such that

g\theta(y\midz)f\theta(z)>0q(z)>0

for all

z

then

\hat{p}\theta(y

i)=1
N
N
\sum
k=1
g\theta(yi\midZk)f\theta(Zk)
q(Zk)

,    Zk\overset{i.i.d.}{\sim}q()

is an unbiased estimator of

p\theta(yi)

and the joint likelihood can be estimated unbiasedly by

\hat{p}\theta(y1,\ldots,yn)=

n
\prod
i=1

\hat{p}\theta(yi)=

n
\prod
i=1
1
N
N
\sum
k=1
g\theta(yi\midZi,k)f\theta(Zi,k)
q(Zi,k)

,    Zi,k\overset{i.i.d.}{\sim}q().

Extensions

Pseudo-marginal Metropolis-Hastings can be seen as a special case of so-called particle marginal Metropolis-Hastings algorithms. In the case of the latter, unbiased estimators of densities relating to static parameters in state-space models may be obtained using a particle filter. While the algorithm enables inference on both the joint space of static parameters and latent variables, when interest is only in the static parameters the algorithm is equivalent to a pseudo-marginal algorithm.[2]

Notes and References

  1. Andrieu. Christophe. Roberts. Gareth O.. The pseudo-marginal approach for efficient Monte Carlo computations. Annals of Statistics. 2009. 37. 2. 697–725. 10.1214/07-aos574. 0903.5480. Project Euclid. free.
  2. 10.1111/j.1467-9868.2009.00736.x . Particle Markov chain Monte Carlo methods . 2010 . Andrieu . Christophe . Doucet . Arnaud . Holenstein . Roman . Journal of the Royal Statistical Society, Series B (Statistical Methodology) . 72 . 3 . 269–342 . 13962777 . free .