Advanced sampling and rare eventsLesson 67 of 76 · 9 min
When one weight dominates
Use weight concentration as a diagnostic without treating it as a precision guarantee.
Normalise positive importance weights by their total. Their concentration diagnostic, weight effective sample size (ESS), is 1 divided by the sum of squared normalised weights. Four equal weights .25 give ESS=4; one weight 1 and the rest zero give ESS=1. This measures observed weight concentration.
The displayed weighted mean is self-normalised: sum(w×X)/sum(w), or equivalently sum(normalised_weight×X). It is a ratio of random sums, rather than the ordinary importance average from 63. At finite draw counts its expectation can differ from the target; the next lesson explains that bias and its convergence conditions.
Compare shifted normal proposals for the same standard normal target. Large shifts can leave a few observations dominating the estimate. Weight ESS cannot detect every missing region or certify error for every function. A mode is a density peak; an entirely missed peak may leave observed weights looking harmless. Repeat runs and inspect both the target quantity and weights.
- Normalised weights
- Concentration diagnostic
- Weighted result
Does a large weight ESS prove that no important target region was missed?
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 ↗
proposal shift: 0 weight ESS: 20000.0 largest normalised weight: 0.0001 weighted target mean: 0.0015 proposal shift: 2 weight ESS: 919.13 largest normalised weight: 0.0092 weighted target mean: 0.116 proposal shift: 4 weight ESS: 10.31 largest normalised weight: 0.2818 weighted target mean: 0.6805 Known target mean: 0
Read the first result
The displayed weighted mean is self-normalised. Its finite-sample bias and variability remain relevant even if the arithmetic is stable.
Try an edit
Replace for shift in [0, 2, 4]: with for shift in [0, 2, 4, 6]:. Select Run Python again. Read weight ESS, largest normalised weight and weighted target mean for shift 6. Change default_rng(2066) to default_rng(67) and rerun. What do the two runs reveal about the same proposal?
Scope. Weight ESS is a heuristic diagnostic and does not replace support, overlap, moment and target-specific error checks.
Try a fresh case
What does weight ESS mainly summarise in this calculation?
Need a hint?
Hint 1
Read the formula 1/sum(w²).
Hint 2
Consider a target region from which you obtained no samples.