credibility.credibility_premiums()
The credibility premiums at given structure parameters: Bühlmann–Straub’s
Usage
credibility.credibility_premiums(
ratios,
weights,
within_variance,
between_variances,
levels=None,
collective_mean=None
)with one level, Bühlmann–Gisler’s hierarchical ones (as actuar::cm) with more, which are the posterior means of the normal model with the variances known.
Parameters
ratios: Sequence[Sequence[float]]-
As for hierarchical_credibility.
weights: Sequence[Sequence[float]]-
As for hierarchical_credibility.
levels: Sequence[Sequence[float]]-
As for hierarchical_credibility.
within_variance: float-
s**2. between_variances: list of float-
One per level, outermost first and the groups’ last (a with one level; b then a with two).
collective_mean: (float, float) = None-
(mean, sd)of a normal prior on mu; flat if omitted.
Returns
dict-
premiums, credibility, level_premiums,
level_credibilityand collective_mean.
Examples
>>> from prospicio.credibility import credibility_premiums
>>> p = credibility_premiums([[1.0, 2.0, 3.0], [4.0, 5.0, 9.0]], [[1.0] * 3] * 2,
... within_variance=4.0, between_variances=[8.0 - 4.0 / 3.0])
>>> round(p["collective_mean"], 12)4.0