Here is the diagnostic trap in its most seductive form:

the sampler is moving
the acceptance rate is high
the estimate looks plausible
therefore the chain has converged

The first three lines can be true while the fourth is false.

Markov chain Monte Carlo is one of the stranger bargains in computational statistics. Instead of drawing independent samples from a distribution, we build a machine whose long-run behavior has that distribution as its equilibrium. The machine is allowed to be dependent. It is allowed to hesitate. It is allowed to walk through probability space one local proposal at a time.

But in exchange, it must forget.

It must forget its starting point, forget which side of a valley it began on, forget the warm-up path, and settle into the stationary distribution we intended to sample. A trace plot is not proof of that. Neither is an acceptance rate. Neither, by itself, is a posterior mean that happens to look sensible.

The Metropolis paper began with statistical mechanics: use a modified Monte Carlo procedure to sample configurations of interacting particles, accepting moves according to their relative Boltzmann weight.1 Hastings generalized the construction into the Metropolis-Hastings recipe: propose a new state, correct for the proposal asymmetry, and keep the desired target distribution stationary.2

That stationary word is doing heavy work. It says what happens after the chain has had enough time. It does not tell you that your finite run has had enough time.

Four Chains, Two Locked Rooms

The lab below samples from a two-dimensional mixture with two symmetric modes. The exact target mean of the x coordinate is zero. That makes the default run slightly nasty: two chains start on the left, two chains start on the right, none of them cross the valley, and the pooled mean looks almost perfect anyway.

The diagnostics are looking at different pieces of the lie:

  • acceptance says how often proposals are kept;
  • R-hat compares between-chain and within-chain variation;
  • ESS / kept estimates how many independent draws the correlated output is worth for the x coordinate;
  • mode balance asks whether retained samples visit the two modes in the target’s 50/50 proportion;
  • mode switches counts whether chains actually cross the low-density gap.
chain 1 chain 2 chain 3 chain 4

The target is a symmetric two-component Gaussian mixture. The proposal is an isotropic random-walk Metropolis proposal, so the acceptance probability is min(1, pi(new) / pi(old)).

The default run is not subtle:

acceptance: about 70%
R-hat: about 6.44
ESS / kept: about 3.5%
mode switches: 0
pooled mean error: about 0.01

That last line is the bait. The target mean is zero and the pooled estimate is near zero, but only because the chains are stuck symmetrically. Two chains remember “left.” Two chains remember “right.” The average has not forgotten anything; it has merely cancelled two failures.

Acceptance Only Says the Door Opened

For a symmetric random-walk proposal, the Metropolis-Hastings rule accepts a proposed state y from current state x with probability

min(1, pi(y) / pi(x)).

That rule is designed to make the target distribution stationary. It is not a certificate that the proposal scale is useful, or that the chain went anywhere important.

Roberts and Rosenthal give the clean one-dimensional intuition. If the proposal variance is extremely small, nearly every move is accepted, but the chain crawls. If it is extremely large, most proposals land in low-density regions and get rejected, so the chain stays fixed for long stretches.3

The lab lets you reproduce both failures. Pull Proposal step toward 0.10. The acceptance rate climbs. The chain does not become more independent. The autocorrelation plot is the receipt. Push the step past 2.40. The chain can sometimes jump modes, but now the accepted sample is sparse and sticky for a different reason.

The famous 0.234 acceptance result for high-dimensional random-walk Metropolis is useful precisely because it is a theorem with conditions, not a superstition. Roberts, Gelman, and Gilks derived it for a high-dimensional asymptotic setting; Roberts and Rosenthal review the broader scaling picture and note different targets for different algorithms, such as MALA.3 In this two-dimensional mixture lab, chasing 0.234 is not the point. The point is to see why acceptance alone is a weak witness.

R-hat Listens for Disagreement

Gelman and Rubin’s multiple-sequence idea is beautifully practical: start several chains from overdispersed points and compare variation between chains to variation within chains.4 If each chain has explored the same target, between-chain disagreement should not dominate.

That is why the default lab is so damning. The chains are individually busy inside their local modes, but their local worlds disagree. Within a mode, x wiggles. Across modes, the chain means are far apart. R-hat notices.

R-hat is not omniscient. If every chain starts in the same wrong mode, R-hat can look too friendly. If modes are visited rarely but synchronously, a finite run can still fool you. But it asks a better question than “did the chain move?”

It asks a sharper question:

would I believe these chains came from the same settled distribution?

ESS Charges Rent for Dependence

Monte Carlo error gets cheap when samples are independent. MCMC samples are not. Effective sample size is an attempt to price that dependence for a chosen quantity.

The lab reports ESS for the x coordinate. When the proposal step is tiny, the chain creates a long sequence of almost-duplicates. The retained sample count can be thousands while the effective count is a small fraction of that. This is why a thick trace can be false comfort. More rows in the CSV are not the same as more information.

Roberts and Rosenthal describe efficiency through integrated autocorrelation time: autocorrelation inflates the variance of Monte Carlo estimates.3 The lab’s autocorrelation panel is the visual version. Bars that decay slowly mean the chain is still carrying yesterday’s state around.

The Valley Is the Actual Problem

The hard part of the default target is not the Gaussian shape inside each mode. It is the low-density gap between modes. A local random walk proposes nearby points. To cross the valley, it must either step into a bad region and survive the acceptance test, or propose a large jump that lands near the other mode. Both are unlikely under many proposal scales.

This is one reason Hamiltonian Monte Carlo became so important for continuous Bayesian computation. Neal describes HMC as using auxiliary momentum and Hamiltonian dynamics to propose distant states that can still have high acceptance, avoiding the diffusive behavior of simple random walks.5 HMC is not a magic answer to isolated modes; Neal explicitly notes tempering as useful when multiple isolated modes exist. But the conceptual contrast is valuable: good proposals use geometry. Bad proposals ask a random walk to commute through a low-density valley.

Receipts I Trust More Than a Plausible Mean

For a serious posterior, I want at least this much evidence:

  1. several chains from dispersed starts;
  2. trace plots for parameters and transformed quantities that matter;
  3. R-hat close to 1 for those quantities, not only for easy marginals;
  4. ESS large enough for the decisions I plan to make;
  5. posterior predictive or problem-specific checks, because convergence to the wrong model is still wrong;
  6. stress runs that change initialization, parameterization, and tuning.

The point is not to worship diagnostics. Diagnostics are lossy instruments. They compress chain behavior into numbers. But they are better than a single acceptance rate, and much better than a hopeful glance at a plausible mean.

MCMC does not fail only by standing still. Sometimes it moves beautifully inside the wrong room.

  1. Nicholas Metropolis, Arianna W. Rosenbluth, Marshall N. Rosenbluth, Augusta H. Teller, and Edward Teller, “Equation of State Calculations by Fast Computing Machines”, Journal of Chemical Physics, 1953. 

  2. W. K. Hastings, “Monte Carlo Sampling Methods Using Markov Chains and Their Applications”, Biometrika, 1970. 

  3. Gareth O. Roberts and Jeffrey S. Rosenthal, “Optimal Scaling for Various Metropolis-Hastings Algorithms”, Statistical Science, 2001.  2 3

  4. Andrew Gelman and Donald B. Rubin, “Inference from Iterative Simulation Using Multiple Sequences”, Statistical Science, 1992. 

  5. Radford M. Neal, “MCMC Using Hamiltonian Dynamics”, in Handbook of Markov Chain Monte Carlo, 2011.