The support condition for importance sampling is missing from the printed assertion. Assume , , and for -almost every . For a proposal , rejection has conditional probability . Its unconditional probability is , so the conditional density of a rejected draw is
Thus the rejected-draw weight is precisely , and
Conditionally on any positive rejection count among independent proposals, the rejected locations have this iid conditional density. Hence
is an unbiased estimator conditionally on , and therefore also conditionally on the event . This is importance sampling from the rejected-proposal distribution.
The nonstrict assumption alone does not suffice: the rejected distribution may completely miss part of the target support. For example, let be uniform on , , , and . All rejected proposals lie in , where , so the displayed estimator is always , whereas . This remains a counterexample after conditioning on . A strict envelope, such as choosing larger than the essential supremum of , repairs the missing support condition. Near-equality can still give high-variance weights, even when it remains an unbiased estimator.
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.
Treat the simulated pairs as samples from the prior . The numerator and denominator of the posterior mean are then ordinary Monte Carlo estimators, so
where the normalized importance sampling weights are
The common Gaussian normalizing constant cancels.
Assume that wherever on the part of the space relevant to . The importance sampling algorithm draws independent and identically distributed random variables from , forms the weights
and returns
A change of measure gives
Hence the estimator is unbiased whenever the expectation exists, and, if , the strong law of large numbers gives almost surely.
One simple algorithm is importance sampling from the prior. Draw independently from and assign weight . Then
estimates the Bayesian model evidence, and the normalized weights represent the posterior. A weighted histogram or kernel density estimation of the estimates the marginal ; discarding performs the marginalization.
Compute the joint evidence by one-dimensional numerical integration,
Equivalently, the individual outputs give
Quadrature or one-dimensional importance sampling evaluates this integral without entering the space.
With normalized densities and envelope , , conditioning a proposal on rejection gives density . It can be used as an importance sampling proposal only if it covers the relevant target support. If on a set of positive target mass, rejected draws never visit that set.
An importance sampling proposal must be positive wherever the target-weighted integrand can contribute. The usual sufficient condition is that the target probability is absolutely continuous with respect to . Otherwise multiplying observed draws by cannot recover a missing part of the integral. A strict rejection envelope supplies this condition for the rejected-proposal distribution.
An unbiased likelihood estimator has expectation equal to the likelihood function at each parameter. A pseudo-marginal algorithm requires this estimator to be nonnegative. Importance sampling provides for independent random variables , provided the proposal covers the target support. Relative variance affects the mixing time even though unbiasedness guarantees the correct marginal target.