Autocorrelation times and effective sample size
Compute an observable-specific error inflation and distinguish long-run variance from a nominal configuration count.
On this page
The question for today
What you’ll understand
- Use the one-half convention for integrated autocorrelation time.
- Compute the variance and effective sample size of an equilibrated mean.
- Explain why blocking and nonlinear estimators need matched resampling.
Saving a thousand configurations does not necessarily provide a thousand independent measurements. A local algorithm may preserve a long-wavelength fluctuation through many sweeps, so adjacent measurements carry overlapping information. Autocorrelation is specific to both the observable and the update rule. Energy, magnetization, and a rare topological quantity can therefore have very different error budgets on the same trajectory. We assume an equilibrated stationary process with finite variance and a sufficiently summable correlation tail before using the long-run formulas in this lesson.
Fix the convention before quoting a time
For an observable O recorded at equally spaced update intervals, subtract its equilibrium expectation and define the covariance at lag t. Normalize by the zero-lag variance to obtain rho. We use integrated autocorrelation time equal to one half plus the positive-lag sum. Independent measurements then have tau equal to one half, not one. Some authors instead call twice this quantity the autocorrelation factor; copying a quoted number without its definition creates a factor-of-two error in the reported uncertainty.
The exponential relaxation time measures an asymptotic decay rate of slow modes, whereas the integrated time weights their amplitudes in this particular observable. A small-amplitude slow tail may scarcely affect a short plot yet matter for a precise error estimate. Negative correlations can lower the integrated time below one half and give a variance-based effective size above the number stored. That mathematical possibility does not create additional independent configurations or justify ignoring stationarity and tail-estimation assumptions.
Long-run variance controls the error of a mean
The exact finite-length variance of the mean contains a triangularly weighted sum over all lags. When the run is much longer than its relevant correlation scale, replacing those weights by one gives the common asymptotic variance formula. Effective sample size is defined by comparing this variance with that of independent measurements having the same marginal variance. It is therefore a diagnostic for estimating this observable’s mean, rather than a universal property attached permanently to a saved file.
Increasing the measurement spacing can reduce correlation between stored entries, but it also discards information already paid for unless storage or measurement cost is the bottleneck. Efficiency should be compared using uncertainty per total computational cost. A longer run reduces statistical uncertainty only after thermalization and mixing are credible. An apparently small estimated autocorrelation time from a chain trapped in one sector cannot account for the missing sector; within-sector fluctuations alone underestimate the full uncertainty.
Estimate errors without treating derived quantities independently
A practical autocorrelation sum needs a window: including too few lags loses the tail, while including arbitrarily many mostly noisy lags destabilizes the estimate. Vary the window and examine stability, ideally using independent replicas as additional checks. Blocking offers another diagnostic: combine consecutive measurements into blocks longer than the relevant correlation scale and estimate the uncertainty from their means. Increasing the block size leaves fewer blocks, so a seeming plateau with only a handful remaining can itself be statistically weak.
For a nonlinear ratio such as a Binder cumulant or a reweighted mean, its ingredients fluctuate together. A block jackknife or bootstrap must resample the same blocks for all ingredients and recompute the complete ratio or fit each time. Resampling individual correlated measurements as if independent defeats the purpose. These methods control sampling uncertainty and some finite-sample bias; they do not repair an incorrect action or an unsampled phase. The exact Markov lab illustrates a relaxation eigenmode without generating a stochastic history from which to estimate an error.
Work it through
A geometric autocorrelation tail
An equilibrated observable has marginal variance four and exact normalized correlations . For 1000 stored measurements, calculate integrated time, effective sample size, and the asymptotic standard error.
The positive-lag geometric sum is . With the declared one-half convention, .
The variance inflation is twice tau, namely four. Thus the variance-based effective sample size is , although the file still contains 1000 measurements.
The asymptotic mean variance is , so its standard error is in the observable’s units. This uses the supplied exact stationary tail and a long-run approximation.
The integrated time is two measurement intervals, effective size 250, and asymptotic standard error about 0.1265.
The living notebook
Explore the model
Interactive lab · markov
Compare two exact relaxation modes
Reset and set , ; Step twice to two transitions and predict state-one probability 0.18. Repeat from Reset with both controls , and two Steps; predict 0.5. The nonstationary eigenvalues are respectively 0.8 and zero. These exact probability evolutions illustrate persistence but do not produce sampled trajectories or an autocorrelation-time readout.
- P(state 1) at step 0
- 0%
- Stationary P(state 1)
- 60%
- Chain behavior
- Monotone convergence
Exact finite-step probabilities for a two-state chain starting in state 0, not sampled trajectories. Playback advances two transitions per second. When p = q = 0 every distribution is stationary; when p = q = 1 the chain alternates forever. A single zero transition creates an absorbing state. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA stationary distribution can be identical while the approach to it differs substantially.
Pause & reason
Check your understanding
Your turn
Try it yourself
Four equal-length block means are 1, 3, 2, and 4. Assuming these block means are independent, calculate the overall mean and the blocking standard error. Each block contains ten original measurements.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Use the sample variance of the four block means with denominator three; do not divide again by the forty raw entries.
Compare with the solution
The mean is 2.5. Squared deviations sum to , giving block sample variance . The mean’s estimated variance is , hence standard error . Dividing by forty instead of four would count the block averaging twice. With only four blocks this estimate is noisy, and its assumption of negligible interblock correlation still needs independent justification.
Keep the idea
Take it with you
- Autocorrelation conventions must accompany every reported time or effective sample size.
- Errors depend on an observable’s integrated covariance, not simply the number of configurations.
- Blocking and joint resampling preserve the correlations needed for nonlinear observables and fits.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.