aggregate.simulate_events()

Simulates n_sims years of claims: a count from frequency, then that

Usage

aggregate.simulate_events(
    frequency,
    severity,
    n_sims,
    seed,
)

many independent losses from severity.

Parameters

frequency: (Poisson, NegativeBinomial or Binomial)
severity: (Lognormal, Grid, Pareto, PiecewisePareto, LogAffinePareto or GeneralizedPareto)
n_sims: int
seed: int

Returns

EventSet

Raises

ValueError
If n_sims is 0.

Examples

>>> from prospicio.aggregate import simulate_events
>>> from prospicio.distributions import Lognormal, Poisson
>>> events = simulate_events(Poisson(5.0), Lognormal.from_mean_cv(1000.0, 1.0), 20_000, 42)
>>> abs(events.totals().mean() - 5000.0) < 75.0

True