Skip to main content

credibility.HierarchicalCredibilityFit

A fitted Bayesian hierarchical credibility model, from

Usage

credibility.HierarchicalCredibilityFit()

Attributes

Name Description
collective_mean Posterior mean of the collective mean.
credibility Posterior mean of each group’s credibility factor.
divergences Divergent transitions over all chains.
group_means Each group’s weighted mean.
group_weights Each group’s total weight.
level_premiums Posterior mean of each node’s mean, level by level (outermost first).
premiums Posterior mean of each group’s risk premium.
priors The priors used, with the defaults filled in: a dict with

collective_mean

Posterior mean of the collective mean.

collective_mean: float


credibility

Posterior mean of each group’s credibility factor.

credibility: list[float]


divergences

Divergent transitions over all chains.

divergences: int


group_means

Each group’s weighted mean.

group_means: list[float]


group_weights

Each group’s total weight.

group_weights: list[float]


level_premiums

Posterior mean of each node’s mean, level by level (outermost first).

level_premiums: list[list[float]]


premiums

Posterior mean of each group’s risk premium.

premiums: list[float]


priors

The priors used, with the defaults filled in: a dict with

priors: dict

collective_mean, within and between.

Methods

Name Description
predictive() Posterior predictive draws by group (dimension group): with
summary() Posterior summaries of within_variance and

predictive()

Posterior predictive draws by group (dimension group): with

Usage

predictive(weights=None, n_sims=10000, seed=0)

weights, each group’s next-period ratio N(theta_i, sigma**2 / w_i); without, its risk premium theta_i.

Parameters
weights: list of float = None

Each group’s weight next period.

n_sims: int = 10000
seed: int = 0
Returns
PredictiveDistribution

summary()

Posterior summaries of within_variance and

Usage

summary()

between_variance[l] (outermost level first): one dict each with name, mean, sd, q05, q50, q95, rhat, ess_bulk and ess_tail.

Returns
list of dict