An MCMC chain has post-burn-in draws of a quantity with variance and autocorrelations . What is the effective sample size , how does the Monte Carlo standard error compare with the naive , 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, , and the Monte Carlo standard error (MCSE) of the sample mean is . For autocorrelations (an AR(1) chain) the sum is geometric and .
Steps
- 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 draws carry less than draws' worth of information.
- Sum the autocorrelations: . So the integrated autocorrelation time is .
- Effective sample size: . The chain is worth about 526 independent draws.
- Standard error: the naive value is . The correct value is , which is times larger. Using instead of makes you about 4 times too confident.
- Thinning: keep every 20th draw, so draws remain. The lag between kept draws is 20, so their autocorrelation is and the thinned chain is still AR(1). Then .
- Compare: the full chain has and MCSE ; the thinned chain has and MCSE . Thinning made the estimate worse. It only helps if storage or later processing per draw is expensive, so report and keep all draws otherwise.
Common mistakes
- Using instead of in the standard error, which understates the uncertainty.
- Believing that thinning improves accuracy. It discards correlated but still useful draws, so falls.
- Applying the AR(1) closed form to every chain. It is exact only when ; real chains need the estimated autocorrelations (and care about where to truncate the sum).
How long your answer should be
About half a page, 3–4 minutes.
Read this
Previous in Probabilistic models: You want for but you sample from and get . 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?