Skip to contents

Rendered from examples/reinsurance_pricing.qmd. The code runs each time the site is built, so the output below is current.

This document prices six reinsurance contracts with the prospicio R package. It puts each result beside the value that Stephen Mildenhall’s Python package aggregate (1.0.1) gives for the same contract. It is the R twin of reinsurance_pricing.ipynb. The reader is a reinsurance pricing actuary who knows aggregate. Each section states the contract and the DecL line that builds it in aggregate. Then it shows the R code, prints the result and compares it with the result of aggregate.

Section Contract Source in aggregate’s examples
1 A gross book and a five-layer occurrence tower Reinsurance Functions (ReTester)
2 Ceded and net of a two-layer program, and an 80% share net of and po clauses
3 An annual aggregate limit, then paid reinstatements Bear and Nemlick Treaty 2
4 Aggregate stop loss, and an aggregate deductible ReTester stop loss, Treaty 1
5 Retro and swing premium, profit commission, sliding scale Treaties 4, 5 and 6
6 Risk-adjusted premium (loss plus cost of capital) with distortions calibrate_distortions

To run the document:

  1. Clone the repository.
  2. Install the R package (remotes::install_github, see R/prospicio/bootstrap.R) and ggplot2.
  3. From any folder in the repository, render with quarto render examples/reinsurance_pricing.qmd.

The document does not need aggregate. The reference values are in validation/reference/re_pricing_aggregate.csv, which validation/scripts/aggregate_re_pricing.py writes with aggregate 1.0.1. The document does not simulate, so it has no simulation count.

Same grid. Both packages round the severity to buckets of size bs and put the mass above a policy limit on the limit. Both compound with an FFT on 2^16 points and do not normalise (aggregate’s normalize=False). Where a comparison depends on the grid, prospicio gets the bucket size that aggregate used. Thus the contract terms act on the same discretized severity in both packages. A layer boundary on a grid point is exact, and a boundary between grid points splits linearly between the two adjacent buckets. So the means agree far inside the tolerances below.

Tolerances. We set them after a first run of the Python notebook, from the differences that the last section explains. The summary at the end prints the worst difference in each class beside its tolerance.

Quantity Tolerance Reason
Means, probabilities, premiums, commissions, prices 1e-6 relative Same grid
Standard deviation and CV 1e-6 relative Same grid
Standard deviation and CV of a share placed off the grid (sections 2 and 4) 1e-5 relative aggregate re-buckets the ceded amounts
Skewness, against the skewness of aggregate’s density 2e-5 relative FFT rounding noise at the top of the grid enters the third moment (last section)
Quantiles The same grid point A quantile is a point of the shared grid, and at none of those compared is the cdf within 6.7e-8 of a tie
Quantiles of a share placed off the grid Within one bucket aggregate re-buckets the ceded amounts
A stop loss far in the tail (the loss above 2,800 in section 3) 1e-5 relative prospicio lumps the cut tail on the last point

Some rows hold by construction, not by agreement. The summary marks them * as consistency checks and counts them apart from the independent comparisons:

  • a calibrated distortion prices min(X, a) at the premium of its calibration,
  • the CCoC return on capital is the cost of capital in the premium,
  • a maximum reinstatement premium is the deposit times the rates.
library(ggplot2)
library(prospicio)  # after ggplot2, so that its layer() masks ggplot2::layer()

POINTS <- 2^16  # aggregate's log2 = 16 in every example

# The repository's reference folder, from wherever the document renders.
find_reference <- function(start = getwd()) {
  dir <- normalizePath(start, winslash = "/")
  repeat {
    candidate <- file.path(dir, "validation", "reference")
    if (dir.exists(candidate)) return(candidate)
    parent <- dirname(dir)
    if (identical(parent, dir)) stop("validation/reference not found above ", start)
    dir <- parent
  }
}
REFERENCE <- find_reference()
ref <- read.csv(file.path(REFERENCE, "re_pricing_aggregate.csv"))
AGG <- setNames(ref$value, paste(ref$example, ref$quantity, sep = "|"))
cat(sprintf("%d reference values from aggregate 1.0.1 in validation/reference/re_pricing_aggregate.csv\n",
            length(AGG)))
## 544 reference values from aggregate 1.0.1 in validation/reference/re_pricing_aggregate.csv
money <- function(x) formatC(x, format = "f", digits = 2, big.mark = ",")

# Mean, standard deviation, CV and skewness of a grid. The third central moment is summed here.
moments <- function(grid) {
  h <- grid@step
  p <- grid@probs
  mean <- mean(grid)
  sd <- sqrt(variance(grid))
  x <- (seq_along(p) - 1) * h
  m3 <- sum((x - mean)^3 * p)
  c(mean = mean, sd = sd, cv = sd / mean, skew = m3 / sd^3)
}

# P(X >= x) on a grid whose points may not include x: the cdf half a step below x.
prob_at_least <- function(grid, x) 1 - cdf(grid, x - grid@step / 2)

# Round the severity to buckets of size bs, with the policy limit as the last point: the mass
# beyond the last point sits there, aggregate's `limit xs 0`.
discretize_limited <- function(severity, bs, limit) {
  discretize(severity, bs, round(limit / bs) + 1, method = "rounding")
}

# Gamma-mixed Poisson (aggregate's `mixed gamma cv`): a negative binomial with Var/E = 1 + cv^2 n.
mixed_poisson <- function(n, mixing_cv) claim_count(n, 1 + mixing_cv^2 * n)

# aggregate's `exposure at rate`, severity `scale * pareto shape - scale` (a Lomax) limited to
# `limit`. The expected loss of class i is subject * rate; its claim count is solved from it. All
# classes share one mixing variable, so they are one mixed Poisson over a severity mixture.
exposure_book <- function(subject, rate, shapes, scale, limit) {
  lomax <- lapply(shapes, function(a) burr_distribution(a, 1, scale))
  counts <- subject * rate / vapply(lomax, lev, numeric(1), limit = limit)
  n <- sum(counts)
  list(counts = counts, n = n, mix = mixture_distribution(counts / n, lomax))
}

# E[min(X, limit)^2] by integrating 2 x S(x) over [0, limit]. The package has no closed form for a
# mixture's layer second moment, so this stands in for `layer_second_moment`.
limited_second_moment <- function(dist, limit) {
  integrate(function(x) 2 * x * (1 - cdf(dist, x)), 0, limit,
            rel.tol = 1e-12, subdivisions = 2000L)$value
}

# Tolerance by class, as (tolerance, unit); see the table above.
TOLERANCES <- list(
  mean = c(1e-6, "rel"),
  sd = c(1e-6, "rel"),
  `share sd` = c(1e-5, "rel"),
  skew = c(2e-5, "rel"),
  quantile = c(0, "buckets"),
  `share quantile` = c(1, "buckets"),
  tail = c(1e-5, "rel")
)

STATE <- new.env()
STATE$comparisons <- list()
STATE$shown <- list()

record <- function(section, name, agg, pro, diff, cls, show, check) {
  tol <- as.numeric(TOLERANCES[[cls]][1])
  unit <- TOLERANCES[[cls]][2]
  row <- data.frame(section = section, name = name, aggregate = agg, prospicio = pro, diff = diff,
                    cls = cls, unit = unit, tol = tol, ok = isTRUE(diff <= tol), check = check)
  STATE$comparisons[[length(STATE$comparisons) + 1]] <- row
  if (show) STATE$shown[[length(STATE$shown) + 1]] <- row
  invisible(NULL)
}

agg_value <- function(example, quantity) {
  v <- AGG[paste(example, quantity, sep = "|")]
  if (is.na(v)) stop("no reference value for ", example, " / ", quantity)
  unname(v)
}

# Relative difference from aggregate's number. check = TRUE marks a consistency check: a row that
# holds by construction, not by agreement.
compare <- function(section, name, example, quantity, value, cls = "mean", show = TRUE, check = FALSE) {
  agg <- agg_value(example, quantity)
  diff <- if (agg != 0) abs(value - agg) / abs(agg) else abs(value)
  record(section, name, agg, value, diff, cls, show, check)
}

# Difference of a quantile in buckets.
compare_quantile <- function(section, name, example, quantity, value, bs, cls = "quantile", show = TRUE) {
  agg <- agg_value(example, quantity)
  record(section, name, agg, value, abs(value - agg) / bs, cls, show, FALSE)
}

# share = TRUE: a share placed off the grid, which aggregate re-buckets. Skewness is compared with
# the skewness of aggregate's density (`_skew_central`); the skew aggregate quotes (`_skew`) also
# counts the density's rounding deficit (see the last section).
compare_distribution <- function(section, name, example, prefix, grid, bs, share = FALSE,
                                 shown = c("mean", "sd", "cv", "skew", "q0.5", "q0.9", "q0.99", "q0.999")) {
  m <- moments(grid)
  sd_cls <- if (share) "share sd" else "sd"
  stats <- list(list("mean", "mean", m[["mean"]], "mean"), list("sd", "sd", m[["sd"]], sd_cls),
                list("cv", "cv", m[["cv"]], sd_cls), list("skew", "skew_central", m[["skew"]], "skew"))
  for (s in stats) {
    compare(section, paste(name, s[[1]]), example, paste0(prefix, "_", s[[2]]), s[[3]], s[[4]],
            s[[1]] %in% shown)
  }
  for (p in c(0.5, 0.9, 0.99, 0.999)) {
    compare_quantile(section, paste0(name, " q", p), example, paste0(prefix, "_q", p),
                     quantile(grid, p), bs, if (share) "share quantile" else "quantile",
                     paste0("q", p) %in% shown)
  }
}

# Print the comparisons made since the last report; * marks a consistency check.
report <- function() {
  if (length(STATE$shown)) {
    rows <- do.call(rbind, STATE$shown)
    rows$difference <- ifelse(rows$unit == "rel", sprintf("%.1e", rows$diff), sprintf("%.2f bkt", rows$diff))
    out <- data.frame(
      quantity = paste0(rows$name, ifelse(rows$check, " *", "")),
      aggregate = signif(rows$aggregate, 8), prospicio = signif(rows$prospicio, 8),
      difference = rows$difference, pass = ifelse(rows$ok, "yes", "NO")
    )
    print(out, row.names = FALSE, right = FALSE)
  }
  STATE$shown <- list()
}

1. A gross book and an occurrence tower

The contract. A book of ground-up claims with a Poisson count of 10 claims a year. Each claim is lognormal with mean 100 and CV 5, and the policy limits it to 5,000. A tower of five layers, each at 100% and per occurrence, with no annual terms. The layers are 250 xs 0, 250 xs 250, 500 xs 500, 1,000 xs 1,000 and 3,000 xs 2,000. The tower covers the full policy limit, so the layers add to the gross loss.

In aggregate this is

agg Re.T 10 claims 5000 xs 0 sev lognorm 100 cv 5
    occurrence ceded to 250 xs 0 and 250 xs 250 and 500 xs 500 and 1000 xs 1000 and 3000 xs 2000 poisson

with normalize=False. aggregate picks the bucket bs = 4. The bucket does not divide 250, where 250 xs 0 detaches and 250 xs 250 attaches. Thus both packages split those two layers linearly between the two adjacent buckets. The split keeps each layer consistent with the discretized severity, so the five layers still add to the gross loss on the grid. The other boundaries (500, 1,000, 2,000 and 5,000) are grid points.

In R. discretize_limited() rounds the severity to the grid. compound_distribution(method = "fft") compounds it into the gross annual loss. tower_on_grid() gives the annual ceded loss of each layer from the same severity grid and claim count.

S1 <- "1 tower"
BS1 <- 4
claims <- poisson_count(10)
severity <- lognormal_from_mean_cv(100, 5)
sev_grid <- discretize_limited(severity, BS1, 5000)
gross <- compound_distribution(claims, sev_grid, POINTS, method = "fft")
gross_report <- gross@report

cat(sprintf("mean claim: exact %.4f, on the grid %.4f\n", lev(severity, 5000), mean(sev_grid)))
## mean claim: exact 95.0575, on the grid 95.0161
cat(sprintf("annual gross: exact %.4f, on the grid %.4f\n", 10 * lev(severity, 5000), mean(gross)))
## annual gross: exact 950.5755, on the grid 950.1608
size <- recommend_grid(claims, severity)
cat(sprintf("recommend_grid on the unlimited lognormal: step %g; aggregate, which sees the 5,000 limit, used %g\n",
            size$step, agg_value("tower_gross", "bs")))
## recommend_grid on the unlimited lognormal: step 2; aggregate, which sees the 5,000 limit, used 4
cat(sprintf("aliasing error %.1e, mass beyond the grid %.1e\n", gross_report$aliasing_error, gross_report$tail_mass))
## aliasing error 8.7e-19, mass beyond the grid 5.4e-15
compare(S1, "mean claim, exact", "tower_gross", "sev_mean_exact", lev(severity, 5000))
compare(S1, "mean claim, grid", "tower_gross", "sev_mean_grid", mean(sev_grid))
compare(S1, "annual gross mean, exact", "tower_gross", "gross_mean_exact", 10 * lev(severity, 5000))
compare_distribution(S1, "gross", "tower_gross", "gross", gross, BS1)
report()
##  quantity                 aggregate   prospicio   difference pass
##  mean claim, exact          95.057547   95.057547 2.2e-15    yes 
##  mean claim, grid           95.016081   95.016081 2.2e-15    yes 
##  annual gross mean, exact  950.575470  950.575470 2.2e-15    yes 
##  gross mean                950.160810  950.160810 3.0e-12    yes 
##  gross sd                 1016.615600 1016.615600 2.2e-10    yes 
##  gross cv                    1.069941    1.069941 2.2e-10    yes 
##  gross skew                  2.864530    2.864530 3.5e-08    yes 
##  gross q0.5                632.000000  632.000000 0.00 bkt   yes 
##  gross q0.9               2024.000000 2024.000000 0.00 bkt   yes 
##  gross q0.99              5440.000000 5440.000000 0.00 bkt   yes 
##  gross q0.999             7412.000000 7412.000000 0.00 bkt   yes

The gross loss agrees with aggregate to rounding. The mean on the grid (950.16) is 0.044% below the exact mean (950.58) because rounding to buckets of 4 moves each claim a small amount. aggregate has the same difference, so the table compares grid with grid. The exact row checks the closed form (lev()) on both sides.

Choosing the bucket. Each section gives the bucket by hand only to match the grids of aggregate. In your own work, use compound_auto(): it calls recommend_grid() and compounds on the grid that it picks. These two functions get the unlimited lognormal, not the policy limit. On this book they pick 2 where aggregate, which sees the 5,000 limit, picks 4. The finer step is safer. Its discretisation moves the grid values away from the values of aggregate.

Now the tower. TOWER lists limit and attachment. tower_grids$ceded holds the annual ceded distribution of each layer.

TOWER <- list(c(250, 0), c(250, 250), c(500, 500), c(1000, 1000), c(3000, 2000))
layer_name <- function(lim, att) sprintf("%s xs %s", format(lim), format(att))
tower_layers <- lapply(TOWER, function(t) xol_layer(layer_name(t[1], t[2]), t[1], t[2]))
tower_grids <- tower_on_grid(reinsurance_tower(tower_layers), claims, sev_grid, POINTS)

layer_table <- NULL
for (i in seq_along(TOWER)) {
  lim <- TOWER[[i]][1]
  att <- TOWER[[i]][2]
  layer_grid <- tower_grids$ceded[[i]]
  name <- layer_name(lim, att)
  tag <- sprintf("layer_%sx%s", format(lim), format(att))  # the reference file's name
  ex <- "tower_gross"
  compare_distribution(S1, paste("layer", name), ex, paste0(tag, "_ceded"), layer_grid, BS1, shown = "mean")
  compare(S1, paste("layer", name, "mean, exact"), ex, paste0(tag, "_ceded_mean_exact"),
          10 * layer(severity, lim, att), show = FALSE)
  reaches <- 1 - cdf(sev_grid, att)
  cond <- layer(sev_grid, lim, att) / reaches
  compare(S1, paste("layer", name, "loss on line"), ex, paste0(tag, "_loss_on_line"), mean(layer_grid) / lim, show = FALSE)
  compare(S1, paste("layer", name, "P(claim reaches layer)"), ex, paste0(tag, "_pr_attach_grid"), reaches, show = FALSE)
  compare(S1, paste("layer", name, "P(claim exhausts layer)"), ex, paste0(tag, "_pr_detach_grid"),
          prob_at_least(sev_grid, att + lim), show = FALSE)
  compare(S1, paste("layer", name, "mean given it reaches"), ex, paste0(tag, "_cond_sev_mean"), cond, show = FALSE)
  layer_table <- rbind(layer_table, data.frame(
    layer = name, mean = mean(layer_grid), cv = moments(layer_grid)[["cv"]],
    `loss on line` = mean(layer_grid) / lim, `P(claim reaches)` = reaches, `mean | reaches` = cond,
    check.names = FALSE
  ))
}
print(layer_table, row.names = FALSE, digits = 5)
##         layer    mean      cv loss on line P(claim reaches) mean | reaches
##      250 xs 0 544.170 0.53797     2.176679        0.8970271         60.664
##    250 xs 250 133.053 1.27948     0.532212        0.0792485        167.893
##    500 xs 500 114.811 1.92411     0.229623        0.0362181        317.000
##  1000 xs 1000  87.092 3.08447     0.087092        0.0146557        594.252
##  3000 xs 2000  71.035 5.59935     0.023678        0.0051926       1367.998
cat(sprintf("claims below half a bucket, which round to 0: %.4f; exact mean claim in 250 xs 0: %.3f\n",
            cdf(severity, BS1 / 2), layer(severity, 250, 0)))
## claims below half a bucket, which round to 0: 0.1030; exact mean claim in 250 xs 0: 54.459
total <- sum(vapply(tower_grids$ceded, mean, numeric(1)))
compare(S1, "sum of layers equals gross", "tower_gross", "tower_ceded_total_mean", total)
cat(sprintf("layers add up to %.4f, gross is %.4f; on grid points: %s\n", total, mean(gross), tower_grids$on_points))
## layers add up to 950.1608, gross is 950.1608; on grid points: FALSE
report()
##  quantity                   aggregate prospicio difference pass
##  layer 250 xs 0 mean        544.16971 544.16971 2.1e-16    yes 
##  layer 250 xs 250 mean      133.05295 133.05295 1.3e-12    yes 
##  layer 500 xs 500 mean      114.81139 114.81139 3.3e-12    yes 
##  layer 1000 xs 1000 mean     87.09176  87.09176 4.1e-15    yes 
##  layer 3000 xs 2000 mean     71.03500  71.03500 1.5e-11    yes 
##  sum of layers equals gross 950.16081 950.16081 2.3e-12    yes

For each layer, the mean, standard deviation, skewness, quantiles, loss on line, attachment and exhaustion probabilities and conditional severity match aggregate’s single-layer builds. The table above shows the means, and the summary at the end shows the others. The “mean | reaches” column is conditional on the claim reaching the layer, as in aggregate’s reins_stats_df. The loss on line is the unconditional annual mean divided by the limit.

The first row shows that a tenth of the claims do not reach a layer that attaches at 0. The grid causes this: the lognormal puts 10.3% of claims below 2, half a bucket, and rounding moves them to 0, where they cede nothing. The 60.7 in the last column is therefore the mean over the 89.7% of claims that survive rounding; over all claims the exact mean claim in the layer is 54.5. aggregate reports the same 89.7% and 60.7.

tower_on_grid() says on_points is FALSE because the bucket of 4 does not divide 250. The layers still agree with aggregate, which splits them the same way. The flag warns that the split smears the shape of those two layers by up to a bucket. The split does not change their means.

2. Ceded and net of a program, and a share

The contract. The same book, with a program of two layers: 500 xs 500 and 1,000 xs 1,000, both at 100% and per occurrence. The reinsurer pays the loss in those layers, and the cedant keeps the remainder. A second placement is an 80% share of 1,000 xs 1,000.

In aggregate:

agg Re.T 10 claims 5000 xs 0 sev lognorm 100 cv 5 occurrence net of 500 xs 500 and 1000 xs 1000 poisson
agg Re.T 10 claims 5000 xs 0 sev lognorm 100 cv 5 occurrence ceded to 80% po 1000 xs 1000 poisson

In R. tower_on_grid() gives the net annual loss and the ceded loss of each layer. The two layers are contiguous. Thus the annual loss ceded to the program equals that of the single layer 1,500 xs 500, which tower_on_grid() also gives. For a program with a gap, map the severity grid through the layers and compound it. The chunk does this too and checks that the two results agree.

The share is xol_layer(share = 0.8). Its ceded grid has the step 0.8 * 4 = 3.2, so the share adds no rounding (the severity is still rounded to 4). aggregate re-buckets the share onto the grid of 4.

S2 <- "2 program"
PROGRAM <- list(c(500, 500), c(1000, 1000))
program_grids <- tower_on_grid(
  reinsurance_tower(lapply(PROGRAM, function(t) xol_layer(layer_name(t[1], t[2]), t[1], t[2]))),
  claims, sev_grid, POINTS
)
net <- program_grids$net

# The two layers are contiguous, so the whole program is the single layer 1,500 xs 500.
program_ceded <- tower_on_grid(reinsurance_tower(list(xol_layer("1500 xs 500", 1500, 500))),
                               claims, sev_grid, POINTS)$ceded[[1]]
# The way a program with a gap is built: map the severity through its layers, then compound.
ceded_severity <- map_grid(sev_grid, function(x) {
  Reduce(`+`, lapply(PROGRAM, function(t) pmin(pmax(x - t[2], 0), t[1])))
})$grid
mapped <- compound_distribution(claims, ceded_severity, POINTS, method = "fft")
cat(sprintf("single layer against the mapped severity: largest difference in probability %.1e\n\n",
            max(abs(program_ceded@probs - mapped@probs))))
## single layer against the mapped severity: largest difference in probability 2.2e-16
exact_ceded <- 10 * sum(vapply(PROGRAM, function(t) layer(severity, t[1], t[2]), numeric(1)))
exact_gross <- 10 * lev(severity, 5000)
program_table <- NULL
for (v in list(list("gross", gross, exact_gross), list("ceded", program_ceded, exact_ceded),
               list("net", net, exact_gross - exact_ceded))) {
  m <- moments(v[[2]])
  program_table <- rbind(program_table, data.frame(
    view = v[[1]], mean = m[["mean"]], `exact mean` = v[[3]], sd = m[["sd"]], cv = m[["cv"]],
    `99% quantile` = quantile(v[[2]], 0.99), check.names = FALSE
  ))
}
print(program_table, row.names = FALSE, digits = 5)
##   view   mean exact mean      sd     cv 99% quantile
##  gross 950.16     950.58 1016.62 1.0699         5440
##  ceded 201.90     201.90  456.13 2.2592         1824
##    net 748.26     748.67  640.66 0.8562         3836
compare_distribution(S2, "gross", "tower_program", "gross", gross, BS1, shown = c("mean", "q0.99"))
compare_distribution(S2, "ceded", "tower_program", "ceded", program_ceded, BS1)
compare_distribution(S2, "net", "tower_program", "net", net, BS1)
compare(S2, "ceded mean, exact", "tower_program", "ceded_mean_exact", exact_ceded)
compare(S2, "net mean, exact", "tower_program", "net_mean_exact", exact_gross - exact_ceded)
compare(S2, "net mean claim, grid", "tower_program", "net_sev_mean", mean(sev_grid) - mean(ceded_severity))
for (i in seq_along(PROGRAM)) {
  lim <- PROGRAM[[i]][1]
  att <- PROGRAM[[i]][2]
  tag <- sprintf("layer_%sx%s", format(lim), format(att))
  compare_distribution(S2, paste("layer", layer_name(lim, att)), "tower_program", paste0(tag, "_ceded"),
                       program_grids$ceded[[i]], BS1, shown = c("mean", "cv"))
}
report()
##  quantity                aggregate    prospicio    difference pass
##  gross mean               950.1608100  950.1608100 3.0e-12    yes 
##  gross q0.99             5440.0000000 5440.0000000 0.00 bkt   yes 
##  ceded mean               201.9031500  201.9031500 2.8e-13    yes 
##  ceded sd                 456.1313500  456.1313500 3.7e-11    yes 
##  ceded cv                   2.2591592    2.2591592 3.6e-11    yes 
##  ceded skew                 2.7608619    2.7608620 1.5e-08    yes 
##  ceded q0.5                 0.0000000    0.0000000 0.00 bkt   yes 
##  ceded q0.9               816.0000000  816.0000000 0.00 bkt   yes 
##  ceded q0.99             1824.0000000 1824.0000000 0.00 bkt   yes 
##  ceded q0.999            3000.0000000 3000.0000000 0.00 bkt   yes 
##  net mean                 748.2576700  748.2576700 2.4e-12    yes 
##  net sd                   640.6585600  640.6585600 5.7e-10    yes 
##  net cv                     0.8562005    0.8562005 5.7e-10    yes 
##  net skew                   2.9401290    2.9401295 1.6e-07    yes 
##  net q0.5                 616.0000000  616.0000000 0.00 bkt   yes 
##  net q0.9                1360.0000000 1360.0000000 0.00 bkt   yes 
##  net q0.99               3836.0000000 3836.0000000 0.00 bkt   yes 
##  net q0.999              4948.0000000 4948.0000000 0.00 bkt   yes 
##  ceded mean, exact        201.9037100  201.9037100 2.1e-15    yes 
##  net mean, exact          748.6717600  748.6717600 3.3e-15    yes 
##  net mean claim, grid      74.8257670   74.8257670 2.5e-15    yes 
##  layer 500 xs 500 mean    114.8113900  114.8113900 3.3e-12    yes 
##  layer 500 xs 500 cv        1.9241064    1.9241064 1.0e-09    yes 
##  layer 1000 xs 1000 mean   87.0917550   87.0917550 4.1e-15    yes 
##  layer 1000 xs 1000 cv      3.0844704    3.0844704 1.7e-15    yes

Gross, ceded and net all match, including the net view that aggregate holds in reins_density_df. Ceded and net add up in the mean (950.16 = 201.90 + 748.26) but not in the standard deviation: 456.1 + 640.7 = 1,096.8 is more than the gross 1,016.6. Ceded and net come from the same claims, so they move together, but not in lockstep. For example, a year of many small claims is all net. Thus the gross spread is less than the sum of the two. A reinsurer does not see this diversification from inside its own layer.

Now the 80% share of 1,000 xs 1,000.

share_grids <- tower_on_grid(
  reinsurance_tower(list(xol_layer("80% of 1000 xs 1000", 1000, 1000, share = 0.8))),
  claims, sev_grid, POINTS
)
share_ceded <- share_grids$ceded[[1]]
cat(sprintf("step of the ceded grid %g, mean %.4f, exact %.4f\n", share_ceded@step, mean(share_ceded),
            0.8 * 10 * layer(severity, 1000, 1000)))
## step of the ceded grid 3.2, mean 69.6734, exact 69.6735
compare_distribution(S2, "80% of 1000 xs 1000", "tower_program", "share80_1000x1000_ceded", share_ceded, BS1,
                     share = TRUE)
compare(S2, "80% of 1000 xs 1000 mean, exact", "tower_program", "share80_1000x1000_ceded_mean_exact",
        0.8 * 10 * layer(severity, 1000, 1000), show = FALSE)
report()
##  quantity                   aggregate   prospicio   difference pass
##  80% of 1000 xs 1000 mean     69.673404   69.673404 2.9e-13    yes 
##  80% of 1000 xs 1000 sd      214.906120  214.905550 2.6e-06    yes 
##  80% of 1000 xs 1000 cv        3.084478    3.084470 2.6e-06    yes 
##  80% of 1000 xs 1000 skew      3.398684    3.398689 1.5e-06    yes 
##  80% of 1000 xs 1000 q0.5      0.000000    0.000000 0.00 bkt   yes 
##  80% of 1000 xs 1000 q0.9    212.000000  211.200000 0.20 bkt   yes 
##  80% of 1000 xs 1000 q0.99   800.000000  800.000000 0.00 bkt   yes 
##  80% of 1000 xs 1000 q0.999 1600.000000 1600.000000 0.00 bkt   yes

The mean agrees to rounding. The standard deviation differs by 2.6e-6, the skewness by 1.5e-6, and the 90% quantile by 0.8, a fifth of a bucket. The cause is the re-bucketing in aggregate. It spreads each ceded amount between its buckets of 4 over the two adjacent buckets, which adds a little variance. prospicio keeps the ceded grid at step 3.2. Thus the standard deviation and quantiles of a share off the grid have their own tolerances (1e-5 and one bucket).

The gross, ceded and net annual distributions of the program:

xs <- (0:200) * 40
exceed <- function(grid, label) data.frame(x = xs, p = 1 - cdf(grid, xs), view = label)
ggplot(rbind(exceed(gross, "gross"), exceed(net, "net of the program"),
             exceed(program_ceded, "ceded to the program")), aes(x, p, colour = view)) +
  geom_line() +
  scale_y_log10(limits = c(1e-4, 1.2)) +
  labs(x = "annual loss (currency units)", y = "probability of exceeding",
       title = "Exceedance curves, 10 claims, 500 xs 500 and 1,000 xs 1,000")

3. An annual aggregate limit and reinstatements

The contract. Bear and Nemlick’s Treaty 2: three classes of business, each with subject premium 2,000, and expected layer loss 10%, 14% and 21% of it. The layer is 700 xs 300 of a single-parameter Pareto with shape 1.5, 1.3 and 1.1. This is a Lomax of that shape, with scale 300, limited to 700. The claim count is gamma-mixed Poisson with mixing CV 0.07, and all classes share one mixing variable. The treaty has an annual aggregate limit of 2,800: the original 700 plus three reinstatements.

agg Re.BN2 [2000 2000 2000] exposure at [.1 .14 .21] rate 700 xs 0
    sev 300 * pareto [1.5 1.3 1.1] - 300 mixed gamma 0.07              (bs = 1/8)
agg Re.BN2 ... aggregate ceded to 2800 xs 0

exposure at rate fixes the expected loss of each class, and aggregate solves the claim count from it. exposure_book() does the same with burr_distribution(shape, 1, scale) (the Lomax) and its limited expected value. The three counts check that step. With one shared mixing variable, the three classes are one mixed Poisson over a mixture of the three severities. Thus one FFT gives the gross annual loss.

Reinstatements. The two schedules are designed:

  • A: three reinstatements at 100%.
  • B: the first reinstatement free, the second at 50% and the third at 100%.

Both are pro rata as to amount, as in aggregate. In a year with layer loss L, the k-th reinstatement restores the k-th 700 of used limit. Its premium is deposit x rate_k x min(max(L - (k - 1) 700, 0), 700) / 700, summed over k = 1, 2, 3. aggregate computes it with its ReinstatementTerms on the annual layer loss.

The deposit of 1,200 (a rate on line of 171%) is a designed input to the comparison. It is not a price, and it does not come from the loss cost. The reinstatement premium is proportional to the deposit. Thus a price comes from the deposit that gives a target loss ratio. The chunk after the comparison solves for that deposit for each schedule.

S3 <- "3 limit and reinstatements"
BS3 <- 1 / 8
book3 <- exposure_book(rep(2000, 3), c(0.10, 0.14, 0.21), c(1.5, 1.3, 1.1), 300, 700)
counts3 <- book3$counts
n3 <- book3$n
mix3 <- book3$mix
freq3 <- mixed_poisson(n3, 0.07)
sev3 <- discretize_limited(mix3, BS3, 700)
gross3 <- compound_distribution(freq3, sev3, POINTS, method = "fft")
cat(sprintf("expected claims by class %s, total %.4f\n", paste(round(counts3, 4), collapse = ", "), n3))
## expected claims by class 0.737, 0.9236, 1.2342, total 2.8949
cat(sprintf("mass beyond the grid %.1e\n", gross3@report$tail_mass))
## mass beyond the grid 5.7e-10
for (i in seq_along(counts3)) {
  compare(S3, sprintf("class %d expected claims", i), "agg_limit_reinst", sprintf("class%d_expected_count", i), counts3[i])
}
compare(S3, "expected claims", "agg_limit_reinst", "claim_count_mean", n3)
compare(S3, "gross mean, exact", "agg_limit_reinst", "gross_mean_exact", n3 * lev(mix3, 700))
exact_cv3 <- sqrt(n3 * limited_second_moment(mix3, 700) + 0.07^2 * (n3 * lev(mix3, 700))^2) / (n3 * lev(mix3, 700))
compare(S3, "gross CV, exact", "agg_limit_reinst", "gross_cv_exact", exact_cv3)
compare_distribution(S3, "gross", "agg_limit_reinst", "gross", gross3, BS3)
report()
##  quantity                aggregate    prospicio    difference pass
##  class 1 expected claims    0.7370107    0.7370107 6.0e-16    yes 
##  class 2 expected claims    0.9236209    0.9236209 1.3e-15    yes 
##  class 3 expected claims    1.2342213    1.2342213 9.0e-16    yes 
##  expected claims            2.8948529    2.8948529 3.1e-16    yes 
##  gross mean, exact        900.0000000  900.0000000 1.3e-16    yes 
##  gross CV, exact            0.7696938    0.7696938 0.0e+00    yes 
##  gross mean               899.9999900  899.9999900 6.3e-14    yes 
##  gross sd                 692.7244200  692.7244200 1.4e-13    yes 
##  gross cv                   0.7696938    0.7696938 2.0e-13    yes 
##  gross skew                 0.9020683    0.9020689 6.1e-07    yes 
##  gross q0.5               785.7500000  785.7500000 0.00 bkt   yes 
##  gross q0.9              1843.0000000 1843.0000000 0.00 bkt   yes 
##  gross q0.99             2917.1250000 2917.1250000 0.00 bkt   yes 
##  gross q0.999            3816.2500000 3816.2500000 0.00 bkt   yes
limit_layer <- xol_layer("2800 aggregate limit", 700, 0, aggregate_limit = 2800)
limited <- tower_on_grid(reinsurance_tower(list(limit_layer)), freq3, sev3, POINTS)$ceded[[1]]
beyond <- stop_loss(gross3, 2800)
cat(sprintf("mean recovery %s, P(limit used up) %.5f, loss above the limit %.4f\n",
            money(mean(limited)), prob_at_least(gross3, 2800), beyond))
## mean recovery 894.68, P(limit used up) 0.01370, loss above the limit 5.3193
compare_distribution(S3, "recovery under 2800", "agg_limit_reinst", "agglimit2800_ceded", limited, BS3,
                     shown = c("mean", "sd", "q0.99"))
compare(S3, "P(limit used up)", "agg_limit_reinst", "agglimit2800_pr_hit", prob_at_least(gross3, 2800))
compare(S3, "loss above the limit", "agg_limit_reinst", "agglimit2800_mean_loss_beyond", beyond, "tail")
report()
##  quantity                  aggregate    prospicio    difference pass
##  recovery under 2800 mean   894.6806800  894.6806800 3.4e-09    yes 
##  recovery under 2800 sd     674.9458400  674.9458200 3.1e-08    yes 
##  recovery under 2800 q0.99 2800.0000000 2800.0000000 0.00 bkt   yes 
##  P(limit used up)             0.0137006    0.0137006 4.1e-08    yes 
##  loss above the limit         5.3193114    5.3193144 5.7e-07    yes
DEPOSIT <- 1200
LIMIT3 <- 700
TARGET_LR <- 0.65
per_deposit <- list()
for (sch in list(list("A", c(1, 1, 1)), list("B", c(0, 0.5, 1)))) {
  tag <- sch[[1]]
  rates <- sch[[2]]
  lyr <- with_deposit_premium(xol_layer(paste("schedule", tag), LIMIT3, 0, reinstatement_rates = rates), DEPOSIT)
  grids <- tower_on_grid(reinsurance_tower(list(lyr)), freq3, sev3, POINTS)
  reinstatement <- unname(grids$expected_reinstatement_premium[1])
  recovery <- mean(grids$ceded[[1]])
  total_premium <- lyr@premium + reinstatement
  per_deposit[[tag]] <- c(k = reinstatement / lyr@premium, recovery = recovery)
  cat(sprintf("schedule %s (%s): deposit %s (rate on line %.0f%%), expected reinstatement premium %s, total %s\n",
              tag, paste(rates, collapse = ", "), money(lyr@premium), 100 * lyr@premium / LIMIT3,
              money(reinstatement), money(total_premium)))
  cat(sprintf("    expected recovery %s, loss ratio %.1f%%, margin %s\n", money(recovery),
              100 * recovery / total_premium, money(total_premium - recovery)))
  compare(S3, paste0(tag, ": expected reinstatement premium"), "agg_limit_reinst", paste0("reinst", tag, "_premium_mean"), reinstatement)
  compare(S3, paste0(tag, ": total premium"), "agg_limit_reinst", paste0("reinst", tag, "_total_premium_mean"), total_premium)
  compare(S3, paste0(tag, ": recovery"), "agg_limit_reinst", paste0("reinst", tag, "_recovery_mean"), recovery)
  compare(S3, paste0(tag, ": P(any loss to the layer)"), "agg_limit_reinst", paste0("reinst", tag, "_pr_any_reinstatement"),
          1 - gross3@probs[1])
  compare(S3, paste0(tag, ": maximum premium"), "agg_limit_reinst", paste0("reinst", tag, "_max_premium"),
          lyr@premium * sum(rates), show = FALSE, check = TRUE)
}
## schedule A (1, 1, 1): deposit 1,200.00 (rate on line 171%), expected reinstatement premium 1,495.57, total 2,695.57
##     expected recovery 894.68, loss ratio 33.2%, margin 1,800.89
## schedule B (0, 0.5, 1): deposit 1,200.00 (rate on line 171%), expected reinstatement premium 371.58, total 1,571.58
##     expected recovery 894.68, loss ratio 56.9%, margin 676.90
report()
##  quantity                          aggregate    prospicio    difference pass
##  A: expected reinstatement premium 1495.5693000 1495.5693000 1.4e-09    yes 
##  A: total premium                  2695.5693000 2695.5693000 7.5e-10    yes 
##  A: recovery                        894.6806800  894.6806800 1.8e-09    yes 
##  A: P(any loss to the layer)          0.9435139    0.9435139 6.0e-10    yes 
##  B: expected reinstatement premium  371.5810200  371.5810200 2.7e-09    yes 
##  B: total premium                  1571.5810000 1571.5810000 6.5e-10    yes 
##  B: recovery                        894.6806800  894.6806800 1.8e-09    yes 
##  B: P(any loss to the layer)          0.9435139    0.9435139 6.0e-10    yes
# The deposit that prices each schedule at the target loss ratio. The total premium is the deposit
# times (1 + k), where k is the expected reinstatement premium per unit of deposit.
cat("\n")
for (tag in names(per_deposit)) {
  k <- per_deposit[[tag]][["k"]]
  recovery <- per_deposit[[tag]][["recovery"]]
  deposit <- recovery / TARGET_LR / (1 + k)
  cat(sprintf("schedule %s: a deposit of %s (rate on line %.0f%%) prices it at a %.0f%% loss ratio, total %s, %.0f%% of it from reinstatements\n",
              tag, money(deposit), 100 * deposit / LIMIT3, 100 * TARGET_LR, money(deposit * (1 + k)),
              100 * k / (1 + k)))
}
## schedule A: a deposit of 612.75 (rate on line 88%) prices it at a 65% loss ratio, total 1,376.43, 55% of it from reinstatements
## schedule B: a deposit of 1,050.99 (rate on line 150%) prices it at a 65% loss ratio, total 1,376.43, 24% of it from reinstatements

The expected reinstatement premium and the recovery agree to 1e-8 or better. The recovery under schedule A or B is the same 894.68, because both schedules have the same annual limit of 2,800. It is the mean of the aggregate-limit layer above. aggregate’s probability of a reinstatement is the probability of any loss to the layer, P(L > 0). Under schedule B the first reinstatement is free, so a reinstatement premium is due only when L is more than 700.

At the designed deposit, schedule A collects 2,695.57 against an expected recovery of 894.68 (a 33% loss ratio) and B collects 1,571.58 (57%). Priced to the same 65% loss ratio, both collect 1,376.43 in expectation, but A needs the smaller deposit. A charges for each reinstatement, so more of its premium comes after losses and less comes at the start. The schedule moves premium between the deposit and the loss-contingent part. It does not change the expected total.

The stop loss at 2,800 (the loss above the limit) has the one looser tolerance in this section, because it reads the far tail. prospicio keeps the 6e-10 of probability beyond the grid’s top on its last point, and aggregate removes it. That shifts the result by 6e-7 relative, inside its tolerance of 1e-5.

The gross annual loss and the recovery under the limit. The steps at multiples of 700 are probability mass from claims at the 700 limit:

xs <- (0:420) * 10
ggplot(rbind(data.frame(x = xs, p = 1 - cdf(gross3, xs), view = "gross annual layer loss"),
             data.frame(x = xs, p = 1 - cdf(limited, xs), view = "recovery under the 2,800 limit")),
       aes(x, p, colour = view)) +
  geom_line() +
  geom_vline(xintercept = 2800, linetype = "dashed", colour = "grey50") +
  scale_y_log10(limits = c(1e-4, 1.2)) +
  labs(x = "annual loss (currency units)", y = "probability of exceeding",
       title = "Treaty 2: the limit cuts the tail at 2,800")

4. Aggregate stop loss and aggregate deductible

Stop loss. On the book of section 1, four covers on the annual total. They are 250 xs 750, 1,500 xs 1,000, the two together (750 to 2,500) and a 50% share of 1,500 xs 1,000. aggregate_stop_loss(name, limit, retention) builds the first three covers at 100%. For the 50% share, the chunk uses xol_layer(share = 0.5) with no per-occurrence limit, and the retention and limit as annual terms. The book has no premium, so the covers are in amounts. The market usually quotes a stop loss in loss ratio points of subject premium, and the amount is the points times the premium. On a subject premium of 1,000 (an expected loss ratio of 95%), 250 xs 750 is 25% xs 75%.

agg Re.T 10 claims 5000 xs 0 sev lognorm 100 cv 5 poisson aggregate ceded to 250 xs 750
agg Re.T ...                                    poisson aggregate ceded to 50% po 1500 xs 1000

Aggregate deductible. Bear and Nemlick’s Treaty 1: the 160 xs 40 layer of a single-parameter Pareto with shape 0.9 and 0.95 on two classes. The subject premiums are 9,000 and 3,000, with expected layer loss 4% and 3% of them, 450 in total. The count is gamma-mixed Poisson, with the mixing CV ((1.036 - 1) / 5.154)^0.5 that gives the CV in the text. The reinsurer pays above an annual aggregate deductible of 360 (3% of 12,000), aggregate net of 360 xs 0 in aggregate.

The guide’s table gives the subject premiums as 3,000 and 6,000. Its code uses 9,000 and 3,000 at 4% and 3%, which gives the 450 (3.75% of 12,000) in its Treaty 4 text. This document uses the values of the code.

S4 <- "4 stop loss"
annual_cover <- function(lyr) tower_on_grid(reinsurance_tower(list(lyr)), claims, sev_grid, POINTS)

for (t in list(c(250, 750), c(1500, 1000))) {
  lim <- t[1]
  att <- t[2]
  name <- layer_name(lim, att)
  cover <- annual_cover(aggregate_stop_loss(name, lim, att))
  tag <- sprintf("asl_%sx%s", format(lim), format(att))
  compare_distribution(S4, name, "stop_loss", paste0(tag, "_ceded"), cover$ceded[[1]], BS1,
                       shown = c("mean", "cv", "q0.9"))
  compare(S4, paste(name, "P(attach)"), "stop_loss", paste0(tag, "_pr_attach"), 1 - cdf(gross, att))
  compare(S4, paste(name, "P(exhaust)"), "stop_loss", paste0(tag, "_pr_exhaust"), prob_at_least(gross, att + lim))
  compare(S4, paste(name, "loss on line"), "stop_loss", paste0(tag, "_loss_on_line"), mean(cover$ceded[[1]]) / lim)
}

both <- annual_cover(aggregate_stop_loss("750 to 2500", 1750, 750))
# aggregate_stop_loss takes no share: a share of a stop loss is a layer with no per-occurrence limit
# and the retention and limit as annual terms.
half <- annual_cover(xol_layer("50% of 1500 xs 1000", Inf, 0, share = 0.5,
                               aggregate_deductible = 1000, aggregate_limit = 1500))
compare_distribution(S4, "both layers, ceded", "stop_loss", "asl_both_ceded", both$ceded[[1]], BS1,
                     shown = c("mean", "cv"))
compare_distribution(S4, "both layers, net", "stop_loss", "asl_both_net", both$net, BS1,
                     shown = c("mean", "cv", "q0.9"))
compare_distribution(S4, "50% of 1500 xs 1000", "stop_loss", "asl_50pct_1500x1000_ceded", half$ceded[[1]], BS1,
                     share = TRUE, shown = c("mean", "cv"))
cat(sprintf("750 to 2,500: ceded %.3f + net %.3f = %.3f\n", mean(both$ceded[[1]]), mean(both$net), mean(gross)))
## 750 to 2,500: ceded 310.061 + net 640.100 = 950.161
report()
##  quantity                  aggregate    prospicio    difference pass
##  250 xs 750 mean           8.980600e+01 8.980600e+01 1.9e-14    yes 
##  250 xs 750 cv             1.276028e+00 1.276028e+00 1.4e-14    yes 
##  250 xs 750 q0.9           2.520000e+02 2.520000e+02 0.00 bkt   yes 
##  250 xs 750 P(attach)      4.237867e-01 4.237867e-01 1.1e-13    yes 
##  250 xs 750 P(exhaust)     3.036543e-01 3.036543e-01 1.6e-13    yes 
##  250 xs 750 loss on line   3.592240e-01 3.592240e-01 1.8e-14    yes 
##  1500 xs 1000 mean         2.202549e+02 2.202549e+02 3.9e-14    yes 
##  1500 xs 1000 cv           2.032216e+00 2.032216e+00 1.6e-14    yes 
##  1500 xs 1000 q0.9         1.024000e+03 1.024000e+03 0.00 bkt   yes 
##  1500 xs 1000 P(attach)    3.020880e-01 3.020880e-01 1.6e-13    yes 
##  1500 xs 1000 P(exhaust)   6.724044e-02 6.724044e-02 7.0e-13    yes 
##  1500 xs 1000 loss on line 1.468366e-01 1.468366e-01 3.9e-14    yes 
##  both layers, ceded mean   3.100609e+02 3.100609e+02 3.2e-14    yes 
##  both layers, ceded cv     1.718899e+00 1.718899e+00 1.2e-14    yes 
##  both layers, net mean     6.400999e+02 6.400999e+02 2.2e-12    yes 
##  both layers, net cv       9.104097e-01 9.104097e-01 5.4e-10    yes 
##  both layers, net q0.9     7.520000e+02 7.520000e+02 0.00 bkt   yes 
##  50% of 1500 xs 1000 mean  1.101274e+02 1.101274e+02 3.9e-14    yes 
##  50% of 1500 xs 1000 cv    2.032231e+00 2.032216e+00 7.4e-06    yes

The stop-loss covers agree on every statistic. The 50% share differs off the grid for the same reason as the 80% share in section 2.

The aggregate deductible:

S4B <- "4 aggregate deductible"
BS4 <- 0.0625
MIX_CV4 <- sqrt((1.036 - 1) / 5.154)
book4 <- exposure_book(c(9000, 3000), c(0.04, 0.03), c(0.9, 0.95), 40, 160)
counts4 <- book4$counts
n4 <- book4$n
mix4 <- book4$mix
sev4 <- discretize_limited(mix4, BS4, 160)
aad <- reinsurance_tower(list(xol_layer("AAD 360", Inf, 0, aggregate_deductible = 360)))

gross4 <- compound_distribution(mixed_poisson(n4, MIX_CV4), sev4, POINTS, method = "fft")
after_aad <- tower_on_grid(aad, mixed_poisson(n4, MIX_CV4), sev4, POINTS)$ceded[[1]]
gross4_poisson <- compound_distribution(poisson_count(n4), sev4, POINTS, method = "fft")
after_aad_poisson <- tower_on_grid(aad, poisson_count(n4), sev4, POINTS)$ceded[[1]]

absorbed <- lev(gross4, 360)
cat(sprintf("expected claims %.4f, gross CV %.4f (the text quotes 0.528)\n", n4, moments(gross4)[["cv"]]))
## expected claims 6.4966, gross CV 0.5285 (the text quotes 0.528)
cat(sprintf("expected loss %s; after the deductible %s; absorbed by the deductible %s\n",
            money(mean(gross4)), money(mean(after_aad)), money(absorbed)))
## expected loss 450.00; after the deductible 142.76; absorbed by the deductible 307.24
cat(sprintf("loss elimination ratio (the cedant's credit) %.4f; excess ratio (the reinsurer's share, aggregate's insurance charge) %.4f\n",
            absorbed / mean(gross4), mean(after_aad) / mean(gross4)))
## loss elimination ratio (the cedant's credit) 0.6828; excess ratio (the reinsurer's share, aggregate's insurance charge) 0.3172
cat(sprintf("with Poisson counts the loss after the deductible falls to %s\n", money(mean(after_aad_poisson))))
## with Poisson counts the loss after the deductible falls to 141.80
for (i in seq_along(counts4)) {
  compare(S4B, sprintf("class %d expected claims", i), "stop_loss_aad", sprintf("class%d_expected_count", i),
          counts4[i], show = FALSE)
}
compare(S4B, "gross mean, exact", "stop_loss_aad", "gross_mean_exact", n4 * lev(mix4, 160))
exact_cv4 <- sqrt(n4 * limited_second_moment(mix4, 160) + MIX_CV4^2 * (n4 * lev(mix4, 160))^2) / (n4 * lev(mix4, 160))
compare(S4B, "gross CV, exact", "stop_loss_aad", "gross_cv_exact", exact_cv4)
compare_distribution(S4B, "gross", "stop_loss_aad", "gross", gross4, BS4, shown = c("mean", "cv", "q0.99"))
compare_distribution(S4B, "after the deductible", "stop_loss_aad", "after_aad", after_aad, BS4)
compare(S4B, "value of the deductible", "stop_loss_aad", "aad_value", absorbed)
compare(S4B, "excess ratio (insurance charge)", "stop_loss_aad", "aad_insurance_charge",
        mean(after_aad) / mean(gross4))
compare_distribution(S4B, "Poisson, after the deductible", "stop_loss_aad", "poisson_after_aad",
                     after_aad_poisson, BS4, shown = c("mean", "cv"))
compare(S4B, "Poisson gross mean", "stop_loss_aad", "poisson_gross_mean", mean(gross4_poisson), show = FALSE)
report()
##  quantity                           aggregate    prospicio    difference pass
##  gross mean, exact                   450.0000000  450.0000000 0.0e+00    yes 
##  gross CV, exact                       0.5284975    0.5284975 4.2e-16    yes 
##  gross mean                          449.9999800  449.9999800 2.2e-12    yes 
##  gross cv                              0.5284975    0.5284975 2.0e-11    yes 
##  gross q0.99                        1103.6250000 1103.6250000 0.00 bkt   yes 
##  after the deductible mean           142.7589700  142.7589700 9.9e-13    yes 
##  after the deductible sd             183.7796100  183.7796100 7.1e-12    yes 
##  after the deductible cv               1.2873420    1.2873420 6.1e-12    yes 
##  after the deductible skew             1.5338445    1.5338445 1.6e-10    yes 
##  after the deductible q0.5            64.1875000   64.1875000 0.00 bkt   yes 
##  after the deductible q0.9           409.0000000  409.0000000 0.00 bkt   yes 
##  after the deductible q0.99          743.6250000  743.6250000 0.00 bkt   yes 
##  after the deductible q0.999        1016.8125000 1016.8125000 0.00 bkt   yes 
##  value of the deductible             307.2410100  307.2410100 3.5e-14    yes 
##  excess ratio (insurance charge)       0.3172422    0.3172422 4.6e-12    yes 
##  Poisson, after the deductible mean  141.7994800  141.7994800 9.5e-13    yes 
##  Poisson, after the deductible cv      1.2794188    1.2794188 6.0e-12    yes

aggregate net of 360 xs 0 removes the first 360 of the loss each year (the cedant’s deductible). Thus its density is the reinsurer’s loss above 360, and xol_layer(aggregate_deductible = 360) gives that side too. The value of the deductible to the cedant is E[min(X, 360)], lev(grid, 360): 307.24, a loss elimination ratio of 68.3% of the 450 expected loss. The other 31.7%, the excess ratio, goes to the reinsurer. aggregate calls that ratio the insurance charge: the Table M charge at an entry ratio of 360 / 450 = 0.8.

5. Retro and swing premium, profit commission and sliding scale

Four contracts with a price that depends on the loss. In aggregate, each is a map phi of the annual loss, from aggregate.contract_terms, applied to the density. In prospicio they are terms of the layer, and tower_on_grid() averages them over the annual distribution (expected_premium, expected_profit_commission, expected_ceding_commission).

Retro rating (Treaty 4). The Treaty 1 book with Poisson counts, and the full 160 xs 40 layer at 100%. The subject premium is 12,000, the loss conversion factor 100/75, the minimum rate 3% (360) and the maximum rate 10% (1,200). The premium is clip(lcf x loss, 360, 1200). The terms are rates on subject premium, and the loss is an amount. The map uses amounts, so the chunk multiplies each rate by 12,000. This is a swing premium with no basic premium, with_swing_rating(layer, 0, lcf, 360, 1200). retro_premium() is the same map as a stand-alone function.

Swing rating (designed). The same loss, with premium clip(300 + 1.25 loss, 360, 1200), at 100% and at a 40% placed share. The terms are for 100%. prospicio scales the basic premium, the minimum and the maximum by the share, as aggregate’s underwriter does. It does not scale the loss conversion factor.

Profit commission (Treaty 5). Three independent years of the Treaty 2 book with Poisson counts, so the sum is a compound Poisson with three times the claim count. The reinsurer takes 80% of the layer for a ceded premium of 4,500 (25% of 18,000). The profit commission is 25% of the remainder after a 20% allowance and the losses, 0.25 max(0, 1 - 0.2 - LR), with the loss ratio on the ceded premium. This is the one-period form: the commission is settled once on the three-year total, with no deficit carried forward from a bad year. The years are independent, so the chunk drops the mixing variable of Treaty 2. A deficit carry-forward, or a mixing variable shared by the years, would make the commission more variable. It would also change the difference between its mean and its value at the expected loss ratio.

Sliding scale (Treaty 6). A 900 xs 100 layer of a Pareto with shape 1.05 on 25,000 of subject premium, with ceded premium 5,000. The expected loss is 2,500 and the gamma mixing CV is 0.095. The commission is 40% at or below a 35% loss ratio, 25% at 55% and 20% at 65%. It is linear between these points and flat outside them.

S5 <- "5 retro and swing"
BS5 <- 0.0625
book5 <- exposure_book(c(9000, 3000), c(0.04, 0.03), c(0.9, 0.95), 40, 160)
n5 <- book5$n
sev5 <- discretize_limited(book5$mix, BS5, 160)
LCF <- 100 / 75

retro <- with_swing_rating(xol_layer("retro", Inf, 0), 0, LCF, 360, 1200)
retro_grids <- tower_on_grid(reinsurance_tower(list(retro)), poisson_count(n5), sev5, POINTS)
layer_loss <- retro_grids$ceded[[1]]

# The same premium from the stand-alone map, averaged by hand over the annual distribution.
points <- (seq_along(layer_loss@probs) - 1) * layer_loss@step
by_hand <- sum(retro_premium(points, 0, LCF, 360, 1200) * layer_loss@probs)
at_min <- sum(layer_loss@probs[LCF * points <= 360])
at_max <- sum(layer_loss@probs[LCF * points >= 1200])
retro_mean <- unname(retro_grids$expected_premium[1])

cat(sprintf("expected layer loss %s, expected retro premium %s (%.3f%% of 12,000)\n",
            money(mean(layer_loss)), money(retro_mean), 100 * retro_mean / 12000))
## expected layer loss 450.00, expected retro premium 624.51 (5.204% of 12,000)
cat(sprintf("P(minimum premium) %.4f, P(maximum premium) %.4f\n", at_min, at_max))
## P(minimum premium) 0.2397, P(maximum premium) 0.0418
compare_distribution(S5, "layer loss", "variable_retro", "ceded_loss", layer_loss, BS5,
                     shown = c("mean", "cv", "q0.99"))
compare(S5, "retro premium", "variable_retro", "retro_premium_mean", retro_mean)
compare(S5, "retro premium, retro_premium()", "variable_retro", "retro_premium_mean_via_terms", by_hand)
compare(S5, "retro rate on subject premium", "variable_retro", "retro_rate_mean", retro_mean / 12000)
compare(S5, "P(minimum premium)", "variable_retro", "pr_min_binds", at_min)
compare(S5, "P(maximum premium)", "variable_retro", "pr_max_binds", at_max)

for (s in list(list(1, "share100"), list(0.4, "share40"))) {
  swing <- with_swing_rating(xol_layer("swing", Inf, 0, share = s[[1]]), 300, 1.25, 360, 1200)
  premium <- unname(tower_on_grid(reinsurance_tower(list(swing)), poisson_count(n5), sev5, POINTS)$expected_premium[1])
  cat(sprintf("swing premium at %.0f%% placed: %s\n", 100 * s[[1]], money(premium)))
  compare(S5, sprintf("swing premium, %.0f%% placed", 100 * s[[1]]), "variable_swing", paste0(s[[2]], "_premium_mean"), premium)
}
## swing premium at 100% placed: 838.32
## swing premium at 40% placed: 335.33
report()
##  quantity                       aggregate    prospicio    difference pass
##  layer loss mean                4.500000e+02 4.500000e+02 3.3e-13    yes 
##  layer loss cv                  5.218474e-01 5.218474e-01 3.5e-12    yes 
##  layer loss q0.99               1.092500e+03 1.092500e+03 0.00 bkt   yes 
##  retro premium                  6.245097e+02 6.245097e+02 4.6e-13    yes 
##  retro premium, retro_premium() 6.245097e+02 6.245097e+02 6.9e-14    yes 
##  retro rate on subject premium  5.204248e-02 5.204248e-02 4.6e-13    yes 
##  P(minimum premium)             2.396508e-01 2.396508e-01 1.7e-15    yes 
##  P(maximum premium)             4.182375e-02 4.182375e-02 8.6e-13    yes 
##  swing premium, 100% placed     8.383194e+02 8.383194e+02 3.4e-13    yes 
##  swing premium, 40% placed      3.353277e+02 3.353277e+02 3.5e-13    yes
S5B <- "5 profit commission"
BS5B <- 0.25
book5b <- exposure_book(rep(2000, 3), c(0.10, 0.14, 0.21), c(1.5, 1.3, 1.1), 300, 700)
sev5b <- discretize_limited(book5b$mix, BS5B, 700)
three_years <- poisson_count(3 * book5b$n)  # three independent years of Poisson counts

PREMIUM5B <- 0.25 * 18000
pc_layer <- with_profit_commission(
  xol_layer("treaty 5", 700, 0, share = 0.8, premium = PREMIUM5B), 0.25, allowance = 0.2
)
pc_grids <- tower_on_grid(reinsurance_tower(list(pc_layer)), three_years, sev5b, POINTS)
total_loss <- compound_distribution(three_years, sev5b, POINTS, method = "fft")
pc_ceded <- pc_grids$ceded[[1]]
lr <- mean(pc_ceded) / PREMIUM5B
commission <- unname(pc_grids$expected_profit_commission[1])
at_expected_pc <- profit_commission_for(pc_layer, mean(pc_ceded)) / PREMIUM5B

cat(sprintf("three years: expected loss %s, CV %.4f\n", money(mean(total_loss)), moments(total_loss)[["cv"]]))
## three years: expected loss 2,700.00, CV 0.4425
cat(sprintf("ceded loss ratio %.4f; expected profit commission %s = %.3f%% of the ceded premium\n",
            lr, money(commission), 100 * commission / PREMIUM5B))
## ceded loss ratio 0.4800; expected profit commission 370.72 = 8.238% of the ceded premium
cat(sprintf("at the expected loss ratio alone it would be %.3f%%\n", 100 * at_expected_pc))
## at the expected loss ratio alone it would be 8.000%
compare_distribution(S5B, "three-year loss", "variable_pc", "three_year_loss", total_loss, BS5B,
                     shown = c("mean", "cv", "q0.99"))
compare(S5B, "ceded loss ratio", "variable_pc", "ceded_lr_mean", lr)
compare(S5B, "profit commission", "variable_pc", "pc_amount_mean", commission)
compare(S5B, "profit commission rate", "variable_pc", "pc_rate_mean", commission / PREMIUM5B)
compare(S5B, "rate at the expected loss ratio", "variable_pc", "pc_at_expected_lr", at_expected_pc)
pc_points <- (seq_along(pc_ceded@probs) - 1) * pc_ceded@step
compare(S5B, "P(profit commission > 0)", "variable_pc", "pr_pc_positive",
        sum(pc_ceded@probs[pc_points / PREMIUM5B < 1 - 0.2]))
report()
##  quantity                        aggregate    prospicio    difference pass
##  three-year loss mean            2.700000e+03 2.700000e+03 1.8e-12    yes 
##  three-year loss cv              4.425414e-01 4.425414e-01 1.6e-11    yes 
##  three-year loss q0.99           5.900250e+03 5.900250e+03 0.00 bkt   yes 
##  ceded loss ratio                4.800000e-01 4.800000e-01 3.4e-13    yes 
##  profit commission               3.707250e+02 3.707250e+02 1.4e-15    yes 
##  profit commission rate          8.238332e-02 8.238332e-02 1.3e-15    yes 
##  rate at the expected loss ratio 8.000000e-02 8.000000e-02 5.1e-13    yes 
##  P(profit commission > 0)        9.227560e-01 9.227560e-01 1.2e-15    yes
S5C <- "5 sliding scale"
BS5C <- 0.5
book5c <- exposure_book(25000, 0.10, 1.05, 100, 900)
n5c <- book5c$n
sev5c <- discretize_limited(book5c$mix, BS5C, 900)
frequency5c <- mixed_poisson(n5c, 0.095)

PREMIUM5C <- 25000 * 0.20
slide <- with_sliding_scale(xol_layer("treaty 6", 900, 0, premium = PREMIUM5C),
                            commission = c(0.40, 0.25, 0.20), loss_ratio = c(0.35, 0.55, 0.65))
slide_grids <- tower_on_grid(reinsurance_tower(list(slide)), frequency5c, sev5c, POINTS)
slide_loss <- slide_grids$ceded[[1]]
slide_commission <- unname(slide_grids$expected_ceding_commission[1])
at_expected <- ceding_commission_for(slide, mean(slide_loss)) / PREMIUM5C
lr_x <- ((seq_along(slide_loss@probs) - 1) * slide_loss@step) / PREMIUM5C
lr_p <- slide_loss@probs

cat(sprintf("expected claims %.4f; expected ceded loss %s, loss ratio %.3f\n", n5c, money(mean(slide_loss)),
            mean(slide_loss) / PREMIUM5C))
## expected claims 11.4944; expected ceded loss 2,500.00, loss ratio 0.500
cat(sprintf("expected commission %s = %.2f%% of premium\n", money(slide_commission), 100 * slide_commission / PREMIUM5C))
## expected commission 1,517.10 = 30.34% of premium
cat(sprintf("commission at the expected loss ratio %.2f%%\n", 100 * at_expected))
## commission at the expected loss ratio 28.75%
# The gap between the two comes from where the scale leaves its middle segment (slope -0.75),
# extended in a straight line: capped at 40% below a 35% loss ratio, flatter above 55%.
scale_at <- ceding_commission_for(slide, lr_x * PREMIUM5C) / PREMIUM5C
middle <- 0.40 - 0.75 * (lr_x - 0.35)
below <- sum(lr_p[lr_x < 0.35] * (scale_at - middle)[lr_x < 0.35])
above <- sum(lr_p[lr_x > 0.55] * (scale_at - middle)[lr_x > 0.55])
cat(sprintf("against the middle segment extended, years below a 35%% loss ratio take %.2f%% off the expected commission and years above 55%% add %.2f%%\n",
            -100 * below, 100 * above))
## against the middle segment extended, years below a 35% loss ratio take 2.53% off the expected commission and years above 55% add 4.12%
compare(S5C, "expected claims", "variable_slide", "claim_count_mean", n5c, show = FALSE)
compare_distribution(S5C, "ceded loss", "variable_slide", "ceded_loss", slide_loss, BS5C,
                     shown = c("mean", "cv", "q0.99"))
compare(S5C, "ceded loss ratio", "variable_slide", "ceded_lr_mean", mean(slide_loss) / PREMIUM5C)
compare(S5C, "expected commission", "variable_slide", "slide_commission_amount_mean", slide_commission)
compare(S5C, "expected commission rate", "variable_slide", "slide_commission_rate_mean", slide_commission / PREMIUM5C)
compare(S5C, "rate at the expected loss ratio", "variable_slide", "slide_commission_at_expected_lr", at_expected)
compare(S5C, "P(loss ratio <= 35%)", "variable_slide", "pr_lr_below_35", sum(lr_p[lr_x <= 0.35]))
compare(S5C, "P(loss ratio >= 65%)", "variable_slide", "pr_lr_above_65", sum(lr_p[lr_x >= 0.65]))
report()
##  quantity                        aggregate    prospicio    difference pass
##  ceded loss mean                 2499.9988000 2499.9988000 3.5e-13    yes 
##  ceded loss cv                      0.4851601    0.4851601 8.1e-12    yes 
##  ceded loss q0.99                5855.0000000 5855.0000000 0.00 bkt   yes 
##  ceded loss ratio                   0.4999998    0.4999998 3.5e-13    yes 
##  expected commission             1517.1043000 1517.1043000 9.2e-14    yes 
##  expected commission rate           0.3034209    0.3034209 9.2e-14    yes 
##  rate at the expected loss ratio    0.2875002    0.2875002 4.6e-13    yes 
##  P(loss ratio <= 35%)               0.2950800    0.2950800 8.1e-15    yes 
##  P(loss ratio >= 65%)               0.2485447    0.2485447 1.1e-13    yes

All four agree. Three notes:

  • A variable premium or commission is a function of the full annual distribution, not of the expected loss. The average of a non-linear map differs from the map at the average. The profit commission, 0.25 max(0, 0.8 - LR), is convex in the loss ratio, so its average (8.24% of premium) is above its value at the expected loss ratio (8.00%), as Jensen’s inequality requires. The sliding scale is not convex: it bends down at 35% (where it stops at 40%) and up at 55% and 65%. Its average (30.3%) is above its value at the expected loss ratio (28.8%) only because this loss ratio is skewed to the right. The years above 55%, where the scale is flat, add more than the 29.5% of years below 35% take off. The chunk above splits the difference.

    For a book with a different spread, the difference could have the other sign. The expected_* results average the terms over the distribution. A price from the expected loss alone does not include this effect.

  • aggregate’s documentation for the sliding scale builds the schedule in code with a slope of 0.25 on the first segment. Its text says 0.75. That code gives a commission of 35.7%, not 30.3%. The table compares the terms in the text, which with_sliding_scale() takes.

  • aggregate’s profit commission does not deduct a ceding commission. with_profit_commission() does the same, and its allowance covers any commission that the contract takes before profit.

The commission scale and the loss ratio it applies to:

dx <- slide_loss@step / PREMIUM5C
upto <- lr_x <= 0.8
density_df <- data.frame(lr = lr_x[upto], density = lr_p[upto] / dx)
scale_df <- data.frame(lr = (0:160) / 200)
scale_df$commission <- ceding_commission_for(slide, scale_df$lr * PREMIUM5C) / PREMIUM5C
# The commission is drawn on the density's axis by scaling it to the density's maximum.
k <- max(density_df$density) / 0.5
ggplot() +
  geom_area(data = density_df, aes(lr, density), alpha = 0.35) +
  geom_line(data = scale_df, aes(lr, commission * k), colour = "firebrick") +
  scale_y_continuous("probability density (area)",
                     sec.axis = sec_axis(~ . / k, name = "commission (fraction of ceded premium, line)")) +
  labs(x = "ceded loss ratio (loss / 5,000 ceded premium)",
       title = "Treaty 6: sliding-scale commission and the loss ratio")

6. Risk-adjusted premium with distortions

The contract. The program of section 2, priced as a risk in two views. One view is the reinsurer’s ceded loss (the annual loss to 500 xs 500 and 1,000 xs 1,000). The other view is the cedant’s gross annual loss. The capital standard sets assets a at the 99% quantile of the view. The cost of capital is 10%, so the CCoC premium P solves P = L + 0.10 (a - P) with L = E[min(X, a)]. This premium is a risk-adjusted loss cost: the expected loss plus the cost of the capital it holds. It excludes expenses, brokerage, ceding commission and investment income. The chunk calibrates the proportional hazard, Wang, dual power and TVaR distortions so that each prices min(X, a) at P. It also prices a second set of distortions with fixed parameters at the same assets.

aggregate does this with Aggregate.calibrate_distortions(0.10, p=0.99, reins_view=...). These examples are designed, because the pricing pages of aggregate have no worked example for this book.

In R. CCoC is a distortion, g(s) = (r + s) / (1 + r) for s > 0. Thus risk_measure(min(X, a), distortion("ccoc", 0.10)) is the premium, and lev(grid, a) is L. calibrate_distortion(family, dist, premium, assets = a) finds the parameter that prices min(X, a) at the premium. risk_measure() prices a grid. aggregate takes a as the lower 99% quantile on the grid, and quantile() on a grid does the same, so F(a) is a little above 99%.

d@parameters (the parameters by name) and d@parameter (the one parameter of a family with one) read the calibrated parameter from the object. Thus the chunk compares each parameter with the parameter of aggregate. The chunk also compares the distortion function g(s) at two survival probabilities, with aggregate’s parameter in aggregate’s formula. This checks that the two packages define each family the same way, which the parameter alone does not show.

Reading the table. “price of min(X, a)” is the premium of each calibrated distortion at the capital standard, so it equals P by construction. “unlimited” is the same distortion applied to X with no cap: the premium if the assets did not limit the reinsurer’s liability. The difference between the two is the load that the distortion puts on the tail above the 99% standard. CCoC shows n/a. Its jump at s = 0 charges the cost of capital on the largest possible loss, so the cap is part of its definition.

S6 <- "6 risk pricing"
AGG_G <- list(  # g(s) from the parameter aggregate calibrated
  ccoc = function(r, s) pmin(1, (r + s) / (1 + r)),
  ph = function(rho, s) s^rho,
  wang = function(lam, s) pnorm(qnorm(s) + lam),
  dual = function(b, s) 1 - (1 - s)^b,
  tvar = function(p, s) pmin(1, s / (1 - p))
)
FAMILY <- c(ccoc = "ccoc", ph = "proportional_hazard", wang = "wang", dual = "dual_power", tvar = "tvar")
COC <- 0.10
CAPITAL_P <- 0.99
OCCURRENCE_LIMIT <- 1500  # the program's limit per occurrence: 500 xs 500 and 1,000 xs 1,000
FIXED <- list(ph0.7 = distortion("proportional_hazard", 0.7), wang0.4 = distortion("wang", 0.4),
              dual1.8 = distortion("dual_power", 1.8), tvar0.3 = distortion("tvar", 0.3),
              ccoc0.1 = distortion("ccoc", 0.1))
priced <- list()

for (view in list(list("ceded", "risk_pricing_ceded", program_ceded), list("gross", "risk_pricing_gross", gross))) {
  name <- view[[1]]
  example <- view[[2]]
  x <- view[[3]]
  s <- paste("6", name, "view")
  assets <- quantile(x, CAPITAL_P)
  capped <- map_grid(x, function(v) pmin(v, assets))$grid
  loss <- lev(x, assets)  # E[min(X, a)]
  premium <- risk_measure(capped, distortion("ccoc", COC))  # (L + r a) / (1 + r)
  capital <- assets - premium
  compare(s, "assets, the 99% quantile", example, "cal_a", assets)
  compare(s, "F(assets)", example, "cal_F(a)", cdf(x, assets))
  compare(s, "expected loss E[min(X, a)]", example, "cal_L", loss)
  compare(s, "CCoC premium", example, "cal_P", premium)
  # a - P, and (P - L) / (a - P) = r: they follow from the rows above.
  compare(s, "capital", example, "cal_Q", capital, check = TRUE)
  compare(s, "return on capital", example, "cal_ROE", (premium - loss) / capital, check = TRUE)
  report()

  cat(sprintf("%s: assets %s, expected loss %s, premium %s, capital %s\n", name, money(assets), money(loss),
              money(premium), money(capital)))
  rate_on_line <- if (name == "ceded") sprintf(", rate on line %.1f%%", 100 * premium / OCCURRENCE_LIMIT) else ""
  cat(sprintf("    loss ratio %.1f%%, margin %s (%.0f%% of the capital)%s\n", 100 * loss / premium,
              money(premium - loss), 100 * COC, rate_on_line))

  calibrated <- NULL
  for (family in names(FAMILY)) {
    d <- calibrate_distortion(FAMILY[[family]], x, premium, assets = assets)
    parameter <- agg_value(example, paste0("param_", family))
    for (sv in c(0.05, 0.5)) {
      agg_g <- AGG_G[[family]](parameter, sv)
      # The calibrated CCoC is the cost of capital the premium was built from: a consistency check.
      record(s, sprintf("%s: g(%s) at aggregate's parameter", family, sv), agg_g, distortion_g(d, sv),
             abs(distortion_g(d, sv) - agg_g) / agg_g, "mean", FALSE, family == "ccoc")
    }
    # The calibrated parameter, read off the distortion, against the one aggregate calibrated.
    stopifnot(length(d@parameters) == 1)  # each of these families has one parameter
    compare(s, sprintf("%s: parameter %s", family, names(d@parameters)), example, paste0("param_", family),
            d@parameter, check = family == "ccoc")
    # Calibrated to the premium, so its price of min(X, a) is the premium: a consistency check.
    compare(s, paste0(family, ": price of min(X, a)"), example, paste0("price_ask_", family),
            risk_measure(capped, d), check = TRUE)
    unlimited <- NA_real_
    if (family != "ccoc") {
      unlimited <- risk_measure(x, d)
      compare(s, paste0(family, ": unlimited price"), example, paste0("unlimited_price_ask_", family),
              unlimited, show = FALSE)
    }
    priced[[paste(name, family)]] <- d
    calibrated <- rbind(calibrated, data.frame(
      family = family, parameter = sprintf("%s=%.6f", names(d@parameters), d@parameter),
      `g(0.05)` = distortion_g(d, 0.05), `price of min(X, a)` = risk_measure(capped, d),
      unlimited = unlimited, check.names = FALSE
    ))
  }
  print(calibrated, row.names = FALSE, digits = 7)
  for (nm in names(FIXED)) {
    compare(s, paste0("fixed ", nm, ": price of min(X, a)"), example, paste0("fixed_price_ask_", nm),
            risk_measure(capped, FIXED[[nm]]), show = FALSE, check = startsWith(nm, "ccoc"))
  }
  report()
}
##  quantity                   aggregate    prospicio    difference pass
##  assets, the 99% quantile   1824.0000000 1824.0000000 0.0e+00    yes 
##  F(assets)                     0.9900373    0.9900373 4.0e-15    yes 
##  expected loss E[min(X, a)]  196.4172000  196.4172000 1.2e-13    yes 
##  CCoC premium                344.3792700  344.3792700 6.5e-14    yes 
##  capital *                  1479.6207000 1479.6207000 1.5e-14    yes 
##  return on capital *           0.1000000    0.1000000 4.7e-15    yes 
## ceded: assets 1,824.00, expected loss 196.42, premium 344.38, capital 1,479.62
##     loss ratio 57.0%, margin 147.96 (10% of the capital), rate on line 23.0%
##  family       parameter    g(0.05) price of min(X, a) unlimited
##    ccoc      r=0.100000 0.13636364           344.3793        NA
##      ph    rho=0.725171 0.11390169           344.3793  369.8526
##    wang lambda=0.388188 0.10443729           344.3793  360.4499
##    dual   beta=1.885608 0.09218899           344.3793  354.6992
##    tvar      p=0.429649 0.08766525           344.3793  353.9978
##  quantity                   aggregate   prospicio   difference pass
##  ccoc: parameter r *          0.1000000   0.1000000 6.9e-16    yes 
##  ccoc: price of min(X, a) * 344.3792700 344.3792700 1.7e-16    yes 
##  ph: parameter rho            0.7251715   0.7251715 1.3e-09    yes 
##  ph: price of min(X, a) *   344.3792700 344.3792700 2.0e-09    yes 
##  wang: parameter lambda       0.3881876   0.3881876 1.4e-12    yes 
##  wang: price of min(X, a) * 344.3792700 344.3792700 7.0e-13    yes 
##  dual: parameter beta         1.8856082   1.8856082 6.5e-14    yes 
##  dual: price of min(X, a) * 344.3792700 344.3792700 5.5e-14    yes 
##  tvar: parameter p            0.4296486   0.4296486 1.4e-09    yes 
##  tvar: price of min(X, a) * 344.3792700 344.3792700 1.0e-09    yes 
##  quantity                   aggregate    prospicio    difference pass
##  assets, the 99% quantile   5440.0000000 5440.0000000 0.0e+00    yes 
##  F(assets)                     0.9900149    0.9900149 2.2e-16    yes 
##  expected loss E[min(X, a)]  941.8839000  941.8839000 3.3e-14    yes 
##  CCoC premium               1350.8035000 1350.8035000 2.3e-14    yes 
##  capital *                  4089.1965000 4089.1965000 7.6e-15    yes 
##  return on capital *           0.1000000    0.1000000 8.6e-15    yes 
## gross: assets 5,440.00, expected loss 941.88, premium 1,350.80, capital 4,089.20
##     loss ratio 69.7%, margin 408.92 (10% of the capital)
##  family       parameter    g(0.05) price of min(X, a) unlimited
##    ccoc      r=0.100000 0.13636364           1350.804        NA
##      ph    rho=0.698670 0.12331318           1350.804  1400.879
##    wang lambda=0.420286 0.11036902           1350.804  1378.225
##    dual   beta=1.892345 0.09250263           1350.804  1366.434
##    tvar      p=0.381412 0.08082919           1350.804  1364.184
##  quantity                   aggregate    prospicio    difference pass
##  ccoc: parameter r *           0.1000000    0.1000000 3.1e-15    yes 
##  ccoc: price of min(X, a) * 1350.8035000 1350.8035000 1.7e-13    yes 
##  ph: parameter rho             0.6986699    0.6986699 2.1e-14    yes 
##  ph: price of min(X, a) *   1350.8035000 1350.8035000 3.0e-13    yes 
##  wang: parameter lambda        0.4202857    0.4202857 2.4e-13    yes 
##  wang: price of min(X, a) * 1350.8035000 1350.8035000 2.4e-13    yes 
##  dual: parameter beta          1.8923451    1.8923451 7.2e-15    yes 
##  dual: price of min(X, a) * 1350.8035000 1350.8035000 3.2e-13    yes 
##  tvar: parameter p             0.3814116    0.3814116 8.0e-09    yes 
##  tvar: price of min(X, a) * 1350.8035000 1350.8035000 3.2e-09    yes

The CCoC premium agrees to rounding, and so do the calibrated distortions. Their parameters, read with d@parameter, agree, and so does g(s) at aggregate’s parameter. The independent comparisons in this section are the parameter and g rows, the unlimited prices and the fixed-parameter prices. The other rows hold by construction and count as consistency checks:

  • each calibrated price of min(X, a) is the premium of its calibration,
  • the capital is a - P,
  • the return on capital is the 10% in the premium,
  • the calibrated and fixed CCoC give that 10%.

aggregate stops its Newton iteration at a premium error (4.3e-6 for the gross view’s TVaR), and prospicio bisects to rounding. Thus some calibrated parameters differ at the 1e-9 level, not to rounding. TVaR shows this most clearly. Its premium changes by more than a thousand per unit of its parameter, so that error moves the parameter and g only at the 1e-9 level.

The TVaR parameter differs by 8.0e-9 on the gross view and 1.4e-9 on the ceded view, and its g rows by 4.9e-9 and 1.0e-9. The proportional hazard on the ceded view is at the same level, for the same reason: its parameter differs by 1.3e-9 and its g(0.05) by 2.8e-9. All of these are inside the 1e-6 of the other families. The error also shows in aggregate’s price of min(X, a) for these distortions, which is off the target premium in the ninth digit. The price from prospicio is on the target.

Summary of every comparison

The table below lists each quantity that this document compares. It shows the value of aggregate from the reference file and the value of prospicio. It also shows the difference (relative, or in buckets for quantiles) and whether the difference is inside the tolerance for its type. First, the totals by section.

all_rows <- do.call(rbind, STATE$comparisons)
independent <- all_rows[!all_rows$check, ]
checks <- all_rows[all_rows$check, ]

by_section <- do.call(rbind, lapply(split(independent, factor(independent$section, unique(independent$section))), function(r) {
  rel <- r[r$unit == "rel", ]
  worst <- rel[which.max(rel$diff), ]
  data.frame(section = r$section[1], compared = nrow(r), passed = sum(r$ok),
             worst = sprintf("%.1e (%s)", worst$diff, worst$name))
}))
cat("independent comparisons by section\n")
## independent comparisons by section
print(by_section, row.names = FALSE, right = FALSE)
##  section                    compared passed
##  1 tower                    77       77    
##  2 program                  52       52    
##  3 limit and reinstatements 32       32    
##  4 stop loss                46       46    
##  4 aggregate deductible     31       31    
##  5 retro and swing          15       15    
##  5 profit commission        13       13    
##  5 sliding scale            15       15    
##  6 ceded view               24       24    
##  6 gross view               24       24    
##  worst                                         
##  1.8e-06 (layer 250 xs 250 skew)               
##  2.6e-06 (80% of 1000 xs 1000 sd)              
##  6.1e-07 (gross skew)                          
##  9.5e-06 (50% of 1500 xs 1000 skew)            
##  8.4e-10 (gross skew)                          
##  2.0e-10 (layer loss skew)                     
##  7.3e-10 (three-year loss skew)                
##  6.5e-10 (ceded loss skew)                     
##  2.8e-09 (ph: g(0.05) at aggregate's parameter)
##  1.6e-08 (ph: unlimited price)
by_class <- do.call(rbind, lapply(names(TOLERANCES), function(cls) {
  r <- independent[independent$cls == cls, ]
  unit <- TOLERANCES[[cls]][2]
  tol <- as.numeric(TOLERANCES[[cls]][1])
  w <- r[which.max(r$diff), ]
  fmt <- function(v) if (unit == "rel") sprintf("%.1e", v) else sprintf("%g bkt", v)
  data.frame(class = cls, tolerance = fmt(tol), rows = nrow(r), worst = fmt(w$diff),
             where = paste0(w$section, ": ", w$name))
}))
cat("\nindependent comparisons by tolerance class\n")
## 
## independent comparisons by tolerance class
print(by_class, row.names = FALSE, right = FALSE)
##  class          tolerance rows worst  
##  mean           1.0e-06   153  4.1e-08
##  sd             1.0e-06    46  3.1e-08
##  share sd       1.0e-05     4  7.4e-06
##  skew           2.0e-05    25  9.5e-06
##  quantile       0 bkt      92  0 bkt  
##  share quantile 1 bkt       8  0.5 bkt
##  tail           1.0e-05     1  5.7e-07
##  where                                             
##  3 limit and reinstatements: P(limit used up)      
##  3 limit and reinstatements: recovery under 2800 sd
##  4 stop loss: 50% of 1500 xs 1000 cv               
##  4 stop loss: 50% of 1500 xs 1000 skew             
##  1 tower: gross q0.5                               
##  4 stop loss: 50% of 1500 xs 1000 q0.99            
##  3 limit and reinstatements: loss above the limit
failed <- all_rows[!all_rows$ok, ]
cat(sprintf("\n%d of %d comparisons are inside their tolerance: %d independent comparisons and %d consistency checks that hold by construction%s\n",
            sum(all_rows$ok), nrow(all_rows), nrow(independent), nrow(checks),
            if (nrow(failed)) paste("; outside:", paste(failed$name, collapse = ", ")) else ""))
## 
## 353 of 353 comparisons are inside their tolerance: 329 independent comparisons and 24 consistency checks that hold by construction
full <- data.frame(
  section = all_rows$section,
  quantity = paste0(all_rows$name, ifelse(all_rows$check, " *", "")),
  aggregate = signif(all_rows$aggregate, 9), prospicio = signif(all_rows$prospicio, 9),
  difference = ifelse(all_rows$unit == "rel", sprintf("%.1e", all_rows$diff), sprintf("%.2f bkt", all_rows$diff)),
  tolerance = ifelse(all_rows$unit == "rel", sprintf("%.0e", all_rows$tol), sprintf("%g bkt", all_rows$tol)),
  pass = ifelse(all_rows$ok, "yes", "NO")
)
knitr::kable(full, row.names = FALSE)
section quantity aggregate prospicio difference tolerance pass
1 tower mean claim, exact 95.0575471 95.0575471 2.2e-15 1e-06 yes
1 tower mean claim, grid 95.0160815 95.0160815 2.2e-15 1e-06 yes
1 tower annual gross mean, exact 950.5754710 950.5754710 2.2e-15 1e-06 yes
1 tower gross mean 950.1608150 950.1608150 3.0e-12 1e-06 yes
1 tower gross sd 1016.6156400 1016.6156400 2.2e-10 1e-06 yes
1 tower gross cv 1.0699406 1.0699406 2.2e-10 1e-06 yes
1 tower gross skew 2.8645302 2.8645303 3.5e-08 2e-05 yes
1 tower gross q0.5 632.0000000 632.0000000 0.00 bkt 0 bkt yes
1 tower gross q0.9 2024.0000000 2024.0000000 0.00 bkt 0 bkt yes
1 tower gross q0.99 5440.0000000 5440.0000000 0.00 bkt 0 bkt yes
1 tower gross q0.999 7412.0000000 7412.0000000 0.00 bkt 0 bkt yes
1 tower layer 250 xs 0 mean 544.1697080 544.1697080 2.1e-16 1e-06 yes
1 tower layer 250 xs 0 sd 292.7494080 292.7494080 7.8e-16 1e-06 yes
1 tower layer 250 xs 0 cv 0.5379745 0.5379745 6.2e-16 1e-06 yes
1 tower layer 250 xs 0 skew 0.7109646 0.7109646 1.3e-13 2e-05 yes
1 tower layer 250 xs 0 q0.5 508.0000000 508.0000000 0.00 bkt 0 bkt yes
1 tower layer 250 xs 0 q0.9 940.0000000 940.0000000 0.00 bkt 0 bkt yes
1 tower layer 250 xs 0 q0.99 1364.0000000 1364.0000000 0.00 bkt 0 bkt yes
1 tower layer 250 xs 0 q0.999 1716.0000000 1716.0000000 0.00 bkt 0 bkt yes
1 tower layer 250 xs 0 mean, exact 544.5887280 544.5887280 2.1e-16 1e-06 yes
1 tower layer 250 xs 0 loss on line 2.1766788 2.1766788 2.0e-16 1e-06 yes
1 tower layer 250 xs 0 P(claim reaches layer) 0.8970271 0.8970271 3.7e-16 1e-06 yes
1 tower layer 250 xs 0 P(claim exhausts layer) 0.0792485 0.0792485 2.6e-15 1e-06 yes
1 tower layer 250 xs 0 mean given it reaches 60.6636891 60.6636891 2.8e-15 1e-06 yes
1 tower layer 250 xs 250 mean 133.0529540 133.0529540 1.3e-12 1e-06 yes
1 tower layer 250 xs 250 sd 170.2383970 170.2383970 7.9e-10 1e-06 yes
1 tower layer 250 xs 250 cv 1.2794785 1.2794785 7.9e-10 1e-06 yes
1 tower layer 250 xs 250 skew 1.3742361 1.3742386 1.8e-06 2e-05 yes
1 tower layer 250 xs 250 q0.5 36.0000000 36.0000000 0.00 bkt 0 bkt yes
1 tower layer 250 xs 250 q0.9 356.0000000 356.0000000 0.00 bkt 0 bkt yes
1 tower layer 250 xs 250 q0.99 692.0000000 692.0000000 0.00 bkt 0 bkt yes
1 tower layer 250 xs 250 q0.999 952.0000000 952.0000000 0.00 bkt 0 bkt yes
1 tower layer 250 xs 250 mean, exact 133.0480030 133.0480030 3.0e-15 1e-06 yes
1 tower layer 250 xs 250 loss on line 0.5322118 0.5322118 1.3e-12 1e-06 yes
1 tower layer 250 xs 250 P(claim reaches layer) 0.0792485 0.0792485 2.6e-15 1e-06 yes
1 tower layer 250 xs 250 P(claim exhausts layer) 0.0365717 0.0365717 9.5e-16 1e-06 yes
1 tower layer 250 xs 250 mean given it reaches 167.8933600 167.8933600 2.2e-15 1e-06 yes
1 tower layer 500 xs 500 mean 114.8113950 114.8113950 3.3e-12 1e-06 yes
1 tower layer 500 xs 500 sd 220.9093380 220.9093380 1.0e-09 1e-06 yes
1 tower layer 500 xs 500 cv 1.9241064 1.9241064 1.0e-09 1e-06 yes
1 tower layer 500 xs 500 skew 2.0926309 2.0926333 1.1e-06 2e-05 yes
1 tower layer 500 xs 500 q0.5 0.0000000 0.0000000 0.00 bkt 0 bkt yes
1 tower layer 500 xs 500 q0.9 500.0000000 500.0000000 0.00 bkt 0 bkt yes
1 tower layer 500 xs 500 q0.99 1000.0000000 1000.0000000 0.00 bkt 0 bkt yes
1 tower layer 500 xs 500 q0.999 1324.0000000 1324.0000000 0.00 bkt 0 bkt yes
1 tower layer 500 xs 500 mean, exact 114.8118460 114.8118460 3.1e-15 1e-06 yes
1 tower layer 500 xs 500 loss on line 0.2296228 0.2296228 3.3e-12 1e-06 yes
1 tower layer 500 xs 500 P(claim reaches layer) 0.0362181 0.0362181 1.7e-15 1e-06 yes
1 tower layer 500 xs 500 P(claim exhausts layer) 0.0147382 0.0147382 5.9e-16 1e-06 yes
1 tower layer 500 xs 500 mean given it reaches 317.0002510 317.0002510 2.3e-15 1e-06 yes
1 tower layer 1000 xs 1000 mean 87.0917548 87.0917548 4.1e-15 1e-06 yes
1 tower layer 1000 xs 1000 sd 268.6319400 268.6319400 2.3e-15 1e-06 yes
1 tower layer 1000 xs 1000 cv 3.0844704 3.0844704 1.7e-15 1e-06 yes
1 tower layer 1000 xs 1000 skew 3.3986889 3.3986889 2.0e-14 2e-05 yes
1 tower layer 1000 xs 1000 q0.5 0.0000000 0.0000000 0.00 bkt 0 bkt yes
1 tower layer 1000 xs 1000 q0.9 264.0000000 264.0000000 0.00 bkt 0 bkt yes
1 tower layer 1000 xs 1000 q0.99 1000.0000000 1000.0000000 0.00 bkt 0 bkt yes
1 tower layer 1000 xs 1000 q0.999 2000.0000000 2000.0000000 0.00 bkt 0 bkt yes
1 tower layer 1000 xs 1000 mean, exact 87.0918646 87.0918646 9.0e-15 1e-06 yes
1 tower layer 1000 xs 1000 loss on line 0.0870918 0.0870918 4.0e-15 1e-06 yes
1 tower layer 1000 xs 1000 P(claim reaches layer) 0.0146557 0.0146557 3.8e-15 1e-06 yes
1 tower layer 1000 xs 1000 P(claim exhausts layer) 0.0052092 0.0052092 7.0e-15 1e-06 yes
1 tower layer 1000 xs 1000 mean given it reaches 594.2522290 594.2522290 2.5e-15 1e-06 yes
1 tower layer 3000 xs 2000 mean 71.0350036 71.0350036 1.5e-11 1e-06 yes
1 tower layer 3000 xs 2000 sd 397.7498200 397.7498200 8.9e-10 1e-06 yes
1 tower layer 3000 xs 2000 cv 5.5993496 5.5993496 8.8e-10 1e-06 yes
1 tower layer 3000 xs 2000 skew 6.5353088 6.5353100 1.8e-07 2e-05 yes
1 tower layer 3000 xs 2000 q0.5 0.0000000 0.0000000 0.00 bkt 0 bkt yes
1 tower layer 3000 xs 2000 q0.9 0.0000000 0.0000000 0.00 bkt 0 bkt yes
1 tower layer 3000 xs 2000 q0.99 3000.0000000 3000.0000000 0.00 bkt 0 bkt yes
1 tower layer 3000 xs 2000 q0.999 3000.0000000 3000.0000000 0.00 bkt 0 bkt yes
1 tower layer 3000 xs 2000 mean, exact 71.0350286 71.0350286 3.0e-14 1e-06 yes
1 tower layer 3000 xs 2000 loss on line 0.0236783 0.0236783 1.5e-11 1e-06 yes
1 tower layer 3000 xs 2000 P(claim reaches layer) 0.0051926 0.0051926 5.2e-15 1e-06 yes
1 tower layer 3000 xs 2000 P(claim exhausts layer) 0.0010718 0.0010718 4.0e-15 1e-06 yes
1 tower layer 3000 xs 2000 mean given it reaches 1367.9978300 1367.9978300 3.8e-15 1e-06 yes
1 tower sum of layers equals gross 950.1608150 950.1608150 2.3e-12 1e-06 yes
2 program gross mean 950.1608150 950.1608150 3.0e-12 1e-06 yes
2 program gross sd 1016.6156400 1016.6156400 2.2e-10 1e-06 yes
2 program gross cv 1.0699406 1.0699406 2.2e-10 1e-06 yes
2 program gross skew 2.8645302 2.8645303 3.5e-08 2e-05 yes
2 program gross q0.5 632.0000000 632.0000000 0.00 bkt 0 bkt yes
2 program gross q0.9 2024.0000000 2024.0000000 0.00 bkt 0 bkt yes
2 program gross q0.99 5440.0000000 5440.0000000 0.00 bkt 0 bkt yes
2 program gross q0.999 7412.0000000 7412.0000000 0.00 bkt 0 bkt yes
2 program ceded mean 201.9031490 201.9031490 2.8e-13 1e-06 yes
2 program ceded sd 456.1313510 456.1313510 3.7e-11 1e-06 yes
2 program ceded cv 2.2591592 2.2591592 3.6e-11 1e-06 yes
2 program ceded skew 2.7608619 2.7608620 1.5e-08 2e-05 yes
2 program ceded q0.5 0.0000000 0.0000000 0.00 bkt 0 bkt yes
2 program ceded q0.9 816.0000000 816.0000000 0.00 bkt 0 bkt yes
2 program ceded q0.99 1824.0000000 1824.0000000 0.00 bkt 0 bkt yes
2 program ceded q0.999 3000.0000000 3000.0000000 0.00 bkt 0 bkt yes
2 program net mean 748.2576650 748.2576650 2.4e-12 1e-06 yes
2 program net sd 640.6585580 640.6585580 5.7e-10 1e-06 yes
2 program net cv 0.8562005 0.8562005 5.7e-10 1e-06 yes
2 program net skew 2.9401290 2.9401295 1.6e-07 2e-05 yes
2 program net q0.5 616.0000000 616.0000000 0.00 bkt 0 bkt yes
2 program net q0.9 1360.0000000 1360.0000000 0.00 bkt 0 bkt yes
2 program net q0.99 3836.0000000 3836.0000000 0.00 bkt 0 bkt yes
2 program net q0.999 4948.0000000 4948.0000000 0.00 bkt 0 bkt yes
2 program ceded mean, exact 201.9037110 201.9037110 2.1e-15 1e-06 yes
2 program net mean, exact 748.6717600 748.6717600 3.3e-15 1e-06 yes
2 program net mean claim, grid 74.8257665 74.8257665 2.5e-15 1e-06 yes
2 program layer 500 xs 500 mean 114.8113950 114.8113950 3.3e-12 1e-06 yes
2 program layer 500 xs 500 sd 220.9093380 220.9093380 1.0e-09 1e-06 yes
2 program layer 500 xs 500 cv 1.9241064 1.9241064 1.0e-09 1e-06 yes
2 program layer 500 xs 500 skew 2.0926309 2.0926333 1.1e-06 2e-05 yes
2 program layer 500 xs 500 q0.5 0.0000000 0.0000000 0.00 bkt 0 bkt yes
2 program layer 500 xs 500 q0.9 500.0000000 500.0000000 0.00 bkt 0 bkt yes
2 program layer 500 xs 500 q0.99 1000.0000000 1000.0000000 0.00 bkt 0 bkt yes
2 program layer 500 xs 500 q0.999 1324.0000000 1324.0000000 0.00 bkt 0 bkt yes
2 program layer 1000 xs 1000 mean 87.0917548 87.0917548 4.1e-15 1e-06 yes
2 program layer 1000 xs 1000 sd 268.6319400 268.6319400 2.3e-15 1e-06 yes
2 program layer 1000 xs 1000 cv 3.0844704 3.0844704 1.7e-15 1e-06 yes
2 program layer 1000 xs 1000 skew 3.3986889 3.3986889 2.0e-14 2e-05 yes
2 program layer 1000 xs 1000 q0.5 0.0000000 0.0000000 0.00 bkt 0 bkt yes
2 program layer 1000 xs 1000 q0.9 264.0000000 264.0000000 0.00 bkt 0 bkt yes
2 program layer 1000 xs 1000 q0.99 1000.0000000 1000.0000000 0.00 bkt 0 bkt yes
2 program layer 1000 xs 1000 q0.999 2000.0000000 2000.0000000 0.00 bkt 0 bkt yes
2 program 80% of 1000 xs 1000 mean 69.6734038 69.6734038 2.9e-13 1e-06 yes
2 program 80% of 1000 xs 1000 sd 214.9061170 214.9055520 2.6e-06 1e-05 yes
2 program 80% of 1000 xs 1000 cv 3.0844785 3.0844704 2.6e-06 1e-05 yes
2 program 80% of 1000 xs 1000 skew 3.3986838 3.3986889 1.5e-06 2e-05 yes
2 program 80% of 1000 xs 1000 q0.5 0.0000000 0.0000000 0.00 bkt 1 bkt yes
2 program 80% of 1000 xs 1000 q0.9 212.0000000 211.2000000 0.20 bkt 1 bkt yes
2 program 80% of 1000 xs 1000 q0.99 800.0000000 800.0000000 0.00 bkt 1 bkt yes
2 program 80% of 1000 xs 1000 q0.999 1600.0000000 1600.0000000 0.00 bkt 1 bkt yes
2 program 80% of 1000 xs 1000 mean, exact 69.6734916 69.6734916 9.0e-15 1e-06 yes
3 limit and reinstatements class 1 expected claims 0.7370107 0.7370107 6.0e-16 1e-06 yes
3 limit and reinstatements class 2 expected claims 0.9236209 0.9236209 1.3e-15 1e-06 yes
3 limit and reinstatements class 3 expected claims 1.2342213 1.2342213 9.0e-16 1e-06 yes
3 limit and reinstatements expected claims 2.8948528 2.8948528 3.1e-16 1e-06 yes
3 limit and reinstatements gross mean, exact 900.0000000 900.0000000 1.3e-16 1e-06 yes
3 limit and reinstatements gross CV, exact 0.7696938 0.7696938 0.0e+00 1e-06 yes
3 limit and reinstatements gross mean 899.9999920 899.9999920 6.3e-14 1e-06 yes
3 limit and reinstatements gross sd 692.7244200 692.7244200 1.4e-13 1e-06 yes
3 limit and reinstatements gross cv 0.7696938 0.7696938 2.0e-13 1e-06 yes
3 limit and reinstatements gross skew 0.9020683 0.9020689 6.1e-07 2e-05 yes
3 limit and reinstatements gross q0.5 785.7500000 785.7500000 0.00 bkt 0 bkt yes
3 limit and reinstatements gross q0.9 1843.0000000 1843.0000000 0.00 bkt 0 bkt yes
3 limit and reinstatements gross q0.99 2917.1250000 2917.1250000 0.00 bkt 0 bkt yes
3 limit and reinstatements gross q0.999 3816.2500000 3816.2500000 0.00 bkt 0 bkt yes
3 limit and reinstatements recovery under 2800 mean 894.6806810 894.6806780 3.4e-09 1e-06 yes
3 limit and reinstatements recovery under 2800 sd 674.9458410 674.9458210 3.1e-08 1e-06 yes
3 limit and reinstatements recovery under 2800 cv 0.7543986 0.7543986 2.7e-08 1e-06 yes
3 limit and reinstatements recovery under 2800 skew 0.7214286 0.7214286 1.1e-09 2e-05 yes
3 limit and reinstatements recovery under 2800 q0.5 785.7500000 785.7500000 0.00 bkt 0 bkt yes
3 limit and reinstatements recovery under 2800 q0.9 1843.0000000 1843.0000000 0.00 bkt 0 bkt yes
3 limit and reinstatements recovery under 2800 q0.99 2800.0000000 2800.0000000 0.00 bkt 0 bkt yes
3 limit and reinstatements recovery under 2800 q0.999 2800.0000000 2800.0000000 0.00 bkt 0 bkt yes
3 limit and reinstatements P(limit used up) 0.0137006 0.0137006 4.1e-08 1e-06 yes
3 limit and reinstatements loss above the limit 5.3193114 5.3193144 5.7e-07 1e-05 yes
3 limit and reinstatements A: expected reinstatement premium 1495.5692600 1495.5692600 1.4e-09 1e-06 yes
3 limit and reinstatements A: total premium 2695.5692600 2695.5692600 7.5e-10 1e-06 yes
3 limit and reinstatements A: recovery 894.6806760 894.6806780 1.8e-09 1e-06 yes
3 limit and reinstatements A: P(any loss to the layer) 0.9435139 0.9435139 6.0e-10 1e-06 yes
3 limit and reinstatements A: maximum premium * 3600.0000000 3600.0000000 0.0e+00 1e-06 yes
3 limit and reinstatements B: expected reinstatement premium 371.5810240 371.5810250 2.7e-09 1e-06 yes
3 limit and reinstatements B: total premium 1571.5810200 1571.5810200 6.5e-10 1e-06 yes
3 limit and reinstatements B: recovery 894.6806760 894.6806780 1.8e-09 1e-06 yes
3 limit and reinstatements B: P(any loss to the layer) 0.9435139 0.9435139 6.0e-10 1e-06 yes
3 limit and reinstatements B: maximum premium * 1800.0000000 1800.0000000 0.0e+00 1e-06 yes
4 stop loss 250 xs 750 mean 89.8060044 89.8060044 1.9e-14 1e-06 yes
4 stop loss 250 xs 750 sd 114.5950060 114.5950060 5.2e-15 1e-06 yes
4 stop loss 250 xs 750 cv 1.2760283 1.2760283 1.4e-14 1e-06 yes
4 stop loss 250 xs 750 skew 0.5894734 0.5894734 6.1e-14 2e-05 yes
4 stop loss 250 xs 750 q0.5 0.0000000 0.0000000 0.00 bkt 0 bkt yes
4 stop loss 250 xs 750 q0.9 252.0000000 252.0000000 0.00 bkt 0 bkt yes
4 stop loss 250 xs 750 q0.99 252.0000000 252.0000000 0.00 bkt 0 bkt yes
4 stop loss 250 xs 750 q0.999 252.0000000 252.0000000 0.00 bkt 0 bkt yes
4 stop loss 250 xs 750 P(attach) 0.4237867 0.4237867 1.1e-13 1e-06 yes
4 stop loss 250 xs 750 P(exhaust) 0.3036542 0.3036542 1.6e-13 1e-06 yes
4 stop loss 250 xs 750 loss on line 0.3592240 0.3592240 1.8e-14 1e-06 yes
4 stop loss 1500 xs 1000 mean 220.2548970 220.2548970 3.9e-14 1e-06 yes
4 stop loss 1500 xs 1000 sd 447.6055950 447.6055950 2.3e-14 1e-06 yes
4 stop loss 1500 xs 1000 cv 2.0322163 2.0322163 1.6e-14 1e-06 yes
4 stop loss 1500 xs 1000 skew 2.0223670 2.0223670 3.3e-14 2e-05 yes
4 stop loss 1500 xs 1000 q0.5 0.0000000 0.0000000 0.00 bkt 0 bkt yes
4 stop loss 1500 xs 1000 q0.9 1024.0000000 1024.0000000 0.00 bkt 0 bkt yes
4 stop loss 1500 xs 1000 q0.99 1500.0000000 1500.0000000 0.00 bkt 0 bkt yes
4 stop loss 1500 xs 1000 q0.999 1500.0000000 1500.0000000 0.00 bkt 0 bkt yes
4 stop loss 1500 xs 1000 P(attach) 0.3020880 0.3020880 1.6e-13 1e-06 yes
4 stop loss 1500 xs 1000 P(exhaust) 0.0672404 0.0672404 7.0e-13 1e-06 yes
4 stop loss 1500 xs 1000 loss on line 0.1468366 0.1468366 3.9e-14 1e-06 yes
4 stop loss both layers, ceded mean 310.0609020 310.0609020 3.2e-14 1e-06 yes
4 stop loss both layers, ceded sd 532.9632330 532.9632330 2.0e-14 1e-06 yes
4 stop loss both layers, ceded cv 1.7188986 1.7188986 1.2e-14 1e-06 yes
4 stop loss both layers, ceded skew 1.7405735 1.7405735 3.0e-14 2e-05 yes
4 stop loss both layers, ceded q0.5 0.0000000 0.0000000 0.00 bkt 0 bkt yes
4 stop loss both layers, ceded q0.9 1272.0000000 1272.0000000 0.00 bkt 0 bkt yes
4 stop loss both layers, ceded q0.99 1752.0000000 1752.0000000 0.00 bkt 0 bkt yes
4 stop loss both layers, ceded q0.999 1752.0000000 1752.0000000 0.00 bkt 0 bkt yes
4 stop loss both layers, net mean 640.0999130 640.0999130 2.2e-12 1e-06 yes
4 stop loss both layers, net sd 582.7531470 582.7531480 5.4e-10 1e-06 yes
4 stop loss both layers, net cv 0.9104097 0.9104097 5.4e-10 1e-06 yes
4 stop loss both layers, net skew 4.8069086 4.8069091 9.9e-08 2e-05 yes
4 stop loss both layers, net q0.5 632.0000000 632.0000000 0.00 bkt 0 bkt yes
4 stop loss both layers, net q0.9 752.0000000 752.0000000 0.00 bkt 0 bkt yes
4 stop loss both layers, net q0.99 3692.0000000 3692.0000000 0.00 bkt 0 bkt yes
4 stop loss both layers, net q0.999 5664.0000000 5664.0000000 0.00 bkt 0 bkt yes
4 stop loss 50% of 1500 xs 1000 mean 110.1274490 110.1274490 3.9e-14 1e-06 yes
4 stop loss 50% of 1500 xs 1000 sd 223.8044510 223.8027970 7.4e-06 1e-05 yes
4 stop loss 50% of 1500 xs 1000 cv 2.0322313 2.0322163 7.4e-06 1e-05 yes
4 stop loss 50% of 1500 xs 1000 skew 2.0223863 2.0223670 9.5e-06 2e-05 yes
4 stop loss 50% of 1500 xs 1000 q0.5 0.0000000 0.0000000 0.00 bkt 1 bkt yes
4 stop loss 50% of 1500 xs 1000 q0.9 512.0000000 512.0000000 0.00 bkt 1 bkt yes
4 stop loss 50% of 1500 xs 1000 q0.99 752.0000000 750.0000000 0.50 bkt 1 bkt yes
4 stop loss 50% of 1500 xs 1000 q0.999 752.0000000 750.0000000 0.50 bkt 1 bkt yes
4 aggregate deductible class 1 expected claims 5.1540800 5.1540800 1.7e-16 1e-06 yes
4 aggregate deductible class 2 expected claims 1.3425079 1.3425079 4.8e-15 1e-06 yes
4 aggregate deductible gross mean, exact 450.0000000 450.0000000 0.0e+00 1e-06 yes
4 aggregate deductible gross CV, exact 0.5284975 0.5284975 4.2e-16 1e-06 yes
4 aggregate deductible gross mean 449.9999770 449.9999770 2.2e-12 1e-06 yes
4 aggregate deductible gross sd 237.8238680 237.8238680 2.2e-11 1e-06 yes
4 aggregate deductible gross cv 0.5284975 0.5284975 2.0e-11 1e-06 yes
4 aggregate deductible gross skew 0.6244110 0.6244110 8.4e-10 2e-05 yes
4 aggregate deductible gross q0.5 424.1875000 424.1875000 0.00 bkt 0 bkt yes
4 aggregate deductible gross q0.9 769.0000000 769.0000000 0.00 bkt 0 bkt yes
4 aggregate deductible gross q0.99 1103.6250000 1103.6250000 0.00 bkt 0 bkt yes
4 aggregate deductible gross q0.999 1376.8125000 1376.8125000 0.00 bkt 0 bkt yes
4 aggregate deductible after the deductible mean 142.7589670 142.7589670 9.9e-13 1e-06 yes
4 aggregate deductible after the deductible sd 183.7796080 183.7796080 7.1e-12 1e-06 yes
4 aggregate deductible after the deductible cv 1.2873420 1.2873420 6.1e-12 1e-06 yes
4 aggregate deductible after the deductible skew 1.5338445 1.5338445 1.6e-10 2e-05 yes
4 aggregate deductible after the deductible q0.5 64.1875000 64.1875000 0.00 bkt 0 bkt yes
4 aggregate deductible after the deductible q0.9 409.0000000 409.0000000 0.00 bkt 0 bkt yes
4 aggregate deductible after the deductible q0.99 743.6250000 743.6250000 0.00 bkt 0 bkt yes
4 aggregate deductible after the deductible q0.999 1016.8125000 1016.8125000 0.00 bkt 0 bkt yes
4 aggregate deductible value of the deductible 307.2410100 307.2410100 3.5e-14 1e-06 yes
4 aggregate deductible excess ratio (insurance charge) 0.3172422 0.3172422 4.6e-12 1e-06 yes
4 aggregate deductible Poisson, after the deductible mean 141.7994780 141.7994780 9.5e-13 1e-06 yes
4 aggregate deductible Poisson, after the deductible sd 181.4209210 181.4209210 6.9e-12 1e-06 yes
4 aggregate deductible Poisson, after the deductible cv 1.2794188 1.2794188 6.0e-12 1e-06 yes
4 aggregate deductible Poisson, after the deductible skew 1.5152813 1.5152813 1.6e-10 2e-05 yes
4 aggregate deductible Poisson, after the deductible q0.5 65.1250000 65.1250000 0.00 bkt 0 bkt yes
4 aggregate deductible Poisson, after the deductible q0.9 404.8125000 404.8125000 0.00 bkt 0 bkt yes
4 aggregate deductible Poisson, after the deductible q0.99 732.5000000 732.5000000 0.00 bkt 0 bkt yes
4 aggregate deductible Poisson, after the deductible q0.999 998.8125000 998.8125000 0.00 bkt 0 bkt yes
4 aggregate deductible Poisson gross mean 449.9999770 449.9999770 2.8e-13 1e-06 yes
5 retro and swing layer loss mean 449.9999770 449.9999770 3.3e-13 1e-06 yes
5 retro and swing layer loss sd 234.8313370 234.8313370 3.9e-12 1e-06 yes
5 retro and swing layer loss cv 0.5218474 0.5218474 3.5e-12 1e-06 yes
5 retro and swing layer loss skew 0.6077464 0.6077464 2.0e-10 2e-05 yes
5 retro and swing layer loss q0.5 425.1250000 425.1250000 0.00 bkt 0 bkt yes
5 retro and swing layer loss q0.9 764.8125000 764.8125000 0.00 bkt 0 bkt yes
5 retro and swing layer loss q0.99 1092.5000000 1092.5000000 0.00 bkt 0 bkt yes
5 retro and swing layer loss q0.999 1358.8125000 1358.8125000 0.00 bkt 0 bkt yes
5 retro and swing retro premium 624.5097300 624.5097300 4.6e-13 1e-06 yes
5 retro and swing retro premium, retro_premium() 624.5097300 624.5097300 6.9e-14 1e-06 yes
5 retro and swing retro rate on subject premium 0.0520425 0.0520425 4.6e-13 1e-06 yes
5 retro and swing P(minimum premium) 0.2396508 0.2396508 1.7e-15 1e-06 yes
5 retro and swing P(maximum premium) 0.0418237 0.0418237 8.6e-13 1e-06 yes
5 retro and swing swing premium, 100% placed 838.3193620 838.3193620 3.4e-13 1e-06 yes
5 retro and swing swing premium, 40% placed 335.3277450 335.3277450 3.5e-13 1e-06 yes
5 profit commission three-year loss mean 2699.9999100 2699.9999100 1.8e-12 1e-06 yes
5 profit commission three-year loss sd 1194.8616700 1194.8616700 1.8e-11 1e-06 yes
5 profit commission three-year loss cv 0.4425414 0.4425414 1.6e-11 1e-06 yes
5 profit commission three-year loss skew 0.5162047 0.5162047 7.3e-10 2e-05 yes
5 profit commission three-year loss q0.5 2595.5000000 2595.5000000 0.00 bkt 0 bkt yes
5 profit commission three-year loss q0.9 4292.5000000 4292.5000000 0.00 bkt 0 bkt yes
5 profit commission three-year loss q0.99 5900.2500000 5900.2500000 0.00 bkt 0 bkt yes
5 profit commission three-year loss q0.999 7195.0000000 7195.0000000 0.00 bkt 0 bkt yes
5 profit commission ceded loss ratio 0.4800000 0.4800000 3.4e-13 1e-06 yes
5 profit commission profit commission 370.7249570 370.7249570 1.4e-15 1e-06 yes
5 profit commission profit commission rate 0.0823833 0.0823833 1.3e-15 1e-06 yes
5 profit commission rate at the expected loss ratio 0.0800000 0.0800000 5.1e-13 1e-06 yes
5 profit commission P(profit commission > 0) 0.9227560 0.9227560 1.2e-15 1e-06 yes
5 sliding scale expected claims 11.4943520 11.4943520 2.6e-15 1e-06 yes
5 sliding scale ceded loss mean 2499.9987500 2499.9987500 3.5e-13 1e-06 yes
5 sliding scale ceded loss sd 1212.8997300 1212.8997300 8.4e-12 1e-06 yes
5 sliding scale ceded loss cv 0.4851601 0.4851601 8.1e-12 1e-06 yes
5 sliding scale ceded loss skew 0.6485685 0.6485685 6.5e-10 2e-05 yes
5 sliding scale ceded loss q0.5 2367.0000000 2367.0000000 0.00 bkt 0 bkt yes
5 sliding scale ceded loss q0.9 4128.5000000 4128.5000000 0.00 bkt 0 bkt yes
5 sliding scale ceded loss q0.99 5855.0000000 5855.0000000 0.00 bkt 0 bkt yes
5 sliding scale ceded loss q0.999 7272.5000000 7272.5000000 0.00 bkt 0 bkt yes
5 sliding scale ceded loss ratio 0.4999998 0.4999998 3.5e-13 1e-06 yes
5 sliding scale expected commission 1517.1042700 1517.1042700 9.2e-14 1e-06 yes
5 sliding scale expected commission rate 0.3034209 0.3034209 9.2e-14 1e-06 yes
5 sliding scale rate at the expected loss ratio 0.2875002 0.2875002 4.6e-13 1e-06 yes
5 sliding scale P(loss ratio <= 35%) 0.2950800 0.2950800 8.1e-15 1e-06 yes
5 sliding scale P(loss ratio >= 65%) 0.2485447 0.2485447 1.1e-13 1e-06 yes
6 ceded view assets, the 99% quantile 1824.0000000 1824.0000000 0.0e+00 1e-06 yes
6 ceded view F(assets) 0.9900373 0.9900373 4.0e-15 1e-06 yes
6 ceded view expected loss E[min(X, a)] 196.4171960 196.4171960 1.2e-13 1e-06 yes
6 ceded view CCoC premium 344.3792690 344.3792690 6.5e-14 1e-06 yes
6 ceded view capital * 1479.6207300 1479.6207300 1.5e-14 1e-06 yes
6 ceded view return on capital * 0.1000000 0.1000000 4.7e-15 1e-06 yes
6 ceded view ccoc: g(0.05) at aggregate’s parameter * 0.1363636 0.1363636 4.1e-16 1e-06 yes
6 ceded view ccoc: g(0.5) at aggregate’s parameter * 0.5454545 0.5454545 2.0e-16 1e-06 yes
6 ceded view ccoc: parameter r * 0.1000000 0.1000000 6.9e-16 1e-06 yes
6 ceded view ccoc: price of min(X, a) * 344.3792690 344.3792690 1.7e-16 1e-06 yes
6 ceded view ph: g(0.05) at aggregate’s parameter 0.1139017 0.1139017 2.8e-09 1e-06 yes
6 ceded view ph: g(0.5) at aggregate’s parameter 0.6049251 0.6049251 6.5e-10 1e-06 yes
6 ceded view ph: parameter rho 0.7251715 0.7251715 1.3e-09 1e-06 yes
6 ceded view ph: price of min(X, a) * 344.3792700 344.3792690 2.0e-09 1e-06 yes
6 ceded view ph: unlimited price 369.8525910 369.8525910 8.8e-10 1e-06 yes
6 ceded view wang: g(0.05) at aggregate’s parameter 0.1044373 0.1044373 9.2e-13 1e-06 yes
6 ceded view wang: g(0.5) at aggregate’s parameter 0.6510614 0.6510614 3.0e-13 1e-06 yes
6 ceded view wang: parameter lambda 0.3881876 0.3881876 1.4e-12 1e-06 yes
6 ceded view wang: price of min(X, a) * 344.3792690 344.3792690 7.0e-13 1e-06 yes
6 ceded view wang: unlimited price 360.4498610 360.4498610 3.4e-12 1e-06 yes
6 ceded view dual: g(0.05) at aggregate’s parameter 0.0921890 0.0921890 6.1e-14 1e-06 yes
6 ceded view dual: g(0.5) at aggregate’s parameter 0.7293704 0.7293704 3.2e-14 1e-06 yes
6 ceded view dual: parameter beta 1.8856082 1.8856082 6.5e-14 1e-06 yes
6 ceded view dual: price of min(X, a) * 344.3792690 344.3792690 5.5e-14 1e-06 yes
6 ceded view dual: unlimited price 354.6992100 354.6992100 4.7e-13 1e-06 yes
6 ceded view tvar: g(0.05) at aggregate’s parameter 0.0876653 0.0876653 1.0e-09 1e-06 yes
6 ceded view tvar: g(0.5) at aggregate’s parameter 0.8766525 0.8766525 1.0e-09 1e-06 yes
6 ceded view tvar: parameter p 0.4296486 0.4296486 1.4e-09 1e-06 yes
6 ceded view tvar: price of min(X, a) * 344.3792700 344.3792690 1.0e-09 1e-06 yes
6 ceded view tvar: unlimited price 353.9978190 353.9978190 1.0e-09 1e-06 yes
6 ceded view fixed ph0.7: price of min(X, a) 363.1108280 363.1108280 1.4e-15 1e-06 yes
6 ceded view fixed wang0.4: price of min(X, a) 349.7401740 349.7401740 2.6e-15 1e-06 yes
6 ceded view fixed dual1.8: price of min(X, a) 331.0103390 331.0103390 1.7e-15 1e-06 yes
6 ceded view fixed tvar0.3: price of min(X, a) 280.5959940 280.5959940 6.1e-16 1e-06 yes
6 ceded view fixed ccoc0.1: price of min(X, a) * 344.3792690 344.3792690 1.2e-15 1e-06 yes
6 gross view assets, the 99% quantile 5440.0000000 5440.0000000 0.0e+00 1e-06 yes
6 gross view F(assets) 0.9900150 0.9900150 2.2e-16 1e-06 yes
6 gross view expected loss E[min(X, a)] 941.8838990 941.8838990 3.3e-14 1e-06 yes
6 gross view CCoC premium 1350.8035400 1350.8035400 2.3e-14 1e-06 yes
6 gross view capital * 4089.1964600 4089.1964600 7.6e-15 1e-06 yes
6 gross view return on capital * 0.1000000 0.1000000 8.6e-15 1e-06 yes
6 gross view ccoc: g(0.05) at aggregate’s parameter * 0.1363636 0.1363636 1.6e-15 1e-06 yes
6 gross view ccoc: g(0.5) at aggregate’s parameter * 0.5454545 0.5454545 2.0e-16 1e-06 yes
6 gross view ccoc: parameter r * 0.1000000 0.1000000 3.1e-15 1e-06 yes
6 gross view ccoc: price of min(X, a) * 1350.8035400 1350.8035400 1.7e-13 1e-06 yes
6 gross view ph: g(0.05) at aggregate’s parameter 0.1233132 0.1233132 4.5e-14 1e-06 yes
6 gross view ph: g(0.5) at aggregate’s parameter 0.6161400 0.6161400 1.0e-14 1e-06 yes
6 gross view ph: parameter rho 0.6986699 0.6986699 2.1e-14 1e-06 yes
6 gross view ph: price of min(X, a) * 1350.8035400 1350.8035400 3.0e-13 1e-06 yes
6 gross view ph: unlimited price 1400.8785700 1400.8785900 1.6e-08 1e-06 yes
6 gross view wang: g(0.05) at aggregate’s parameter 0.1103690 0.1103690 1.7e-13 1e-06 yes
6 gross view wang: g(0.5) at aggregate’s parameter 0.6628616 0.6628616 5.5e-14 1e-06 yes
6 gross view wang: parameter lambda 0.4202857 0.4202857 2.4e-13 1e-06 yes
6 gross view wang: price of min(X, a) * 1350.8035400 1350.8035400 2.4e-13 1e-06 yes
6 gross view wang: unlimited price 1378.2249600 1378.2249600 3.3e-11 1e-06 yes
6 gross view dual: g(0.05) at aggregate’s parameter 0.0925026 0.0925026 5.9e-15 1e-06 yes
6 gross view dual: g(0.5) at aggregate’s parameter 0.7306312 0.7306312 3.5e-15 1e-06 yes
6 gross view dual: parameter beta 1.8923451 1.8923451 7.2e-15 1e-06 yes
6 gross view dual: price of min(X, a) * 1350.8035400 1350.8035400 3.2e-13 1e-06 yes
6 gross view dual: unlimited price 1366.4343900 1366.4343900 4.0e-12 1e-06 yes
6 gross view tvar: g(0.05) at aggregate’s parameter 0.0808292 0.0808292 4.9e-09 1e-06 yes
6 gross view tvar: g(0.5) at aggregate’s parameter 0.8082919 0.8082919 4.9e-09 1e-06 yes
6 gross view tvar: parameter p 0.3814116 0.3814116 8.0e-09 1e-06 yes
6 gross view tvar: price of min(X, a) * 1350.8035500 1350.8035400 3.2e-09 1e-06 yes
6 gross view tvar: unlimited price 1364.1838800 1364.1838700 3.2e-09 1e-06 yes
6 gross view fixed ph0.7: price of min(X, a) 1348.2879800 1348.2879800 3.2e-13 1e-06 yes
6 gross view fixed wang0.4: price of min(X, a) 1328.1938900 1328.1938900 3.2e-13 1e-06 yes
6 gross view fixed dual1.8: price of min(X, a) 1315.2517300 1315.2517300 3.1e-13 1e-06 yes
6 gross view fixed tvar0.3: price of min(X, a) 1244.5975500 1244.5975500 2.8e-13 1e-06 yes
6 gross view fixed ccoc0.1: price of min(X, a) * 1350.8035400 1350.8035400 1.7e-13 1e-06 yes

Where and why the numbers differ

All results are inside their tolerances. We set the tolerances after a first run of the Python notebook, from the differences below. The summary prints the worst difference in each class beside its tolerance, and most results agree far better. The differences have six causes.

  1. The grid. The bucket size sets every grid value: the severity is rounded to it, and the loss above a limit sits on the limit. prospicio takes the bucket from the caller, so each section gives the bucket that aggregate chose, for parity only. recommend_grid() and compound_auto() can give a different bucket. For the book of section 1 they get only the unlimited lognormal, and they recommend a step of 2, where aggregate, which sees the policy limit, uses 4. A finer step is safer, but its values then differ from the values of aggregate by discretisation. On a shared grid the quantiles agree exactly. At every compared quantile the cdf is at least 6.7e-8 away from the probability, far above rounding, so no quantile sits on a tie.

  2. The grid mean is not the exact mean. est_m in aggregate and the grid’s mean here are the mean of the rounded severity compounded: 950.16 against an exact 950.58 in section 1, 0.044% low, and 544.17 against 544.59 for the layer 250 xs 0. Contract terms are exact for the discretized severity, not for the continuous one. When the exact value is important, quote it (lev(), layer()), and compare grid with grid, as the tables do.

  3. A share off the grid. aggregate re-buckets a ceded amount between its buckets, which adds a little variance. prospicio gives a share its own step (share x bs), which adds no rounding. The means agree. In sections 2 and 4, the standard deviation differs by 2.6e-6 for the 80% share and 7.4e-6 for the 50% stop-loss share, the skewness by up to 9.5e-6, and a quantile by at most half a bucket.

  4. The tail beyond the grid. prospicio puts the probability beyond the last grid point on that point. aggregate (with normalize=False) removes it. The effect is the probability beyond the grid times the distance to the layer. Thus the stop loss at 2,800, deep in the tail of section 3, has a 1e-5 tolerance (5.7e-7 observed). The unnormalised setting gives the match. The default of aggregate, normalize=True, makes the tail thinner instead.

  5. Skewness. An FFT leaves rounding noise of order 1e-16 on every grid point. The noise goes up to the top of the grid at 2^16 x bs (262,144 for a bucket of 4). The two packages leave different noise. The third moment weights a point by the cube of its distance from the mean. Thus noise at the top of the grid moves the skewness of a light-tailed cover in the sixth digit. Against the skewness of aggregate’s density (*_skew_central in the reference file), the layer 250 xs 250 differs by about 2e-6. The noise depends on the platform: 1.5e-6 on Windows and 1.8e-6 on Linux. Remove prospicio’s probability above 10,000, and the difference falls under 1e-13 (the chunk below). The annual loss of that layer cannot reach 10,000 with any real probability.

    The skew that aggregate quotes (*_skew) differs again, by up to 8.6e-7. The cause is xsden_to_meancvskew: it puts the mass that the density lacks (1 - sum(p)) one bucket past the grid, as truncation. Since aggregate 2.0 a deficit of 1e-12 or less counts as rounding and stays out, so the quoted skew equals the density’s to about 1e-11, except where the grid drops real tail mass: the stop loss at 2,800 of point 4 (normalize=False, a deficit of 5.7e-10). Version 1.0.1 also moved a rounding deficit of 1e-15, and its quoted skew differed by up to 8.1e-5. That is a convention, not a property of the distribution. Thus this document compares the skewness of the density, with a 2e-5 tolerance. The worst difference observed, 9.5e-6, is the 50% stop-loss share of point 3, where aggregate’s re-bucketing adds to the noise. Skewness is the one statistic with a tolerance from a modelling choice, not from the grid.

  6. Definitions. Some quantities have a specific meaning in aggregate, and the comparison uses the same meaning:

    • its quantiles are the lower quantile on the grid,
    • cond_sev_mean and the attachment probability are conditional on the claim reaching the layer,
    • net of holds the loss on the other side of the layer,
    • the “insurance charge” of an aggregate deductible is the excess ratio (the Table M charge), not the loss elimination ratio,
    • the probability of a reinstatement is the probability of any loss to the layer,
    • reinstatements are pro rata as to amount,
    • the placed share scales the terms of a swing premium, but not its loss conversion factor,
    • a profit commission does not deduct a ceding commission,
    • the calibration of the distortions stops at a premium error.
skew_names <- grep("_skew$", names(AGG), value = TRUE)
keys <- sub("\\|", "\\\\|", skew_names)
quoted <- NULL
for (k in skew_names) {
  central <- sub("_skew$", "_skew_central", k)
  if (central %in% names(AGG)) quoted <- c(quoted, setNames(AGG[[k]] / AGG[[central]] - 1, k))
}
quoted <- quoted[order(-abs(quoted))]
cat(sprintf("%d skewness values; aggregate's quoted skew is within %.1e of its density's.\n",
            length(quoted), abs(quoted[[1]])))
## 27 skewness values; aggregate's quoted skew is within 8.6e-07 of its density's.
cat("largest differences, with the density deficit that aggregate places one bucket past the grid:\n")
## largest differences, with the density deficit that aggregate places one bucket past the grid:
for (k in names(quoted)[1:4]) {
  parts <- strsplit(k, "|", fixed = TRUE)[[1]]
  deficit <- agg_value(parts[1], sub("_skew$", "_density_deficit", parts[2]))
  beyond <- POINTS * agg_value(parts[1], "bs")  # one bucket past the grid's top
  cat(sprintf("  %s %s: %+.1e (deficit %.1e at %s adds about %s to the third moment)\n", parts[1], parts[2],
              quoted[[k]], deficit, format(beyond, big.mark = ","), format(round(deficit * beyond^3), big.mark = ",")))
}
##   agg_limit_reinst agglimit2800_ceded_skew: +8.6e-07 (deficit 5.7e-10 at 8,192 adds about 311 to the third moment)
##   agg_limit_reinst gross_skew: +6.1e-07 (deficit 5.7e-10 at 8,192 adds about 311 to the third moment)
##   variable_pc three_year_loss_skew: -8.7e-12 (deficit 2.9e-13 at 16,384 adds about 1 to the third moment)
##   variable_retro ceded_loss_skew: -4.2e-12 (deficit 2.4e-13 at 4,096 adds about 0 to the third moment)
# prospicio's skewness of 250 xs 250 against aggregate's density, with and without the noise at the top of the grid.
lyr <- tower_grids$ceded[[2]]
central <- agg_value("tower_gross", "layer_250x250_ceded_skew_central")
x <- (seq_along(lyr@probs) - 1) * lyr@step
keep <- x < 10000
mean_k <- sum(x[keep] * lyr@probs[keep])
var_k <- sum((x[keep] - mean_k)^2 * lyr@probs[keep])
below <- sum((x[keep] - mean_k)^3 * lyr@probs[keep]) / var_k^1.5
whole <- moments(lyr)[["skew"]]
cat(sprintf("\nlayer 250 xs 250, skewness of aggregate's density %.10f; prospicio's on the whole grid %.10f (%+.1e), below 10,000 %.10f (%+.1e); probability dropped %.1e\n",
            central, whole, whole / central - 1, below, below / central - 1, sum(lyr@probs[!keep])))
## 
## layer 250 xs 250, skewness of aggregate's density 1.3742361283; prospicio's on the whole grid 1.3742385535 (+1.8e-06), below 10,000 1.3742361283 (+3.3e-14); probability dropped 6.7e-16