- Home
- Library
- Computational Quantum Field Theory
- Sampling Measures and Estimating Free Energies
- Rare Events, Tempering, and Umbrella Sampling
Rare Events, Tempering, and Umbrella Sampling
A simulation can measure the shape of the dominant phase accurately while almost never visiting a suppressed phase. The probability of that rare sector then has a large relative error. We can deliberately sample auxiliary ensembles that visit the suppressed region and reconstruct the physical probability, provided the ensembles overlap enough to determine their relative normalizations.
We will do this for a tilted double well. Quadrature gives an independent answer, so both the benefit and the remaining statistical error can be measured.
Preparation: Importance sampling and reweighting and invariant Markov kernels. Actions below are dimensionless Euclidean functions on the whole real line.
A sector with probability below one in a thousand
Define
The source favors positive . Our observable is the indicator for and zero otherwise. Its mean is
by adaptive quadrature. The partition integral in the denominator is approximately 53.83892065.
Even independent target samples have indicator variance . With , the expected negative count is only 3.63 and the standard deviation of the estimated probability is , about 52% of the answer. A Markov chain trapped in one well can do much worse. The independent binomial baseline already shows why a large-looking total sample count is not enough.
Make overlapping windows
Add harmonic bias potentials
with and . Window samples
These are auxiliary distributions. They do not change the desired target ; their biases must be removed in the final estimator. The central windows connect the suppressed and dominant regions so that their relative statistical weights can be inferred.
For this example , so every window is strictly convex. Its minimum solves
Strong convexity gives . We can therefore draw an exact independent window sample by proposing and accepting with
This special sampler removes within-window mixing as a confounding factor in the experiment. In a field theory one would usually need a Markov sampler and an autocorrelation analysis within each window.
The target and each biased window are separately normalized by quadrature. A logarithmic vertical scale reveals the suppressed negative sector. The curves show the overlap of the analytic window densities across the barrier.
Determine the relative normalizations
Pool samples from each window, labeled . Put . If the were known, the pooled sampling density would be proportional to
The same samples can estimate each normalizer, giving the self-consistency equations
All can be shifted by one common constant without changing any relative prediction. Fix and solve the equations numerically using logarithms and log-sum-exp arithmetic. These are the multistate Bennett acceptance ratio, or MBAR, equations; see Shirts and Chodera, §III and Appendix C.
To recover the physical target, assign normalized weights
Both the fitted normalizers and this ratio fluctuate. Removing the bias potential does not make a finite-data ratio estimator exactly unbiased. Under the usual integrability, overlap and sampling assumptions it is consistent as the number of effective samples grows. The target reweighting formulas are discussed in Shirts and Chodera, §IV.
For a single window the identity simplifies to
when the required expectations exist. Multiple windows reduce reliance on a single distribution's poorly sampled tails. They cannot recover a region absent from every sample merely by solving the equations more accurately.
Test overlap and the recovered probability
The example draws 1,024 independent samples per window and repeats the complete fit 64 times. The mean recovered probability is , with standard deviation across repetitions. The mean differs from quadrature by 0.61 standard errors of that repeated-run mean.
At the same total of 5,120 accepted samples, the measured variance is about 9.17 times smaller than the ideal independent-target binomial variance. Sampling the windows consumed 664,570 proposals across all repetitions, about 2.03 proposals per accepted point, and the normalization fit has an additional cost. Thus 9.17 is a sample-efficiency comparison, not an end-to-end speedup. The comparison is not made artificially favorable by using a trapped target chain as its baseline.
A useful overlap diagnostic follows from
At a converged solution, rows of sum to one. In this equal-size experiment its mean adjacent-window entries are approximately 0.161, 0.057, 0.104 and 0.202. The smallest connection is between the second and central windows. A disconnected overlap graph would leave relative normalizations of its components undetermined by the data; tiny connecting weights can make them very uncertain.
The fixed-point changes reached below , taking at most 688 iterations. This controls numerical convergence of the fit, not statistical accuracy. The nontrivial accuracy check is the distribution of recovered probabilities over independent repetitions against quadrature. For correlated samples, uncertainty estimation must account for within-window correlations and refit the normalizers in each suitable resample or independent run.
Tempering moves configurations between ensembles
Umbrella sampling changes where configurations are collected. Parallel tempering can help them move between difficult regions. For inverse temperatures , use the product target
Apply target-preserving within-replica updates and propose an exchange of configurations . The Metropolis acceptance is
This follows by taking the ratio of the product weights before and after the swap. A replica with retains the desired marginal. Smaller positive can facilitate barrier crossing, but acceptance of neighboring swaps does not prove rapid travel through the full temperature ladder or between all sectors. On the noncompact real line, would give an unnormalizable uniform distribution; it is not an admissible endpoint here.
Biased windows can also exchange configurations. For general actions , replace the exponent by . The benchmark draws independent rejection samples in each window.
Summary
Auxiliary ensembles can expose a suppressed sector, but the physical answer requires their relative normalizations and a correct reweighting formula. Overlap, within-ensemble exploration, finite-sample error and solver convergence are distinct checks. The double-well experiment isolates these issues with an independent quadrature answer.
Exercises
No rare events observed
For independent target draws, derive the probability of seeing no negative-sector sample. Evaluate it approximately at for the example above. Does zero observed count establish ?
Solution
The probability is . A zero count is therefore quite possible even in a perfectly equilibrated independent sample. It does not establish a zero physical probability, and the naive plug-in standard error based on a zero observed proportion would be misleading. Correlation or trapping can increase the chance of such an outcome further.
A common energy shift
Replace every and the target by the corresponding function plus the same constant . What changes in the probabilities and the MBAR fit?
Solution
Each partition integral acquires , so every true increases by . The combinations stay unchanged. The target numerator acquires a common factor that cancels on normalizing the weights. All normalized probabilities and relative are unchanged. An arbitrary gauge choice such as makes explicit that the fit determines relative normalizations only.
References
- M. R. Shirts and J. D. Chodera, “Statistically optimal analysis of samples from multiple equilibrium states,” Journal of Chemical Physics 129, 124105 (2008), arXiv:0801.1426, §§III–IV and Appendix C, doi:10.1063/1.2978177.
Reproducible calculations: examples/computational-qft/monte-carlo-methods/README.md.
Scrollable formula. Use Left and Right arrow keys to reveal hidden content.
Scrollable table. Use Left and Right arrow keys to reveal hidden columns.
Scrollable figure. Use Left and Right arrow keys to reveal hidden content.