Simulated years of losses
simulate_events.RdSimulates n_sims years: a claim count from frequency, then that many
independent losses from severity. Year i uses only stream i of the
generator keyed by seed, so results do not depend on the number of
threads and match Python and Rust.
Arguments
- frequency
- severity
A lognormal, grid_distribution or Pareto-family severity (pareto, piecewise_pareto, log_affine_pareto, generalized_pareto).
- n_sims
Number of simulated years.
- seed
Generator seed: a non-negative whole number below 2^53.
Value
An event_set. Use events() for one year's losses,
event_counts() for the number of losses per year, total() for the
annual totals as a predictive_distribution, and apply_tower() for
reinsurance.
Examples
ev <- simulate_events(poisson_count(5), lognormal_from_mean_cv(1000, 1), 10000, seed = 42)
ev@n_sims
#> [1] 10000
mean(total(ev))
#> [1] 4963.76