Skip to contents

Years drawn from a proposal, with each year's likelihood ratio, so that a tail statistic of the years (the total, a tower's ceded or net loss) has a smaller standard error for the same number of years. Year i draws from stream i - 1 of seed as simulate_events() does, with two optional changes of measure: count, a proposal claim count (any family, such as a Poisson with a higher mean), weighted by p(n) / q(n); and a tail mixture, each loss coming from the severity above tail_threshold with chance tail_share, weighted by 1 / ((1 - share) + share * (x > u) / S(u)). Without either the years are simulate_events()'s and every weight is 1. Estimate the statistics with weighted_tail().

Usage

simulate_events_weighted(
  frequency,
  severity,
  n_sims,
  seed,
  count = NULL,
  tail_threshold = NULL,
  tail_share = 0.3
)

Arguments

frequency

A poisson_count, negative_binomial_count or binomial_count.

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.

count

A proposal claim count, or NULL for frequency itself.

tail_threshold

The threshold of the tail mixture, or NULL for none.

tail_share

The tail mixture's chance, in (0, 1).

Value

A list with events, an event_set, and weights, one a year.

Examples

w <- simulate_events_weighted(poisson_count(2), lognormal_from_mean_cv(10, 2), 20000, seed = 7,
                              count = poisson_count(4), tail_threshold = 40)
weighted_tail(draw_matrix(total(w$events))[, 1], w$weights, c(0.99, 0.995))
#>       p      var   var_se     tvar  tvar_se
#> 1 0.990 137.6104 1.615610 210.6563 4.463648
#> 2 0.995 179.2943 2.775999 266.6360 7.655670