The target (teal) is an unnormalised mixture γ(x) = 2 [0.4 N(−2, 0.7²) + 0.6 N(1.5, 1²)], so Z = 2 and the mean of π = γ/Z is 0.1. Draw N points from a proposal q (gold), weight each by γ(x)/q(x), normalise the weights, and estimate E[x] by Σn Wn xn (pink stems show the weights of one run). The effective sample size 1/ΣWn² says how many equal-weight draws the run is worth. The lower panel repeats the whole estimate many times: a good proposal gives a narrow spread around 0.1; a proposal that misses a mode or has light tails gives a wild one.
The exact effective-sample-size fraction Z²/Eq[w²], the asymptotic standard error of the estimate and its first-order bias are computed by numerical integration on a fine grid; the "repeated" values come from 500 independent runs of N draws. A Gaussian proposal with s < 0.707 has infinite weight variance for this target.
code/ch11_monte_carlo.py (snis, ess, log_target_mix, Figure 11.9).