Let and . With conditional independence of the binary observations given the latent function, define
The prior distribution is specified on the precision , not on . Its Jacobian determinant gives
and the marginal posterior density is proportional to . Working instead with precision or logarithmic coordinates is possible, provided all corresponding Jacobian determinants are included.
Choose an importance sampling density covering the support of , draw independently from it, and use the nonnegative unbiased likelihood estimator
Each summand integrates to , proving unbiasedness. A simple always-valid choice is the latent Gaussian prior distribution, , when the covariance matrix is nonsingular. Then the estimator is just the average of the bounded values . For duplicate inputs, sample only the distinct latent values and multiply all likelihood contributions at each common input. A Gaussian approximation to the latent posterior distribution, or its mixture with the Gaussian prior distribution, can reduce relative variance while keeping complete support. Its approximation does not replace the exact weights.
The pseudo-marginal Metropolis–Hastings algorithm stores both the current and its estimator randomness ; write their sampling law as . Propose , independently generate , compute , and accept the pair with
Here denotes the proposal probability density function from to . On rejection retain both the old parameter and the old likelihood estimate. Initialize with a positive estimate. One must not independently refresh the denominator after rejection.
Correctness follows from the extended posterior density
The pair proposal is . Its Metropolis–Hastings acceptance probability simplifies to the displayed ratio, since the auxiliary densities cancel. Hence detailed balance holds for . Integrating over gives by unbiasedness, so the parameter marginal distribution is exactly the intended posterior distribution for any fixed positive . This is exactness of the stationary target, not independent exact samples or a guarantee of rapid convergence. Large relative variance of the likelihood estimates can produce long holding times, so marginalizing does not by itself guarantee an improvement in mixing time.
A pseudo-marginal Metropolis–Hastings algorithm replaces an intractable likelihood function by a nonnegative unbiased likelihood estimator and includes its auxiliary randomness in the state. If for , the extended target is proportional to . An independence proposal for new auxiliary randomness cancels the factors in the Metropolis–Hastings acceptance probability. On rejection the old estimate must be retained. Integrating the extended target gives the desired marginal posterior distribution exactly.