summary¶
- summary(posteriors: dict[str, ndarray], alpha: float = 0.05, quantiles: list[float] = None, print_summary: bool = True) dict[str, int | str]
It prints a statistical summary for each posterior.
Parameters¶
posteriorsdictPosterior samples. Posteriors and relative samples are key-value pairs. Each sample is a
numpy.ndarraywith a number of rows equal to the number of iterations and a number of columns equal to the number of Markov chains.alphafloat, optionalSignificance level. It is used to compute the Highest Posterior Density (HPD) interval. It must be between
0and1. Default is0.05.quantileslist, optionalList of the quantiles to compute, for each posterior. It cannot be empty. It must contain only float between
0and1. Default is[0.025, 0.25, 0.5, 0.75, 0.975].print_summarybool, optionalIf
Trueprints the statistical posterior summary report. Default isTrue.
Returns¶
dict- Dictionary with statistical summary of posteriors. It contains:
key
'n_chain', the number of Markov chains,key
'n_iterations', the number of regression iterations,key
'summary', the statistical summary of the posteriors, as apandas.DataFrame,key
'quantiles', quantiles summary of the posteriors, as apandas.DataFrame.
Raises
TypeErrorKeyErrorIf
posteriorsdoes not contain'intercept'key.ValueErrorIf a posterior sample is an empty
numpy.ndarray,if
alphais not between0and1,if
quantilesis an emptylist,if a
quantilesvalue is not between0and1.
See Also