Skip to main content

aggregate.compound_moments()

Compound moments to third order: the mean, variance and third cumulant

Usage

aggregate.compound_moments(
    frequency,
    severity,
)

of S = X_1 + ... + X_N, from the count’s cumulants and the severity’s first three moments, and the approximations fitted to them (the Python package aggregate’s approximate).

Parameters

frequency: a claim count
severity: a severity with a closed-form third moment

Returns

CompoundMoments

Raises

ValueError
If the severity has no closed-form third moment, or an infinite one.

Examples

>>> from prospicio.aggregate import compound_moments
>>> from prospicio.distributions import Gamma, Poisson
>>> m = compound_moments(Poisson(10.0), Gamma.from_mean_cv(50.0, 0.7))
>>> round(m.mean, 6), round(m.cv, 6), round(m.skew, 6)

(500.0, 0.386005, 0.512946)

>>> fit = m.approximate("shifted_gamma")
>>> [(k, round(v, 4)) for k, v in fit.parameters]

[(‘shape’, 15.2025), (‘scale’, 49.5), (‘shift’, -252.5253)]