An MCMC chain has n=10,000 post-burn-in draws of a quantity with variance σ2=1 and autocorrelations ρk=0.9k. What is the effective sample size neff, how does the Monte Carlo standard error compare with the naive σ/n, and what happens to the information if you thin the chain by keeping every 20th draw?

Probabilistic models, MCMC
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can use the effective sample size formula, see why correlated draws inflate the error of a Monte Carlo average, and know that thinning loses information.

Key idea

For a stationary chain, neff=n/(1+2∑k≥1ρk), and the Monte Carlo standard error (MCSE) of the sample mean is σ/neff. For autocorrelations ρk=ρk (an AR(1) chain) the sum is geometric and neff=n 1−ρ1+ρ.

Steps

  1. The plain-words version comes first: see `mcmc-burn-in-and-correlated-samples`. Here we put numbers on it. Positive autocorrelation means each draw repeats part of the previous one, so n draws carry less than n draws' worth of information.
  2. Sum the autocorrelations: ∑k≥10.9k=0.91−0.9=9. So the integrated autocorrelation time is 1+2⋅9=19.
  3. Effective sample size: neff=10,000/19≈526. The chain is worth about 526 independent draws.
  4. Standard error: the naive value is 1/10,000=0.01. The correct value is 1/526.3≈0.0436, which is 19≈4.36 times larger. Using n instead of neff makes you about 4 times too confident.
  5. Thinning: keep every 20th draw, so 500 draws remain. The lag between kept draws is 20, so their autocorrelation is 0.920≈0.1216 and the thinned chain is still AR(1). Then neff=500⋅1−0.12161+0.1216≈392.
  6. Compare: the full chain has neff≈526 and MCSE ≈0.0436; the thinned chain has neff≈392 and MCSE 1/391.6≈0.0505. Thinning made the estimate worse. It only helps if storage or later processing per draw is expensive, so report neff and keep all draws otherwise.

Common mistakes

How long your answer should be

About half a page, 3–4 minutes.

Read this

Previous in Probabilistic models: You want Ep[X] for p=N(0,1) but you sample from q=N(1,1) and get x=0.5, 1.0, 2.0, −0.5. What are the importance weights, the self-normalised estimate and the effective sample size, and what does a small effective sample size tell you?
Next in Probabilistic models: How does the Metropolis–Hastings acceptance probability follow from detailed balance, and why is Gibbs sampling a special case whose proposals are always accepted?