Summary

Contents

Summary#

class liesel.goose.summary_m.Summary(results, additional_chain=None, quantiles=(0.05, 0.5, 0.95), hdi_prob=0.9, selected=None, deselected=None, per_chain=False)[source]#

Bases: object

A summary object.

Offers two main use cases:

  1. View an overall summary by printing a summary instance, including a summary table of the posterior samples and a summary of sammpling errors.

  2. Programmatically access summary statistics via quantities[quantity_name][var_name]. Please refer to the documentation of the attribute quantities for details.

Additionally, the summary object can be turned into a DataFrame using to_dataframe().

Parameters:
  • results (SamplingResults) – The sampling results to summarize.

  • additional_chain (Optional[NewType(Position, dict[str, Any])]) – can be supplied to add more parameters to the summary output. Must be a position (default: None) chain which matches chain and time dimension of the posterior chain as returned by get_posterior_samples().

  • hdi_prob (float) – Level on which to return posterior highest density intervals. (default: 0.9)

  • selected (Optional[list[str]]) – Allow to get a summary only for a subset of the position keys. (default: None)

  • deselected (Optional[list[str]]) – Allow to get a summary only for a subset of the position keys. (default: None)

  • per_chain (bool) – If True, the summary is calculated on a per-chain basis. Certain measures like (default: False) rhat are not available if per_chain is True.

Notes

This class is still considered experimental. The API may still undergo larger changes.

Methods

This section is empty if this class has only inherited attributes.

error_df([per_chain])

Returns an overview of the errors recorded during sampling as a dataframe.

from_result(result[, additional_chain, ...])

Alias for from_results() for backwards compatibility.

from_results(results[, additional_chain, ...])

Creates a Summary object from a results object.

to_dataframe()

Turns Summary object into a DataFrame object.

Attributes

This section is empty if this class has only inherited attributes.

per_chain

Whether results are summarized for individual chains (True), or aggregated over chains (False).

quantities

Dict of summarizing quantities.

config

A dictionary of config settings for this summary object.

sample_info

Dictionary of meta-information about the mcmc samples used to create this summary object.

error_summary

Contains error information for each kernel.

kernels_by_pos_key

A dict, linking parameter names (the keys) to the kernel identifier (the values).