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.
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].
- Restricted proposal
- Missing target contribution
- A full-support mixture
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.
A saved draft is open. To run the published example, open Tools and select Restore example. Recover draft brings your code back.
Execution error
Technical error details
Your result
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.
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?
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.