@@ -298,7 +298,7 @@ and can apply the standard tests.
298
298
299
299
The second technical difficulty posed by MCMC methods is that the
300
300
samples will typically be autocorrelated (or anticorrelated) within a
301
- chain. This increases the uncertainty of the estimation of posterior
301
+ chain. This increases (or reduces) the uncertainty of the estimation of posterior
302
302
quantities of interest, such as means, variances, or quantiles; see
303
303
@Geyer :2011.
304
304
@@ -309,19 +309,19 @@ central limit theorem (CLT).
309
309
310
310
Unlike most packages, the particular calculations used by Stan follow
311
311
those for split-$\hat{R}$, which involve both cross-chain (mean) and
312
- within-chain calculations (autocorrelation); see @GelmanEtAl :2013.
312
+ within-chain calculations (autocorrelation); see @GelmanEtAl :2013 and
313
+ @Vehtari +etal:2021: Rhat .
313
314
314
315
315
316
### Definition of effective sample size {-}
316
317
317
318
The amount by which autocorrelation within the chains increases
318
319
uncertainty in estimates can be measured by effective sample size (ESS).
319
- Given independent samples, the central limit theorem
320
- bounds uncertainty in estimates based on the number of samples $N$.
321
- Given dependent samples, the number of independent samples is replaced
322
- with the effective sample size $N_ {\mathrm{eff}}$, which is
323
- the number of independent samples with the same estimation power as
324
- the $N$ autocorrelated samples. For example, estimation error is
320
+ Given independent sample (with finite variance), the central limit theorem
321
+ bounds uncertainty in estimates based on the sample size $N$.
322
+ Given dependent sample, the sample size is replaced
323
+ with the effective sample size $N_ {\mathrm{eff}}$.
324
+ For example, Monte Carlo standard error (MCSE) is
325
325
proportional to $1 / \sqrt{N_ {\mathrm{eff}}}$ rather than
326
326
$1/\sqrt{N}$.
327
327
364
364
365
365
366
366
For independent draws, the effective sample size is just the number of
367
- iterations. For correlated draws, the effective sample size will be
368
- lower than the number of iterations. For anticorrelated draws, the
367
+ iterations. For correlated draws, the effective sample size is usually
368
+ lower than the number of iterations, but in case of anticorrelated draws, the
369
369
effective sample size can be larger than the number of iterations. In
370
370
this latter case, MCMC can work better than independent sampling for
371
371
some estimation problems. Hamiltonian Monte Carlo, including the
372
372
no-U-turn sampler used by default in Stan, can produce anticorrelated
373
373
draws if the posterior is close to Gaussian with little posterior
374
374
correlation.
375
375
376
-
377
376
### Estimation of effective sample size {-}
378
377
379
378
In practice, the probability function in question cannot be tractably
@@ -493,8 +492,8 @@ second approach with thinning can produce a higher effective sample
493
492
size when the draws are positively correlated. That's because the
494
493
autocorrelation $\rho_t$ for the thinned sequence is equivalent to
495
494
$\rho_ {10t}$ in the unthinned sequence, so the sum of the
496
- autocorrelations will be lower and thus the effective sample size
497
- higher.
495
+ autocorrelations usually will be lower and thus the effective sample size
496
+ higher.
498
497
499
498
Now contrast the second approach above with the unthinned alternative,
500
499
@@ -506,4 +505,4 @@ large. To summarize, *the only reason to thin a sample is to reduce
506
505
memory requirements* .
507
506
508
507
If draws are anticorrelated, then thinning will increase correlation
509
- and reduce the overall effective sample size.
508
+ and further reduce the overall effective sample size.
0 commit comments