liesel.goose.summary_m.summary#

liesel.goose.summary_m.summary(results, per_chain=True, params=None, param_indices=None, chain_indices=None, quantiles=(0.05, 0.5, 0.95), hdi_prob=0.9, round_digits=3, as_dataframe=True)[source]#

Compute summary statistics and diagnostic measures of posterior samples.

Parameters
  • results (SamplingResults) – Result object of the sampling process. Must have a method get_posterior_samples() which extracts all samples from the posterior distribution.

  • per_chain (bool) – If True, all statistics and diagnostics (except the Rhat value) are (default: True) computed for each chain separately. If False, one metric is computed for each subparameter after concatenating all chains.

  • params (Union[str, list[str], None]) – Names of the model parameters that are contained in the summary output. Must (default: None) coincide with the dictionary keys of the Position with the posterior samples. If None, all parameters are included.

  • param_indices (Union[int, Sequence[int], None]) – Indices of each model parameter that are contained in the summary output. (default: None) Selects e.g. beta_0 out of a beta parameter vector.A single index can be specified as an integer or a sequence containing one integer. If None, all subparameters are included.

  • chain_indices (Union[int, Sequence[int], None]) – Indices of chains for each model subparameter that are contained in the summary (default: None) output. Selects e.g. chain 0 and chain 2 out of multiple chains. A single index can be specified as an integer or a sequence containing one integer. If None, all chains are included.

  • quantiles (Sequence[float]) – Quantiles of the posterior distribution that are contained in the summary (default: (0.05, 0.5, 0.95)) output.

  • hdi_prob (float) – Coverage level of the Highest Density Interval of the posterior distribution. (default: 0.9) Summary output contains lower and upper bound of this interval.

  • round_digits (int) – Number of decimals for each float value within the summary output. (default: 3)

  • as_dataframe (bool) – If True, all statistics and diagnostics are embedded into a pandas data (default: True) frame. If False, a dictionary with the same keys as Position with the posterior samples is returned.

Return type

dict[str, list[dict]] | DataFrame

Returns

  • Dictionary if as_dataframe is False, pandas.DataFrame if

  • as_dataframe is True.