Skip to content

Reweighting and Error Bars

Reweighting estimates a new expectation from configurations sampled under a reference distribution. It is useful when the two ensembles overlap well. Its uncertainty depends on correlated fluctuations of a numerator and denominator, so treating them as independent estimates can give a badly wrong error bar.

Required background. Monte Carlo basics defines importance sampling; autocorrelation analysis determines appropriate blocking.

Suppose the target is proportional to q(x)w(x)q(x)w(x) and samples come from normalized qq. For nonnegative weights with finite nonzero expectation,

μ=Eq[wA]Eq[w],μ^=∑iwiAi∑iwi.\mu=\frac{\mathbb E_q[wA]}{\mathbb E_q[w]}, \qquad \widehat\mu=\frac{\sum_iw_iA_i}{\sum_iw_i}.

Unknown common weight normalization cancels. At finite NN, the ratio is generally biased; under regularity and finite-moment conditions, the leading bias is typically O(N−1)O(N^{-1}). Consistency requires enough overlap and an appropriate law of large numbers.

To avoid overflow, subtract a common maximum log weight before exponentiating. This preserves the ratio exactly in exact arithmetic, but cannot restore configurations that were never sampled.

Let Y=wAY=wA and W=wW=w. Linearizing the ratio around its true means gives

μ^−μ≈Yˉ−μWˉEqW.\widehat\mu-\mu \approx\frac{\bar Y-\mu\bar W}{\mathbb E_qW}.

For independent draws, its leading variance is

Var⁡(μ^)≈Var⁡q[w(A−μ)]N(Eqw)2.\operatorname{Var}(\widehat\mu) \approx \frac{\operatorname{Var}_q[w(A-\mu)]} {N(\mathbb E_qw)^2}.

The covariance is already included in this expression. For a chain, sum autocovariances of the combined fluctuation w(A−μ)w(A-\mu), or use blocks long enough for that fluctuation. The autocorrelation time of AA alone may be irrelevant when rare large weights dominate.

Sample states zero and one equally under qq. Let w=(1,3)w=(1,3) and A=(0,1)A=(0,1). The target mean is 3/43/4. The independent ratio variance to leading order is 9/(64N)9/(64N): w(A−μ)w(A-\mu) takes values −3/4,+3/4-3/4,+3/4, and Eqw=2\mathbb E_qw=2.

Computing separate numerator and denominator errors while omitting their covariance gives a different, incorrect result. Enumerating binomial counts of the two states also reveals finite-NN ratio bias. This small example is useful for verifying a jackknife implementation without trusting a large simulation.

Partition a production series into BB equally long contiguous blocks. Keep each block’s numerator sum and denominator sum together. For leave-one-block-out ratios μ^(−b)\widehat\mu_{(-b)}, let their average be μ‾jack\overline\mu_{\rm jack}. The jackknife variance estimate is

σ^jack2=B−1B∑b(μ^(−b)−μ‾jack)2.\widehat{\sigma}_{\rm jack}^2 =\frac{B-1}{B} \sum_b(\widehat\mu_{(-b)}-\overline\mu_{\rm jack})^2.

Recompute the full nonlinear ratio on every deletion. For a block bootstrap, resample whole blocks and recompute the ratio on each resample. Resampling individual observations from a correlated chain understates uncertainty. Use enough blocks to estimate the error, and verify stability as block length changes.

If leave-one-out denominators approach zero or resamples become highly skewed, the usual Gaussian interval may be unjustified. This is a diagnostic to report, not a reason to discard inconvenient resamples.

For nonnegative weights, Neff,w=(∑iwi)2/∑iwi2N_{\rm eff,w}=(\sum_iw_i)^2/\sum_iw_i^2 is a useful weight-concentration diagnostic. It is not a complete variance formula and does not include Markov correlation or dependence of AA on the weights. Inspect largest normalized weights and stability under independent reference runs.

Signed or complex weights require sign/phase analysis; a positive-weight effective-count formula does not certify their ratio uncertainty.

If one sample carries essentially all normalized weight, what happens to the weighted effective count and the reliability of a nominally large run?

Solution

The diagnostic tends to one, regardless of the total stored sample count. The result is controlled by a single configuration and usually cannot support a stable uncertainty estimate. More samples help only if they actually explore the target-relevant region; moving the reference ensemble closer may be necessary.

  • Flyvbjerg, H., and H. G. Petersen, “Error estimates on averages of correlated data,” The Journal of Chemical Physics 91, 461–466 (1989), doi:10.1063/1.457480 — blocking correlated measurements.
  • Hastings, W. K., “Monte Carlo sampling methods using Markov chains and their applications,” Biometrika 57, 97–109 (1970), doi:10.1093/biomet/57.1.97 — stationary sampling and proposal correction.