Skip to content

Commit fba5acd

Browse files
committed
minor edits of effective sample size and thinning to close #554 and #587
1 parent 70cf673 commit fba5acd

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

src/bibtex/all.bib

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,3 +1825,12 @@ @article{Riutort-Mayol:2023:HSGP
18251825
pages={17},
18261826
year={2023}
18271827
}
1828+
1829+
@article{Vehtari+etal:2021:Rhat,
1830+
title={Rank-normalization, folding, and localization: An improved $\widehat{R}$ for assessing convergence of {MCMC}},
1831+
author={Vehtari, Aki and Gelman, Andrew and Simpson, Daniel and Carpenter, Bob and B{\"u}rkner, Paul-Christian},
1832+
journal={Bayesian Analysis},
1833+
year=2021,
1834+
volume=16,
1835+
pages={667--718}
1836+
}

src/reference-manual/analysis.qmd

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ and can apply the standard tests.
298298

299299
The second technical difficulty posed by MCMC methods is that the
300300
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
302302
quantities of interest, such as means, variances, or quantiles; see
303303
@Geyer:2011.
304304

@@ -309,19 +309,19 @@ central limit theorem (CLT).
309309

310310
Unlike most packages, the particular calculations used by Stan follow
311311
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.
313314

314315

315316
### Definition of effective sample size {-}
316317

317318
The amount by which autocorrelation within the chains increases
318319
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
325325
proportional to $1 / \sqrt{N_{\mathrm{eff}}}$ rather than
326326
$1/\sqrt{N}$.
327327

@@ -364,16 +364,15 @@ $$
364364

365365

366366
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
369369
effective sample size can be larger than the number of iterations. In
370370
this latter case, MCMC can work better than independent sampling for
371371
some estimation problems. Hamiltonian Monte Carlo, including the
372372
no-U-turn sampler used by default in Stan, can produce anticorrelated
373373
draws if the posterior is close to Gaussian with little posterior
374374
correlation.
375375

376-
377376
### Estimation of effective sample size {-}
378377

379378
In practice, the probability function in question cannot be tractably
@@ -493,8 +492,8 @@ second approach with thinning can produce a higher effective sample
493492
size when the draws are positively correlated. That's because the
494493
autocorrelation $\rho_t$ for the thinned sequence is equivalent to
495494
$\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.
498497

499498
Now contrast the second approach above with the unthinned alternative,
500499

@@ -506,4 +505,4 @@ large. To summarize, *the only reason to thin a sample is to reduce
506505
memory requirements*.
507506

508507
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

Comments
 (0)