TransportMaps.Samplers.Routines
¶
Module Contents¶
Functions¶
|
Compute the Effective Sample Size (ESS) of a sample |
|
- TransportMaps.Samplers.Routines.ess(samps, quantile=0.99, do_xcorr=False, plotting=False, plot_lag=50, fig=None) List[int] [source]¶
Compute the Effective Sample Size (ESS) of a sample
The minimum ESS over all the dimension is returned. Cross-correlation can be optionally used as well in the determination of the ESS. Plotting of the correlation decay can be shown.
The ESS is computed as \(\lfloor m/\kappa \rfloor\), where
\[\kappa = 1 + \sum_{c_i>b_i} c_i \;,\]\(c_i\) is the auto-correlation at lag \(i\) and \(b_i\) is the
quantile
-confidence interval for the \(i\)-th value of auto-correlation (i.e. only significant auto-correlation values are summed up).- Parameters:
samps (
ndarray
[\(m,d\)]) – \(d\)-dimensional sample on which to compute the ESSquantile (float) – condifence interval quantile
do_xcorr (bool) – whether to compute and use the auto-correlation function
plotting (bool) – whether to plot auto/cross-correlation decays
plot_lag (int) – how many lags to plot
fig (figure) – handle to a figure
- Returns:
(
int
) – minimum ESS across the \(d\) dimensions