Importance weights
Drawing the free quantities of a model in an ancestral order, each from a proposal, and weighing the draw by the ratio of the model's density to the proposals', gives an unbiased estimate of every integral against the unnormalized conditional law, provided each ratio is of densities against one reference measure.
A model built forward can be sampled by drawing its quantities in the order they were built. Once some of its quantities are observed, or it carries likelihood factors, or a quantity is drawn from something other than its own kernel, the draw is no longer from the law that is wanted. It is from a law that differs from it by a known factor, the importance weight. This note defines the weight, proves what it estimates, and states the two conditions that are easy to break.
Proposals and ancestral draws#
Let a model have quantities with conditional densities against reference measures , likelihood factors , and parameters with scores , and let its quantities be split into the observed ones, , held at given values, and the free ones, . Write
for the product of everything the model states. By Proposition 9 and Proposition 10, the law of the free quantities given the observations has, when the model has no parameters, a density proportional to against the product of the free quantities’ reference measures, and with parameters is the unnormalized measure of (11).
A proposal for a free quantity is a conditional density against the quantity’s own reference measure , from which the quantity can be drawn. A quantity’s own kernel is a proposal for it, with , and is called exact. A parameter has no kernel, so its proposal is always something else. Drawing the free quantities in an ancestral order, each from its proposal given the quantities drawn or fixed before it, is an ancestral draw. Its weight is
Each free quantity drawn from its own kernel cancels, , so with exact proposals throughout the weight is what remains: the densities of the observed quantities at their values, the likelihood factors, and the scores,
the likelihood of everything that was not generated, at the point that was.
Let the quantities of a model built forward be free and observed, with the product of the free quantities’ reference measures and the product of every kernel’s density, every likelihood factor and every score. Suppose that every free quantity has a proposal, of density with respect to the quantity’s reference measure, and that the product of the proposals is positive wherever is. If is drawn ancestrally from the proposals, then for every with ,
When the model has neither parameters nor likelihood factors, the right side is times the marginal density of at . In general it is whenever is finite and positive, with the measure of density .
An ancestral draw has the density with respect to , since each free quantity is drawn given quantities drawn or fixed before it. Then wherever , which covers the set where , and
Without parameters or likelihood factors, is the joint density, which is the conditional density of Proposition 9 times the marginal density of the observations. When is finite and positive, is a probability measure, and the integral is .
∎What a weighted draw is for#
The statement gives and not : the weight turns the proposal’s law into the target only up to the constant . That is all an algorithm needs, and often what it wants.
- With , the mean weight of independent draws is an unbiased estimate of itself, which without parameters or likelihood factors is the marginal density of the observations, the model’s evidence.
- A self-normalized estimate over draws estimates , with cancelling between its numerator and its denominator. It is consistent and not unbiased.
- A Metropolis–Hastings ratio, a gradient of , and a resampling step in a particle filter are each unchanged when every weight is multiplied by the same number.
A constant that does not depend on the free quantities may therefore be dropped from the weight, and with it from every density it is made of, when all that is wanted is the law. It may not be dropped when the evidence is.
The two conditions#
Positivity. The proposals must be positive wherever the target is: a region the proposals never reach contributes nothing to any estimate, however much of the target lies there. It is a property of the proposals that no computation on draws can check.
One reference measure for each ratio. The weight is a ratio of densities, and the ratio means something only when numerator and denominator are densities against the same measure. A density of a continuous quantity against Lebesgue measure and a mass function of a discrete one against counting measure mix freely in a product, since each quantity’s ratio is formed on its own. What breaks the condition is a density written in a chart. If is the density of with respect to Lebesgue measure on , the density of with respect to Lebesgue measure on carries the Jacobian of the chart,
and a proposal written as against a target written as gives weights wrong by at every draw. The general form of this correction is the volume of a chart: a density of a point drawn through a chart is the density of its tangent coordinate less the chart’s log-volume (Proposition 4), and a weight on a curved space is right when the target’s densities and the proposals’ both keep to it.
Built on by
- Terms and the probabilistic graph A model's density is a sum of terms, each a log-density that scores one quantity or none; the terms and quantities together make the probabilistic graph inference reads, and a retirement removes some quantities, replaces their terms, and frees what it leaves needed by nothing.