Autocorrelation and Effective Sample Size
Autocorrelation changes the uncertainty of an average even when every stored configuration has the correct stationary distribution. Effective sample size translates that variance inflation into the number of independent observations with the same precision. It belongs to an estimator, not to a Markov chain in isolation.
Required background. MCMC stationarity and mixing distinguishes equilibration from production sampling.
Variance of a correlated average
Section titled “Variance of a correlated average”Let be a real stationary observable with finite nonzero variance, , and . Expanding the variance of a sample mean gives the exact finite- identity
When correlations are summable and is much longer than their decay, define
For , . If the summed covariance is zero, the leading variance vanishes and the finite- expression must be used instead of interpreting an infinite effective count literally. This convention gives for independent observations. Some literature defines twice this quantity as the integrated time; always state the convention.
An autoregressive benchmark
Section titled “An autoregressive benchmark”For with and independent zero-mean innovations chosen for stationarity, . Therefore
At , the variance factor is . Ten thousand stored observations provide approximately independent-observation equivalents, and the naive standard error is too small by . This is a useful synthetic test for both autocorrelation and blocking routines.
Negative yields anticorrelation and a factor below one. Algorithms that force every estimated correlation positive will give a conservative but distorted answer for this example.
Truncating the noisy correlation sum
Section titled “Truncating the noisy correlation sum”An empirical correlation at long lag has large noise because few pairs remain. Summing it out to the full trajectory length does not improve the estimator. Use a justified window that extends past the visible correlation decay while remaining short relative to the run; compare nearby windows and independent replicates.
Long tails or multiple relaxation scales complicate this choice. An energy observable may decay rapidly while a phase-switching variable scarcely moves. A short estimated in one metastable region does not diagnose equilibration across regions.
For nonlinear or reweighted observables, analyze the relevant combined fluctuation, such as for a weighted ratio, rather than substituting the autocorrelation time of energy by habit.
Blocking as a complementary check
Section titled “Blocking as a complementary check”Divide a production sequence into contiguous blocks of length , and compute each block mean . If exceeds the relevant correlation time and enough blocks remain,
Increase and look for a stable error plateau. At very large , too few blocks remain to estimate uncertainty reliably; a noisy plateau based on two or three blocks is not persuasive. Check independent chains as well.
Thinning reduces storage but usually throws away information when observations are cheap. It can be useful when measuring an observable is expensive, but the appropriate comparison is total computational cost at fixed precision.
Reporting limits
Section titled “Reporting limits”State update units, production length, discarded equilibration segment, block sizes or correlation windows, number of independent chains, and the observable-specific estimated uncertainty. If the run is not much longer than the slowest measured time, report that limitation rather than printing extra digits.
Exercises
Section titled “Exercises”A run records one value after every ten sweeps. Its estimated is four in recorded-sample units. What is it in sweep units?
Solution
Four recorded-sample intervals correspond to forty sweeps. This unit conversion does not recover the integrated autocorrelation time of a series measured every sweep: the unrecorded lags are unknown. For the stored mean, use with the stored count. Do not multiply the time by ten while leaving in recorded-sample units; that would mix units and overinflate the variance.
References
Section titled “References”- 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.