liesel.goose.summary_m.summary
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 methodget_posterior_samples()which extracts all samples from the posterior distribution.per_chain (
bool) – IfTrue, all statistics and diagnostics (except the Rhat value) are (default:True) computed for each chain separately. IfFalse, 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 thePositionwith the posterior samples. IfNone, 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_0out of abetaparameter vector.A single index can be specified as an integer or a sequence containing one integer. IfNone, 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. IfNone, 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) – IfTrue, all statistics and diagnostics are embedded into apandasdata (default:True) frame. IfFalse, a dictionary with the same keys asPositionwith the posterior samples is returned.
- Return type
- Returns
Dictionary if
as_dataframeis False,pandas.DataFrameifas_dataframeis True.