Skip to contents

recommend_grid() chooses a grid (bucket size and number of points) for the compound distribution of frequency claims of severity, as Mildenhall's aggregate sizes one when no bucket is given: the larger of a lognormal or gamma fitted to the aggregate's mean and variance at p, and one big claim on a typical bulk at p; then one big claim at p_star when it fits at the same bucket. With an infinite variance the single big jump alone sizes the grid. compound_auto() discretizes the severity by rounding on that grid and runs the FFT. round_bucket() rounds a bucket size up to aggregate's ladder: {1, 2, 4, 5, 8} * 10^k at 1 and above, a power of two below.

Usage

recommend_grid(
  frequency,
  severity,
  log2 = 16,
  p = 1 - 1e-05,
  p_star = 1 - 1e-12
)

compound_auto(
  frequency,
  severity,
  log2 = 16,
  p = 1 - 1e-05,
  p_star = 1 - 1e-12
)

round_bucket(bs)

Arguments

frequency

A claim count.

severity

Any severity but a sampled distribution.

log2

At most 2^log2 points.

p

Probability of the moment extent.

p_star

Aggregate probability the single big jump covers.

bs

Positive bucket sizes.

Value

recommend_grid(): a list with step, points, extent, method ("moments" or "single_big_jump"), moment_extent (NaN with an infinite variance), jump_extent and tail_estimate (roughly the probability beyond the grid from one claim; raise log2 when it is not small). compound_auto(): a grid_distribution whose report also holds that list as sizing. round_bucket(): a numeric vector.

Examples

g <- recommend_grid(poisson_count(10), gamma_distribution(1 / 0.49, 50 * 0.49))
g$step
#> [1] 0.0625
agg <- compound_auto(poisson_count(5), lognormal_from_mean_cv(100, 1))
mean(agg)
#> [1] 499.9999
agg@report$sizing$points
#> [1] 65536
round_bucket(c(3.4, 0.3))
#> [1] 4.0 0.5