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.

A few weights can control the estimate
  1. Normalised weights
    w~i=wi/∑jwj\widetilde w_i=w_i/\sum_jw_j
  2. Concentration diagnostic
    ESSw=1/∑iw~i2\mathrm{ESS}_w=1/\sum_i\widetilde w_i^2
  3. Weighted result
    μ^=∑iw~if(Xi)\widehat\mu=\sum_i\widetilde w_if(X_i)
Reference illustration. Weight ESS is a concentration diagnostic, not a precision guarantee. Self-normalisation has finite-sample ratio bias; repeated runs and target checks still matter.

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.

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 ↗

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?

Back to the Python editor

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?

Choose an answer
Need a hint?
Hint 1

Read the formula 1/sum(w²).

Hint 2

Consider a target region from which you obtained no samples.

Your notes