bebi103.stan.check_ess

bebi103.stan.check_ess(samples, parameters=None, total_ess_rule_of_thumb=100, fractional_ess_rule_of_thumb=0.001, quiet=False, return_diagnostics=False)

Checks the effective sample size (ESS).

Parameters
  • samples (ArviZ InferenceData instance) – Contains samples to be checked. Must contain both posterior and sample_stats.

  • parameters (list of str, or None (default)) – Names of parameters to use. If None, use all parameters. For multidimensional parameters, each entry must be given separately, e.g., [‘alpha[0]’, ‘alpha[1]’, ‘beta[0,1]’].

  • quiet (bool, default False) – If True, do not print diagnostic result to the screen.

  • total_ess_rule_of_thumb (int, default 100) – Rule of thumb for number of effective samples per chain. The default of 100 is based on the suggestion of Vehtari, et al., to have 50 effective samples per split chain.

  • fractional_ess_rule_of_thumb (float, default 0.001) – Rule of thumb value for fractional number of effective samples. The default of 0.001 is based on CmdStan’s defaults.

  • return_diagnostics (bool, default False) – If True, return both a Boolean about whether the diagnostic passed and a data frame containing results about the number of effective samples tests. Otherwise, only return Boolean if the test passed.

Returns

  • passed (bool) – Return True if test passed. Return False otherwise.

  • ess_diagnostics (DataFrame) – Data frame with information about problematic ESS.

Notes

Parameters with ESS given as NaN are not checked.

References

Vehtari, et al., 2019, https://arxiv.org/abs/1903.08008.