Advanced sampling and rare eventsLesson 64 of 76 · 9 min

A proposal must reach the answer

Detect support mismatch that more importance samples cannot repair.

A proposal needs positive density wherever the target integrand contributes. If it never samples a relevant region, no weight assigned to the samples it does produce can recover that missing contribution.

The target is uniform on [0,1] and the function is X². Drawing only on [0,.5] misses the entire right half. A uniform density is 1 divided by interval width, so the restricted density is 2. The weighted contribution X²/2 averages towards the integral over only the left half, not the full target expectation 1/3.

The repair draws from [0,.5] with chance .8, otherwise from [0,1]. On the left, the full mixture density is .8×2+.2×1=1.8; on the right it is .2×1=.2. Divide X² by this complete density, including both routes to a left-half draw. Covering the domain is necessary, but very small density in important regions can still cause unstable weights.

1x≤1/2\mathbf1_{x\le1/2} is 1 on the left half and 0 elsewhere. Thus .2+1.6 times this indicator is 1.8 on the left and .2 on the right, within [0,1].

Weights cannot fill a missing region
  1. Restricted proposal
    q(x)=0(x>1/2)q(x)=0\quad(x>1/2)
  2. Missing target contribution
    ∫1/21x2 dx>0\int_{1/2}^1x^2\,dx>0
  3. A full-support mixture
    q(x)=0.2+1.6 1x≤1/2q(x)=0.2+1.6\,\mathbf1_{x\le1/2}
Reference illustration. The target integral is over [0,1]. A restricted proposal estimates only its supported contribution. The corrected mixture density must include both routes to a draw. The displayed density applies on [0,1] and is zero elsewhere.

Can a million samples restricted to the lower half of the domain reveal the upper half’s contribution?

Write a prediction (optional)

Seeded teaching simulation

Select Run Python below with the code unchanged.

Tools
About Python ↗

The code is editable. Press Ctrl+Enter or ⌘+Enter to run Python from the editor.

Published example output

This result comes from the original Python. Your runs appear above. Build environment ↗

Restricted weighted estimate: 0.04147
Full-support mixture estimate: 0.33503
Exact full target: 0.3333333333333333
Mixture sample fraction above .5: 0.1006

Read the first result

The restricted result is precisely estimating the wrong domain contribution. The mixture’s full density accounts for both routes to a draw.

Try an edit

Replace component = rng.random(30000) < .8 with component = rng.random(30000) < .98 and mixture_density = .2 + 1.6*(x <= .5) with mixture_density = .02 + 1.96*(x <= .5). Select Run Python again. Compare Mixture sample fraction above .5 and the gap between Full-support mixture estimate and Exact full target. Run with a second seed by changing default_rng(2063) to default_rng(64) and compare that gap again.

Back to the Python editor

Scope. Full support alone does not guarantee finite variance or adequate overlap in a finite run.

Try a fresh case

In a mixture proposal, which density belongs in the weight?

Choose an answer
Need a hint?
Hint 1

Account for every component capable of generating the point.

Hint 2

Write the proposal as a weighted sum of component densities.

Your notes