bebi103.hmc.check_hmc_diagnostics
- bebi103.hmc.check_hmc_diagnostics(samples, adapt_target=0.801, adapt_target_fraction=0.9, efmi_rule_of_thumb=0.2, max_treedepth=10, verbosity=2)
Check to all HMC diagnostics that are included in Stan’s output (divergences, EFMI, tree depth, acceptance rate).
- Parameters:
samples (cmdstanpy.CmdStanMCMC, xarray.DataTree, pandas.DataFrame, or polars.DataFrame) – Results from MCMC sampling from which to check HMC diagnostics.
adapt_target (float, default 0.801) – Target acceptance proxy statistic for step size adaptation. This should be approximately the prescribed value of adapt_delta in sampling. The default adapt_delta is 0.8, which is why the default adapt_target is 0.801.
adapt_target_fraction (float, default 0.9) – Average target acceptance proxy statistic below adapt_target_fraction * adapt_target is flagged as problematic.
efmi_rule_of_thumb (float, default 0.2) – EFMI values greater than efmi_rule_of_thumb are flagged.
max_treedepth (int, default 10) – Specification of maximum treedepth allowed in MCMC sampling.
verbosity (int, default 2) – Level of verbosity for messages printed to the screen. 0 prints nothing. 1 prints a summary of the diagnostics. 2 prints the summary followed by descriptions of what the triggered diagnostics mean. 3 prints per-chain detail followed by the descriptions.
- Returns:
output – A dictionary reporting summaries of diagnostics.
- Return type:
dict
Notes