Pricing reinsurance with prospicio, beside aggregate
This notebook prices six reinsurance contracts with prospicio. It puts each result beside the value that Stephen Mildenhall’s Python package aggregate (1.0.1) gives for the same contract. 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 prospicio 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 notebook:
- Clone the repository.
- Install the released package with
pip install prospicio matplotlib jupyter(oruv pip install). PyPI has prebuilt wheels, so you do not need a Rust toolchain. - Open this notebook from any folder in the repository.
To run it on unreleased changes, build from source with cd python && maturin develop, which needs Rust. The notebook 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 notebook 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, 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.
import csv
import math
from pathlib import Path
from statistics import NormalDist
from prospicio.aggregate import fft, recommend_grid
from prospicio.distributions import Burr, Grid, Lognormal, Mixture, Poisson, claim_count
from prospicio.reinsurance import Layer, LossSensitivePremium, Tower
from prospicio.risk import Distortion, calibrate
POINTS = 2**16 # aggregate's log2 = 16 in every example
# The repository's reference folder, from wherever the notebook runs inside the repository.
REFERENCE = next((p / "validation" / "reference" for p in [Path.cwd(), *Path.cwd().parents]
if (p / "validation" / "reference").is_dir()), None)
if REFERENCE is None:
raise FileNotFoundError(
f"validation/reference not found in {Path.cwd()} or above it: this notebook reads aggregate's numbers "
"from the repository, so open it from inside a clone of the repository")
with open(REFERENCE / "re_pricing_aggregate.csv") as f:
AGG = {(r["example"], r["quantity"]): float(r["value"]) for r in csv.DictReader(f)}
print(f"{len(AGG)} reference values from aggregate 1.0.1 in {REFERENCE.parent.name}/{REFERENCE.name}/re_pricing_aggregate.csv")
def money(x):
return f"{x:,.2f}"
def moments(grid):
# Mean, standard deviation, CV and skewness of a Grid. Grid has no skewness method,
# so the third central moment is the one statistic summed here by hand.
h, p = grid.step, grid.probs
mean, sd = grid.mean(), math.sqrt(grid.variance())
m3 = sum((i * h - mean) ** 3 * q for i, q in enumerate(p))
return mean, sd, sd / mean, m3 / sd**3
def prob_at_least(grid, x):
# P(X >= x) on a grid whose points may not include x: the cdf half a step below x.
return 1.0 - grid.cdf(x - grid.step / 2)
def discretize(severity, bs, limit):
# Round the severity to buckets of size bs, with the policy limit as the last point.
# Grid.rounding puts all mass beyond its last point there: aggregate's `limit xs 0`.
grid, _ = Grid.rounding(severity, bs, round(limit / bs) + 1)
return grid
def mixed_poisson(n, mixing_cv):
# Gamma-mixed Poisson (aggregate's `mixed gamma cv`): a negative binomial with Var/E = 1 + cv^2 n.
return claim_count(n, 1 + mixing_cv**2 * n)
def exposure_book(subject, rate, shapes, scale, limit):
# 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.
lomax = [Burr(a, 1.0, scale) for a in shapes]
counts = [s * r / v.lev(limit) for s, r, v in zip(subject, rate, lomax)]
n = sum(counts)
return counts, n, Mixture([(c / n, v) for c, v in zip(counts, lomax)])
# Tolerance by class, as (tolerance, unit); see the table above.
TOLERANCES = {
"mean": (1e-6, "rel"), # means, probabilities, premiums, commissions, prices
"sd": (1e-6, "rel"), # standard deviation and CV
"share sd": (1e-5, "rel"), # the same for a share placed off the grid
"skew": (2e-5, "rel"), # against the skewness of aggregate's density
"quantile": (0, "buckets"), # the same grid point
"share quantile": (1, "buckets"), # a share placed off the grid
"tail": (1e-5, "rel"), # a stop loss far in the tail
}
COMPARISONS = [] # every comparison, for the summary at the end
SHOWN = [] # those to print at the next report()
def _record(section, name, agg, pro, diff, cls, show, check):
tol, unit = TOLERANCES[cls]
row = dict(section=section, name=name, aggregate=agg, prospicio=pro, diff=diff, cls=cls,
unit=unit, tol=tol, ok=bool(diff <= tol), check=check)
COMPARISONS.append(row)
if show:
SHOWN.append(row)
def compare(section, name, example, quantity, value, cls="mean", show=True, check=False):
# Relative difference from aggregate's number, which the CSV holds under (example, quantity).
# check=True marks a consistency check: a row that holds by construction, not by agreement.
agg = AGG[(example, quantity)]
diff = abs(value - agg) / abs(agg) if agg else abs(value)
_record(section, name, agg, value, diff, cls, show, check)
def compare_quantile(section, name, example, quantity, value, bs, cls="quantile", show=True):
# Difference of a quantile in buckets.
agg = AGG[(example, quantity)]
_record(section, name, agg, value, abs(value - agg) / bs, cls, show, False)
def compare_distribution(section, name, example, prefix, grid, bs, share=False,
shown=("mean", "sd", "cv", "skew", "q0.5", "q0.9", "q0.99", "q0.999")):
# 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).
mean, sd, cv, skew = moments(grid)
sd_cls = "share sd" if share else "sd"
for stat, quantity, value, cls in [("mean", "mean", mean, "mean"), ("sd", "sd", sd, sd_cls),
("cv", "cv", cv, sd_cls), ("skew", "skew_central", skew, "skew")]:
compare(section, f"{name} {stat}", example, f"{prefix}_{quantity}", value, cls, stat in shown)
for p in (0.5, 0.9, 0.99, 0.999):
compare_quantile(section, f"{name} q{p}", example, f"{prefix}_q{p}", grid.quantile(p), bs,
"share quantile" if share else "quantile", f"q{p}" in shown)
def report():
# Print the comparisons made since the last report; * marks a consistency check.
print(f"{'quantity':40s} {'aggregate':>14s} {'prospicio':>14s} {'difference':>12s} pass")
for r in SHOWN:
diff = f"{r['diff']:.1e}" if r["unit"] == "rel" else f"{r['diff']:.2f} bkt"
name = r["name"] + (" *" if r["check"] else "")
print(f"{name:40s} {r['aggregate']:14.8g} {r['prospicio']:14.8g} {diff:>12s} "
f"{'yes' if r['ok'] else 'NO'}")
SHOWN.clear()544 reference values from aggregate 1.0.1 in validation/reference/re_pricing_aggregate.csv
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 prospicio. discretize rounds the severity to the grid. 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.0
claims = Poisson(10.0)
severity = Lognormal.from_mean_cv(100.0, 5.0)
sev_grid = discretize(severity, BS1, 5000.0)
gross, gross_report = fft(claims, sev_grid, POINTS)
print(f"mean claim: exact {severity.lev(5000.0):.4f}, on the grid {sev_grid.mean():.4f}")
print(f"annual gross: exact {10 * severity.lev(5000.0):.4f}, on the grid {gross.mean():.4f}")
size = recommend_grid(claims, severity)
print(f"recommend_grid on the unlimited lognormal: step {size.step:g}; aggregate, which sees the 5,000 limit, "
f"used {AGG[('tower_gross', 'bs')]:g}")
print(f"aliasing error {gross_report.aliasing_error:.1e}, mass beyond the grid {gross_report.tail_mass:.1e}")
compare(S1, "mean claim, exact", "tower_gross", "sev_mean_exact", severity.lev(5000.0))
compare(S1, "mean claim, grid", "tower_gross", "sev_mean_grid", sev_grid.mean())
compare(S1, "annual gross mean, exact", "tower_gross", "gross_mean_exact", 10 * severity.lev(5000.0))
compare_distribution(S1, "gross", "tower_gross", "gross", gross, BS1)
report()mean claim: exact 95.0575, on the grid 95.0161
annual gross: exact 950.5755, on the grid 950.1608
recommend_grid on the unlimited lognormal: step 2; aggregate, which sees the 5,000 limit, used 4
aliasing error 8.7e-19, mass beyond the grid 5.4e-15
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.57547 950.57547 2.2e-15 yes
gross mean 950.16081 950.16081 3.0e-12 yes
gross sd 1016.6156 1016.6156 2.2e-10 yes
gross cv 1.0699406 1.0699406 2.2e-10 yes
gross skew 2.8645302 2.8645303 3.5e-08 yes
gross q0.5 632 632 0.00 bkt yes
gross q0.9 2024 2024 0.00 bkt yes
gross q0.99 5440 5440 0.00 bkt yes
gross q0.999 7412 7412 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 fft_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 = [(250.0, 0.0), (250.0, 250.0), (500.0, 500.0), (1000.0, 1000.0), (3000.0, 2000.0)]
tower = Tower([Layer(f"{lim:g} xs {att:g}", lim, att) for lim, att in TOWER])
tower_grids = tower.on_grid(claims, sev_grid, POINTS)
print(f"{'layer':>13s} {'mean':>9s} {'cv':>7s} {'loss on line':>13s} {'P(claim reaches)':>17s} "
f"{'mean | reaches':>15s}")
for (lim, att), layer_grid in zip(TOWER, tower_grids.ceded):
name = f"{lim:g} xs {att:g}"
tag = f"layer_{lim:g}x{att:g}" # the reference file's name
ex = "tower_gross"
compare_distribution(S1, f"layer {name}", ex, f"{tag}_ceded", layer_grid, BS1, shown=("mean",))
compare(S1, f"layer {name} mean, exact", ex, f"{tag}_ceded_mean_exact", 10 * severity.layer(lim, att),
show=False)
reaches = 1.0 - sev_grid.cdf(att)
cond = sev_grid.layer(lim, att) / reaches
compare(S1, f"layer {name} loss on line", ex, f"{tag}_loss_on_line", layer_grid.mean() / lim, show=False)
compare(S1, f"layer {name} P(claim reaches layer)", ex, f"{tag}_pr_attach_grid", reaches, show=False)
compare(S1, f"layer {name} P(claim exhausts layer)", ex, f"{tag}_pr_detach_grid",
prob_at_least(sev_grid, att + lim), show=False)
compare(S1, f"layer {name} mean given it reaches", ex, f"{tag}_cond_sev_mean", cond, show=False)
print(f"{name:>13s} {layer_grid.mean():9.3f} {moments(layer_grid)[2]:7.3f} {layer_grid.mean() / lim:13.4f} "
f"{reaches:17.4f} {cond:15.3f}")
print(f"claims below half a bucket, which round to 0: {severity.cdf(BS1 / 2):.4f}; exact mean claim in 250 xs 0: "
f"{severity.layer(250.0, 0.0):.3f}")
total = sum(c.mean() for c in tower_grids.ceded)
compare(S1, "sum of layers equals gross", "tower_gross", "tower_ceded_total_mean", total)
print(f"layers add up to {total:.4f}, gross is {gross.mean():.4f}; on grid points: {tower_grids.on_points}")
report() layer mean cv loss on line P(claim reaches) mean | reaches
250 xs 0 544.170 0.538 2.1767 0.8970 60.664
250 xs 250 133.053 1.279 0.5322 0.0792 167.893
500 xs 500 114.811 1.924 0.2296 0.0362 317.000
1000 xs 1000 87.092 3.084 0.0871 0.0147 594.252
3000 xs 2000 71.035 5.599 0.0237 0.0052 1367.998
claims below half a bucket, which round to 0: 0.1030; exact mean claim in 250 xs 0: 54.459
layers add up to 950.1608, gross is 950.1608; on grid points: False
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.091755 87.091755 4.1e-15 yes
layer 3000 xs 2000 mean 71.035004 71.035004 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.
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(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 cell after the comparison solves for that deposit for each schedule.
S3 = "3 limit and reinstatements"
BS3 = 1 / 8
counts3, n3, mix3 = exposure_book([2000.0] * 3, [0.10, 0.14, 0.21], [1.5, 1.3, 1.1], 300.0, 700.0)
freq3 = mixed_poisson(n3, 0.07)
sev3 = discretize(mix3, BS3, 700.0)
gross3, report3 = fft(freq3, sev3, POINTS)
print(f"expected claims by class {[round(c, 4) for c in counts3]}, total {n3:.4f}")
print(f"frequency {freq3}")
print(f"mass beyond the grid {report3.tail_mass:.1e}")
for i, c in enumerate(counts3, 1):
compare(S3, f"class {i} expected claims", "agg_limit_reinst", f"class{i}_expected_count", c)
compare(S3, "expected claims", "agg_limit_reinst", "claim_count_mean", n3)
compare(S3, "gross mean, exact", "agg_limit_reinst", "gross_mean_exact", n3 * mix3.lev(700.0))
exact_cv3 = math.sqrt(n3 * mix3.layer_second_moment(700.0, 0.0) + 0.07**2 * (n3 * mix3.lev(700.0)) ** 2) \
/ (n3 * mix3.lev(700.0))
compare(S3, "gross CV, exact", "agg_limit_reinst", "gross_cv_exact", exact_cv3)
compare_distribution(S3, "gross", "agg_limit_reinst", "gross", gross3, BS3)
report()expected claims by class [0.737, 0.9236, 1.2342], total 2.8949
frequency NegativeBinomial(r=204.08163265306163, beta=0.014184778968906908)
mass beyond the grid 5.7e-10
quantity aggregate prospicio difference pass
class 1 expected claims 0.73701074 0.73701074 6.0e-16 yes
class 2 expected claims 0.92362085 0.92362085 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 900 1.3e-16 yes
gross CV, exact 0.7696938 0.7696938 1.4e-16 yes
gross mean 899.99999 899.99999 6.3e-14 yes
gross sd 692.72442 692.72442 1.4e-13 yes
gross cv 0.76969381 0.76969381 2.0e-13 yes
gross skew 0.90206833 0.90206889 6.1e-07 yes
gross q0.5 785.75 785.75 0.00 bkt yes
gross q0.9 1843 1843 0.00 bkt yes
gross q0.99 2917.125 2917.125 0.00 bkt yes
gross q0.999 3816.25 3816.25 0.00 bkt yes
limit_layer = Layer("2800 aggregate limit", 700.0, 0.0, aggregate_limit=2800.0)
limited = Tower([limit_layer]).on_grid(freq3, sev3, POINTS).ceded[0]
beyond = gross3.stop_loss(2800.0)
print(f"mean recovery {money(limited.mean())}, P(limit used up) {prob_at_least(gross3, 2800.0):.5f}, "
f"loss above the limit {beyond:.4f}")
compare_distribution(S3, "recovery under 2800", "agg_limit_reinst", "agglimit2800_ceded", limited, BS3,
shown=("mean", "sd", "q0.99"))
compare(S3, "P(limit used up)", "agg_limit_reinst", "agglimit2800_pr_hit", prob_at_least(gross3, 2800.0))
compare(S3, "loss above the limit", "agg_limit_reinst", "agglimit2800_mean_loss_beyond", beyond, "tail")
report()mean recovery 894.68, P(limit used up) 0.01370, loss above the limit 5.3193
quantity aggregate prospicio difference pass
recovery under 2800 mean 894.68068 894.68068 3.4e-09 yes
recovery under 2800 sd 674.94584 674.94582 3.1e-08 yes
recovery under 2800 q0.99 2800 2800 0.00 bkt yes
P(limit used up) 0.013700601 0.013700601 4.1e-08 yes
loss above the limit 5.3193114 5.3193144 5.7e-07 yes
DEPOSIT, LIMIT3, TARGET_LR = 1200.0, 700.0, 0.65
per_deposit = {}
for tag, rates in [("A", [1.0, 1.0, 1.0]), ("B", [0.0, 0.5, 1.0])]:
layer = Layer(f"schedule {tag}", LIMIT3, 0.0, reinstatement_rates=rates).with_deposit_premium(DEPOSIT)
grids = Tower([layer]).on_grid(freq3, sev3, POINTS)
reinstatement = grids.expected_reinstatement_premium[0]
recovery = grids.ceded[0].mean()
total = layer.premium + reinstatement
per_deposit[tag] = (reinstatement / layer.premium, recovery)
print(f"schedule {tag} {rates}: deposit {money(layer.premium)} (rate on line {layer.premium / LIMIT3:.0%}), "
f"expected reinstatement premium {money(reinstatement)}, total {money(total)}")
print(f" expected recovery {money(recovery)}, loss ratio {recovery / total:.1%}, "
f"margin {money(total - recovery)}")
compare(S3, f"{tag}: expected reinstatement premium", "agg_limit_reinst", f"reinst{tag}_premium_mean",
reinstatement)
compare(S3, f"{tag}: total premium", "agg_limit_reinst", f"reinst{tag}_total_premium_mean", total)
compare(S3, f"{tag}: recovery", "agg_limit_reinst", f"reinst{tag}_recovery_mean", recovery)
compare(S3, f"{tag}: P(any loss to the layer)", "agg_limit_reinst", f"reinst{tag}_pr_any_reinstatement",
1.0 - gross3.probs[0])
compare(S3, f"{tag}: maximum premium", "agg_limit_reinst", f"reinst{tag}_max_premium",
layer.premium * sum(rates), show=False, check=True)
report()
# 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.
print()
for tag, (k, recovery) in per_deposit.items():
deposit = recovery / TARGET_LR / (1 + k)
print(f"schedule {tag}: a deposit of {money(deposit)} (rate on line {deposit / LIMIT3:.0%}) prices it at a "
f"{TARGET_LR:.0%} loss ratio, total {money(deposit * (1 + k))}, {k / (1 + k):.0%} of it from reinstatements")schedule A [1.0, 1.0, 1.0]: 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, 0.5, 1.0]: 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
quantity aggregate prospicio difference pass
A: expected reinstatement premium 1495.5693 1495.5693 1.4e-09 yes
A: total premium 2695.5693 2695.5693 7.5e-10 yes
A: recovery 894.68068 894.68068 1.8e-09 yes
A: P(any loss to the layer) 0.94351392 0.94351392 6.0e-10 yes
B: expected reinstatement premium 371.58102 371.58102 2.7e-09 yes
B: total premium 1571.581 1571.581 6.5e-10 yes
B: recovery 894.68068 894.68068 1.8e-09 yes
B: P(any loss to the layer) 0.94351392 0.94351392 6.0e-10 yes
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:
import matplotlib.pyplot as plt
xs = [i * 10.0 for i in range(421)]
fig, ax = plt.subplots(figsize=(7, 3.8))
ax.plot(xs, [1.0 - gross3.cdf(x) for x in xs], label="gross annual layer loss")
ax.plot(xs, [1.0 - limited.cdf(x) for x in xs], color="C3", label="recovery under the 2,800 limit")
ax.axvline(2800.0, color="grey", ls="--", lw=1)
ax.set_yscale("log")
ax.set_ylim(1e-4, 1.2)
ax.set_xlabel("annual loss (currency units)")
ax.set_ylabel("probability of exceeding")
ax.set_title("Treaty 2: the limit cuts the tail at 2,800")
ax.legend()
fig.tight_layout()
plt.show()
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. Layer.stop_loss(name, limit, retention) builds the first three covers at 100%. For the 50% share, the cell uses the Layer constructor with share=0.5, 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. The notebook uses the values of the code.
S4 = "4 stop loss"
def annual_cover(layer):
# The annual ceded and net of one aggregate cover on the book of section 1.
return Tower([layer]).on_grid(claims, sev_grid, POINTS)
for lim, att in [(250.0, 750.0), (1500.0, 1000.0)]:
name = f"{lim:g} xs {att:g}"
cover = annual_cover(Layer.stop_loss(name, lim, att))
tag = f"asl_{lim:g}x{att:g}"
compare_distribution(S4, name, "stop_loss", f"{tag}_ceded", cover.ceded[0], BS1,
shown=("mean", "cv", "q0.9"))
compare(S4, f"{name} P(attach)", "stop_loss", f"{tag}_pr_attach", 1.0 - gross.cdf(att))
compare(S4, f"{name} P(exhaust)", "stop_loss", f"{tag}_pr_exhaust", prob_at_least(gross, att + lim))
compare(S4, f"{name} loss on line", "stop_loss", f"{tag}_loss_on_line", cover.ceded[0].mean() / lim)
both = annual_cover(Layer.stop_loss("750 to 2500", 1750.0, 750.0))
# Layer.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(Layer("50% of 1500 xs 1000", math.inf, 0.0, share=0.5, aggregate_deductible=1000.0,
aggregate_limit=1500.0))
compare_distribution(S4, "both layers, ceded", "stop_loss", "asl_both_ceded", both.ceded[0], BS1,
shown=("mean", "cv"))
compare_distribution(S4, "both layers, net", "stop_loss", "asl_both_net", both.net, BS1,
shown=("mean", "cv", "q0.9"))
compare_distribution(S4, "50% of 1500 xs 1000", "stop_loss", "asl_50pct_1500x1000_ceded", half.ceded[0], BS1,
share=True, shown=("mean", "cv"))
print(f"750 to 2,500: ceded {both.ceded[0].mean():.3f} + net {both.net.mean():.3f} = {gross.mean():.3f}")
report()750 to 2,500: ceded 310.061 + net 640.100 = 950.161
quantity aggregate prospicio difference pass
250 xs 750 mean 89.806004 89.806004 1.9e-14 yes
250 xs 750 cv 1.2760283 1.2760283 1.4e-14 yes
250 xs 750 q0.9 252 252 0.00 bkt yes
250 xs 750 P(attach) 0.42378674 0.42378674 1.1e-13 yes
250 xs 750 P(exhaust) 0.30365425 0.30365425 1.6e-13 yes
250 xs 750 loss on line 0.35922402 0.35922402 1.8e-14 yes
1500 xs 1000 mean 220.2549 220.2549 3.9e-14 yes
1500 xs 1000 cv 2.0322163 2.0322163 1.6e-14 yes
1500 xs 1000 q0.9 1024 1024 0.00 bkt yes
1500 xs 1000 P(attach) 0.30208796 0.30208796 1.6e-13 yes
1500 xs 1000 P(exhaust) 0.067240438 0.067240438 7.0e-13 yes
1500 xs 1000 loss on line 0.1468366 0.1468366 3.9e-14 yes
both layers, ceded mean 310.0609 310.0609 3.2e-14 yes
both layers, ceded cv 1.7188985 1.7188985 1.2e-14 yes
both layers, net mean 640.09991 640.09991 2.2e-12 yes
both layers, net cv 0.91040967 0.91040967 5.4e-10 yes
both layers, net q0.9 752 752 0.00 bkt yes
50% of 1500 xs 1000 mean 110.12745 110.12745 3.9e-14 yes
50% of 1500 xs 1000 cv 2.0322313 2.0322163 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 = ((1.036 - 1) / 5.154) ** 0.5
counts4, n4, mix4 = exposure_book([9000.0, 3000.0], [0.04, 0.03], [0.9, 0.95], 40.0, 160.0)
sev4 = discretize(mix4, BS4, 160.0)
aad = Layer("AAD 360", math.inf, 0.0, aggregate_deductible=360.0)
gross4, _ = fft(mixed_poisson(n4, MIX_CV4), sev4, POINTS)
after_aad = Tower([aad]).on_grid(mixed_poisson(n4, MIX_CV4), sev4, POINTS).ceded[0]
gross4_poisson, _ = fft(Poisson(n4), sev4, POINTS)
after_aad_poisson = Tower([aad]).on_grid(Poisson(n4), sev4, POINTS).ceded[0]
absorbed = gross4.lev(360.0)
print(f"expected claims {n4:.4f}, gross CV {moments(gross4)[2]:.4f} (the text quotes 0.528)")
print(f"expected loss {money(gross4.mean())}; after the deductible {money(after_aad.mean())}; "
f"absorbed by the deductible {money(absorbed)}")
print(f"loss elimination ratio (the cedant's credit) {absorbed / gross4.mean():.4f}; excess ratio (the reinsurer's "
f"share, aggregate's insurance charge) {after_aad.mean() / gross4.mean():.4f}")
print(f"with Poisson counts the loss after the deductible falls to {money(after_aad_poisson.mean())}")
for i, c in enumerate(counts4, 1):
compare(S4B, f"class {i} expected claims", "stop_loss_aad", f"class{i}_expected_count", c, show=False)
compare(S4B, "gross mean, exact", "stop_loss_aad", "gross_mean_exact", n4 * mix4.lev(160.0))
exact_cv4 = math.sqrt(n4 * mix4.layer_second_moment(160.0, 0.0) + MIX_CV4**2 * (n4 * mix4.lev(160.0)) ** 2) \
/ (n4 * mix4.lev(160.0))
compare(S4B, "gross CV, exact", "stop_loss_aad", "gross_cv_exact", exact_cv4)
compare_distribution(S4B, "gross", "stop_loss_aad", "gross", gross4, BS4, shown=("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",
after_aad.mean() / gross4.mean())
compare_distribution(S4B, "Poisson, after the deductible", "stop_loss_aad", "poisson_after_aad",
after_aad_poisson, BS4, shown=("mean", "cv"))
compare(S4B, "Poisson gross mean", "stop_loss_aad", "poisson_gross_mean", gross4_poisson.mean(), show=False)
report()expected claims 6.4966, gross CV 0.5285 (the text quotes 0.528)
expected loss 450.00; after the deductible 142.76; absorbed by the deductible 307.24
loss elimination ratio (the cedant's credit) 0.6828; excess ratio (the reinsurer's share, aggregate's insurance charge) 0.3172
with Poisson counts the loss after the deductible falls to 141.80
quantity aggregate prospicio difference pass
gross mean, exact 450 450 0.0e+00 yes
gross CV, exact 0.52849748 0.52849748 2.1e-16 yes
gross mean 449.99998 449.99998 2.2e-12 yes
gross cv 0.52849751 0.52849751 2.0e-11 yes
gross q0.99 1103.625 1103.625 0.00 bkt yes
after the deductible mean 142.75897 142.75897 9.9e-13 yes
after the deductible sd 183.77961 183.77961 7.1e-12 yes
after the deductible cv 1.287342 1.287342 6.1e-12 yes
after the deductible skew 1.5338445 1.5338445 1.6e-10 yes
after the deductible q0.5 64.1875 64.1875 0.00 bkt yes
after the deductible q0.9 409 409 0.00 bkt yes
after the deductible q0.99 743.625 743.625 0.00 bkt yes
after the deductible q0.999 1016.8125 1016.8125 0.00 bkt yes
value of the deductible 307.24101 307.24101 3.5e-14 yes
excess ratio (insurance charge) 0.31724216 0.31724216 4.6e-12 yes
Poisson, after the deductible mean 141.79948 141.79948 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 Layer(aggregate_deductible=360) gives that side too. The value of the deductible to the cedant is E[min(X, 360)], Grid.lev(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.
Summary of every comparison
The table below lists each quantity that this notebook 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.
from collections import OrderedDict
independent = [r for r in COMPARISONS if not r["check"]]
checks = [r for r in COMPARISONS if r["check"]]
by_section = OrderedDict()
for r in independent:
by_section.setdefault(r["section"], []).append(r)
print("independent comparisons by section")
print(f"{'section':32s} {'compared':>9s} {'passed':>7s} worst relative difference")
for section, rows in by_section.items():
worst = max((r for r in rows if r["unit"] == "rel"), key=lambda r: r["diff"])
print(f"{section:32s} {len(rows):9d} {sum(r['ok'] for r in rows):7d} {worst['diff']:.1e} ({worst['name']})")
print("\nindependent comparisons by tolerance class")
print(f"{'class':16s} {'tolerance':>12s} {'rows':>5s} {'worst':>12s} where")
for cls, (tol, unit) in TOLERANCES.items():
rows = [r for r in independent if r["cls"] == cls]
worst = max(rows, key=lambda r: r["diff"])
fmt = (lambda v: f"{v:.1e}") if unit == "rel" else (lambda v: f"{v:g} bkt")
print(f"{cls:16s} {fmt(tol):>12s} {len(rows):5d} {fmt(worst['diff']):>12s} {worst['section']}: {worst['name']}")
failed = [r for r in COMPARISONS if not r["ok"]]
print(f"\n{sum(r['ok'] for r in COMPARISONS)} of {len(COMPARISONS)} comparisons are inside their tolerance: "
f"{len(independent)} independent comparisons and {len(checks)} consistency checks that hold by construction"
+ ("" if not failed else f"; outside: {[r['name'] for r in failed]}"))independent comparisons by section
section compared passed worst relative difference
1 tower 77 77 1.8e-06 (layer 250 xs 250 skew)
2 program 52 52 2.6e-06 (80% of 1000 xs 1000 sd)
3 limit and reinstatements 32 32 6.1e-07 (gross skew)
4 stop loss 46 46 9.5e-06 (50% of 1500 xs 1000 skew)
4 aggregate deductible 31 31 8.4e-10 (gross skew)
5 retro and swing 15 15 2.0e-10 (layer loss skew)
5 profit commission 13 13 7.3e-10 (three-year loss skew)
5 sliding scale 15 15 6.5e-10 (ceded loss skew)
6 ceded view 24 24 2.8e-09 (ph: g(0.05) at aggregate's parameter)
6 gross view 24 24 1.6e-08 (ph: unlimited price)
independent comparisons by tolerance class
class tolerance rows worst where
mean 1.0e-06 153 4.1e-08 3 limit and reinstatements: P(limit used up)
sd 1.0e-06 46 3.1e-08 3 limit and reinstatements: recovery under 2800 sd
share sd 1.0e-05 4 7.4e-06 4 stop loss: 50% of 1500 xs 1000 cv
skew 2.0e-05 25 9.5e-06 4 stop loss: 50% of 1500 xs 1000 skew
quantile 0 bkt 92 0 bkt 1 tower: gross q0.5
share quantile 1 bkt 8 0.5 bkt 4 stop loss: 50% of 1500 xs 1000 q0.99
tail 1.0e-05 1 5.7e-07 3 limit and reinstatements: loss above the limit
353 of 353 comparisons are inside their tolerance: 329 independent comparisons and 24 consistency checks that hold by construction
print(f"{'quantity':52s} {'aggregate':>15s} {'prospicio':>15s} {'difference':>11s} {'tolerance':>10s} pass")
last = None
for r in COMPARISONS:
if r["section"] != last:
print(f"-- {r['section']}")
last = r["section"]
diff = f"{r['diff']:.1e}" if r["unit"] == "rel" else f"{r['diff']:.2f} bkt"
tol = f"{r['tol']:.0e}" if r["unit"] == "rel" else f"{r['tol']} bkt"
name = r["name"] + (" *" if r["check"] else "")
print(f"{name:52s} {r['aggregate']:15.9g} {r['prospicio']:15.9g} {diff:>11s} {tol:>10s} "
f"{'yes' if r['ok'] else 'NO'}")quantity aggregate prospicio difference tolerance pass
-- 1 tower
mean claim, exact 95.0575471 95.0575471 2.2e-15 1e-06 yes
mean claim, grid 95.0160815 95.0160815 2.2e-15 1e-06 yes
annual gross mean, exact 950.575471 950.575471 2.2e-15 1e-06 yes
gross mean 950.160815 950.160815 3.0e-12 1e-06 yes
gross sd 1016.61564 1016.61564 2.2e-10 1e-06 yes
gross cv 1.06994061 1.06994061 2.2e-10 1e-06 yes
gross skew 2.86453019 2.86453029 3.5e-08 2e-05 yes
gross q0.5 632 632 0.00 bkt 0 bkt yes
gross q0.9 2024 2024 0.00 bkt 0 bkt yes
gross q0.99 5440 5440 0.00 bkt 0 bkt yes
gross q0.999 7412 7412 0.00 bkt 0 bkt yes
layer 250 xs 0 mean 544.169708 544.169708 2.1e-16 1e-06 yes
layer 250 xs 0 sd 292.749408 292.749408 7.8e-16 1e-06 yes
layer 250 xs 0 cv 0.537974466 0.537974466 6.2e-16 1e-06 yes
layer 250 xs 0 skew 0.710964593 0.710964593 1.3e-13 2e-05 yes
layer 250 xs 0 q0.5 508 508 0.00 bkt 0 bkt yes
layer 250 xs 0 q0.9 940 940 0.00 bkt 0 bkt yes
layer 250 xs 0 q0.99 1364 1364 0.00 bkt 0 bkt yes
layer 250 xs 0 q0.999 1716 1716 0.00 bkt 0 bkt yes
layer 250 xs 0 mean, exact 544.588728 544.588728 2.1e-16 1e-06 yes
layer 250 xs 0 loss on line 2.17667883 2.17667883 2.0e-16 1e-06 yes
layer 250 xs 0 P(claim reaches layer) 0.897027061 0.897027061 3.7e-16 1e-06 yes
layer 250 xs 0 P(claim exhausts layer) 0.0792484907 0.0792484907 2.6e-15 1e-06 yes
layer 250 xs 0 mean given it reaches 60.6636891 60.6636891 2.8e-15 1e-06 yes
layer 250 xs 250 mean 133.052954 133.052954 1.3e-12 1e-06 yes
layer 250 xs 250 sd 170.238397 170.238397 7.9e-10 1e-06 yes
layer 250 xs 250 cv 1.27947852 1.27947852 7.9e-10 1e-06 yes
layer 250 xs 250 skew 1.37423613 1.37423855 1.8e-06 2e-05 yes
layer 250 xs 250 q0.5 36 36 0.00 bkt 0 bkt yes
layer 250 xs 250 q0.9 356 356 0.00 bkt 0 bkt yes
layer 250 xs 250 q0.99 692 692 0.00 bkt 0 bkt yes
layer 250 xs 250 q0.999 952 952 0.00 bkt 0 bkt yes
layer 250 xs 250 mean, exact 133.048003 133.048003 3.0e-15 1e-06 yes
layer 250 xs 250 loss on line 0.532211816 0.532211816 1.3e-12 1e-06 yes
layer 250 xs 250 P(claim reaches layer) 0.0792484907 0.0792484907 2.6e-15 1e-06 yes
layer 250 xs 250 P(claim exhausts layer) 0.0365716904 0.0365716904 9.5e-16 1e-06 yes
layer 250 xs 250 mean given it reaches 167.89336 167.89336 2.2e-15 1e-06 yes
layer 500 xs 500 mean 114.811395 114.811395 3.3e-12 1e-06 yes
layer 500 xs 500 sd 220.909338 220.909338 1.0e-09 1e-06 yes
layer 500 xs 500 cv 1.92410639 1.92410639 1.0e-09 1e-06 yes
layer 500 xs 500 skew 2.09263087 2.09263327 1.1e-06 2e-05 yes
layer 500 xs 500 q0.5 0 0 0.00 bkt 0 bkt yes
layer 500 xs 500 q0.9 500 500 0.00 bkt 0 bkt yes
layer 500 xs 500 q0.99 1000 1000 0.00 bkt 0 bkt yes
layer 500 xs 500 q0.999 1324 1324 0.00 bkt 0 bkt yes
layer 500 xs 500 mean, exact 114.811846 114.811846 3.1e-15 1e-06 yes
layer 500 xs 500 loss on line 0.229622789 0.229622789 3.3e-12 1e-06 yes
layer 500 xs 500 P(claim reaches layer) 0.0362180768 0.0362180768 1.7e-15 1e-06 yes
layer 500 xs 500 P(claim exhausts layer) 0.0147381505 0.0147381505 5.9e-16 1e-06 yes
layer 500 xs 500 mean given it reaches 317.000251 317.000251 2.3e-15 1e-06 yes
layer 1000 xs 1000 mean 87.0917548 87.0917548 4.1e-15 1e-06 yes
layer 1000 xs 1000 sd 268.63194 268.63194 2.3e-15 1e-06 yes
layer 1000 xs 1000 cv 3.0844704 3.0844704 1.7e-15 1e-06 yes
layer 1000 xs 1000 skew 3.39868892 3.39868892 2.0e-14 2e-05 yes
layer 1000 xs 1000 q0.5 0 0 0.00 bkt 0 bkt yes
layer 1000 xs 1000 q0.9 264 264 0.00 bkt 0 bkt yes
layer 1000 xs 1000 q0.99 1000 1000 0.00 bkt 0 bkt yes
layer 1000 xs 1000 q0.999 2000 2000 0.00 bkt 0 bkt yes
layer 1000 xs 1000 mean, exact 87.0918646 87.0918646 9.0e-15 1e-06 yes
layer 1000 xs 1000 loss on line 0.0870917548 0.0870917548 4.0e-15 1e-06 yes
layer 1000 xs 1000 P(claim reaches layer) 0.0146556884 0.0146556884 3.8e-15 1e-06 yes
layer 1000 xs 1000 P(claim exhausts layer) 0.00520921908 0.00520921908 7.0e-15 1e-06 yes
layer 1000 xs 1000 mean given it reaches 594.252229 594.252229 2.5e-15 1e-06 yes
layer 3000 xs 2000 mean 71.0350036 71.0350036 1.5e-11 1e-06 yes
layer 3000 xs 2000 sd 397.74982 397.74982 8.9e-10 1e-06 yes
layer 3000 xs 2000 cv 5.59934962 5.59934962 8.8e-10 1e-06 yes
layer 3000 xs 2000 skew 6.53530883 6.53530999 1.8e-07 2e-05 yes
layer 3000 xs 2000 q0.5 0 0 0.00 bkt 0 bkt yes
layer 3000 xs 2000 q0.9 0 0 0.00 bkt 0 bkt yes
layer 3000 xs 2000 q0.99 3000 3000 0.00 bkt 0 bkt yes
layer 3000 xs 2000 q0.999 3000 3000 0.00 bkt 0 bkt yes
layer 3000 xs 2000 mean, exact 71.0350286 71.0350286 3.0e-14 1e-06 yes
layer 3000 xs 2000 loss on line 0.0236783345 0.0236783345 1.5e-11 1e-06 yes
layer 3000 xs 2000 P(claim reaches layer) 0.00519262547 0.00519262547 5.2e-15 1e-06 yes
layer 3000 xs 2000 P(claim exhausts layer) 0.00107176323 0.00107176323 4.0e-15 1e-06 yes
layer 3000 xs 2000 mean given it reaches 1367.99783 1367.99783 3.8e-15 1e-06 yes
sum of layers equals gross 950.160815 950.160815 2.3e-12 1e-06 yes
-- 2 program
gross mean 950.160815 950.160815 3.0e-12 1e-06 yes
gross sd 1016.61564 1016.61564 2.2e-10 1e-06 yes
gross cv 1.06994061 1.06994061 2.2e-10 1e-06 yes
gross skew 2.86453019 2.86453029 3.5e-08 2e-05 yes
gross q0.5 632 632 0.00 bkt 0 bkt yes
gross q0.9 2024 2024 0.00 bkt 0 bkt yes
gross q0.99 5440 5440 0.00 bkt 0 bkt yes
gross q0.999 7412 7412 0.00 bkt 0 bkt yes
ceded mean 201.903149 201.903149 2.8e-13 1e-06 yes
ceded sd 456.131351 456.131351 3.7e-11 1e-06 yes
ceded cv 2.25915917 2.25915917 3.6e-11 1e-06 yes
ceded skew 2.76086191 2.76086196 1.5e-08 2e-05 yes
ceded q0.5 0 0 0.00 bkt 0 bkt yes
ceded q0.9 816 816 0.00 bkt 0 bkt yes
ceded q0.99 1824 1824 0.00 bkt 0 bkt yes
ceded q0.999 3000 3000 0.00 bkt 0 bkt yes
net mean 748.257665 748.257665 2.4e-12 1e-06 yes
net sd 640.658558 640.658558 5.7e-10 1e-06 yes
net cv 0.85620046 0.856200461 5.7e-10 1e-06 yes
net skew 2.94012904 2.94012951 1.6e-07 2e-05 yes
net q0.5 616 616 0.00 bkt 0 bkt yes
net q0.9 1360 1360 0.00 bkt 0 bkt yes
net q0.99 3836 3836 0.00 bkt 0 bkt yes
net q0.999 4948 4948 0.00 bkt 0 bkt yes
ceded mean, exact 201.903711 201.903711 2.1e-15 1e-06 yes
net mean, exact 748.67176 748.67176 3.3e-15 1e-06 yes
net mean claim, grid 74.8257665 74.8257665 2.5e-15 1e-06 yes
layer 500 xs 500 mean 114.811395 114.811395 3.3e-12 1e-06 yes
layer 500 xs 500 sd 220.909338 220.909338 1.0e-09 1e-06 yes
layer 500 xs 500 cv 1.92410639 1.92410639 1.0e-09 1e-06 yes
layer 500 xs 500 skew 2.09263087 2.09263327 1.1e-06 2e-05 yes
layer 500 xs 500 q0.5 0 0 0.00 bkt 0 bkt yes
layer 500 xs 500 q0.9 500 500 0.00 bkt 0 bkt yes
layer 500 xs 500 q0.99 1000 1000 0.00 bkt 0 bkt yes
layer 500 xs 500 q0.999 1324 1324 0.00 bkt 0 bkt yes
layer 1000 xs 1000 mean 87.0917548 87.0917548 4.1e-15 1e-06 yes
layer 1000 xs 1000 sd 268.63194 268.63194 2.3e-15 1e-06 yes
layer 1000 xs 1000 cv 3.0844704 3.0844704 1.7e-15 1e-06 yes
layer 1000 xs 1000 skew 3.39868892 3.39868892 2.0e-14 2e-05 yes
layer 1000 xs 1000 q0.5 0 0 0.00 bkt 0 bkt yes
layer 1000 xs 1000 q0.9 264 264 0.00 bkt 0 bkt yes
layer 1000 xs 1000 q0.99 1000 1000 0.00 bkt 0 bkt yes
layer 1000 xs 1000 q0.999 2000 2000 0.00 bkt 0 bkt yes
80% of 1000 xs 1000 mean 69.6734038 69.6734038 2.9e-13 1e-06 yes
80% of 1000 xs 1000 sd 214.906117 214.905552 2.6e-06 1e-05 yes
80% of 1000 xs 1000 cv 3.08447852 3.0844704 2.6e-06 1e-05 yes
80% of 1000 xs 1000 skew 3.3986838 3.39868892 1.5e-06 2e-05 yes
80% of 1000 xs 1000 q0.5 0 0 0.00 bkt 1 bkt yes
80% of 1000 xs 1000 q0.9 212 211.2 0.20 bkt 1 bkt yes
80% of 1000 xs 1000 q0.99 800 800 0.00 bkt 1 bkt yes
80% of 1000 xs 1000 q0.999 1600 1600 0.00 bkt 1 bkt yes
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.737010742 0.737010742 6.0e-16 1e-06 yes
class 2 expected claims 0.92362085 0.92362085 1.3e-15 1e-06 yes
class 3 expected claims 1.23422126 1.23422126 9.0e-16 1e-06 yes
expected claims 2.89485285 2.89485285 3.1e-16 1e-06 yes
gross mean, exact 900 900 1.3e-16 1e-06 yes
gross CV, exact 0.769693799 0.769693799 1.4e-16 1e-06 yes
gross mean 899.999992 899.999992 6.3e-14 1e-06 yes
gross sd 692.72442 692.72442 1.4e-13 1e-06 yes
gross cv 0.769693806 0.769693806 2.0e-13 1e-06 yes
gross skew 0.902068335 0.902068889 6.1e-07 2e-05 yes
gross q0.5 785.75 785.75 0.00 bkt 0 bkt yes
gross q0.9 1843 1843 0.00 bkt 0 bkt yes
gross q0.99 2917.125 2917.125 0.00 bkt 0 bkt yes
gross q0.999 3816.25 3816.25 0.00 bkt 0 bkt yes
recovery under 2800 mean 894.680681 894.680678 3.4e-09 1e-06 yes
recovery under 2800 sd 674.945841 674.945821 3.1e-08 1e-06 yes
recovery under 2800 cv 0.754398587 0.754398566 2.7e-08 1e-06 yes
recovery under 2800 skew 0.721428616 0.721428617 1.1e-09 2e-05 yes
recovery under 2800 q0.5 785.75 785.75 0.00 bkt 0 bkt yes
recovery under 2800 q0.9 1843 1843 0.00 bkt 0 bkt yes
recovery under 2800 q0.99 2800 2800 0.00 bkt 0 bkt yes
recovery under 2800 q0.999 2800 2800 0.00 bkt 0 bkt yes
P(limit used up) 0.0137006006 0.0137006011 4.1e-08 1e-06 yes
loss above the limit 5.31931137 5.31931442 5.7e-07 1e-05 yes
A: expected reinstatement premium 1495.56926 1495.56926 1.4e-09 1e-06 yes
A: total premium 2695.56926 2695.56926 7.5e-10 1e-06 yes
A: recovery 894.680676 894.680678 1.8e-09 1e-06 yes
A: P(any loss to the layer) 0.943513922 0.943513923 6.0e-10 1e-06 yes
A: maximum premium * 3600 3600 0.0e+00 1e-06 yes
B: expected reinstatement premium 371.581024 371.581025 2.7e-09 1e-06 yes
B: total premium 1571.58102 1571.58102 6.5e-10 1e-06 yes
B: recovery 894.680676 894.680678 1.8e-09 1e-06 yes
B: P(any loss to the layer) 0.943513922 0.943513923 6.0e-10 1e-06 yes
B: maximum premium * 1800 1800 0.0e+00 1e-06 yes
-- 4 stop loss
250 xs 750 mean 89.8060044 89.8060044 1.9e-14 1e-06 yes
250 xs 750 sd 114.595006 114.595006 5.2e-15 1e-06 yes
250 xs 750 cv 1.27602834 1.27602834 1.4e-14 1e-06 yes
250 xs 750 skew 0.589473355 0.589473355 6.1e-14 2e-05 yes
250 xs 750 q0.5 0 0 0.00 bkt 0 bkt yes
250 xs 750 q0.9 252 252 0.00 bkt 0 bkt yes
250 xs 750 q0.99 252 252 0.00 bkt 0 bkt yes
250 xs 750 q0.999 252 252 0.00 bkt 0 bkt yes
250 xs 750 P(attach) 0.423786745 0.423786745 1.1e-13 1e-06 yes
250 xs 750 P(exhaust) 0.303654247 0.303654247 1.6e-13 1e-06 yes
250 xs 750 loss on line 0.359224017 0.359224017 1.8e-14 1e-06 yes
1500 xs 1000 mean 220.254897 220.254897 3.9e-14 1e-06 yes
1500 xs 1000 sd 447.605595 447.605595 2.3e-14 1e-06 yes
1500 xs 1000 cv 2.03221631 2.03221631 1.6e-14 1e-06 yes
1500 xs 1000 skew 2.02236699 2.02236699 3.3e-14 2e-05 yes
1500 xs 1000 q0.5 0 0 0.00 bkt 0 bkt yes
1500 xs 1000 q0.9 1024 1024 0.00 bkt 0 bkt yes
1500 xs 1000 q0.99 1500 1500 0.00 bkt 0 bkt yes
1500 xs 1000 q0.999 1500 1500 0.00 bkt 0 bkt yes
1500 xs 1000 P(attach) 0.302087959 0.302087959 1.6e-13 1e-06 yes
1500 xs 1000 P(exhaust) 0.0672404384 0.0672404384 7.0e-13 1e-06 yes
1500 xs 1000 loss on line 0.146836598 0.146836598 3.9e-14 1e-06 yes
both layers, ceded mean 310.060902 310.060902 3.2e-14 1e-06 yes
both layers, ceded sd 532.963233 532.963233 2.0e-14 1e-06 yes
both layers, ceded cv 1.71889855 1.71889855 1.2e-14 1e-06 yes
both layers, ceded skew 1.74057348 1.74057348 3.0e-14 2e-05 yes
both layers, ceded q0.5 0 0 0.00 bkt 0 bkt yes
both layers, ceded q0.9 1272 1272 0.00 bkt 0 bkt yes
both layers, ceded q0.99 1752 1752 0.00 bkt 0 bkt yes
both layers, ceded q0.999 1752 1752 0.00 bkt 0 bkt yes
both layers, net mean 640.099913 640.099913 2.2e-12 1e-06 yes
both layers, net sd 582.753147 582.753148 5.4e-10 1e-06 yes
both layers, net cv 0.910409665 0.910409666 5.4e-10 1e-06 yes
both layers, net skew 4.80690861 4.80690909 9.9e-08 2e-05 yes
both layers, net q0.5 632 632 0.00 bkt 0 bkt yes
both layers, net q0.9 752 752 0.00 bkt 0 bkt yes
both layers, net q0.99 3692 3692 0.00 bkt 0 bkt yes
both layers, net q0.999 5664 5664 0.00 bkt 0 bkt yes
50% of 1500 xs 1000 mean 110.127449 110.127449 3.9e-14 1e-06 yes
50% of 1500 xs 1000 sd 223.804451 223.802797 7.4e-06 1e-05 yes
50% of 1500 xs 1000 cv 2.03223132 2.03221631 7.4e-06 1e-05 yes
50% of 1500 xs 1000 skew 2.02238626 2.02236699 9.5e-06 2e-05 yes
50% of 1500 xs 1000 q0.5 0 0 0.00 bkt 1 bkt yes
50% of 1500 xs 1000 q0.9 512 512 0.00 bkt 1 bkt yes
50% of 1500 xs 1000 q0.99 752 750 0.50 bkt 1 bkt yes
50% of 1500 xs 1000 q0.999 752 750 0.50 bkt 1 bkt yes
-- 4 aggregate deductible
class 1 expected claims 5.15407999 5.15407999 1.7e-16 1e-06 yes
class 2 expected claims 1.34250795 1.34250795 4.8e-15 1e-06 yes
gross mean, exact 450 450 0.0e+00 1e-06 yes
gross CV, exact 0.528497476 0.528497476 2.1e-16 1e-06 yes
gross mean 449.999977 449.999977 2.2e-12 1e-06 yes
gross sd 237.823868 237.823868 2.2e-11 1e-06 yes
gross cv 0.528497511 0.528497511 2.0e-11 1e-06 yes
gross skew 0.62441101 0.624411011 8.4e-10 2e-05 yes
gross q0.5 424.1875 424.1875 0.00 bkt 0 bkt yes
gross q0.9 769 769 0.00 bkt 0 bkt yes
gross q0.99 1103.625 1103.625 0.00 bkt 0 bkt yes
gross q0.999 1376.8125 1376.8125 0.00 bkt 0 bkt yes
after the deductible mean 142.758967 142.758967 9.9e-13 1e-06 yes
after the deductible sd 183.779608 183.779608 7.1e-12 1e-06 yes
after the deductible cv 1.28734196 1.28734196 6.1e-12 1e-06 yes
after the deductible skew 1.53384449 1.53384449 1.6e-10 2e-05 yes
after the deductible q0.5 64.1875 64.1875 0.00 bkt 0 bkt yes
after the deductible q0.9 409 409 0.00 bkt 0 bkt yes
after the deductible q0.99 743.625 743.625 0.00 bkt 0 bkt yes
after the deductible q0.999 1016.8125 1016.8125 0.00 bkt 0 bkt yes
value of the deductible 307.24101 307.24101 3.5e-14 1e-06 yes
excess ratio (insurance charge) 0.317242165 0.317242165 4.6e-12 1e-06 yes
Poisson, after the deductible mean 141.799478 141.799478 9.5e-13 1e-06 yes
Poisson, after the deductible sd 181.420921 181.420921 6.9e-12 1e-06 yes
Poisson, after the deductible cv 1.27941883 1.27941883 6.0e-12 1e-06 yes
Poisson, after the deductible skew 1.51528126 1.51528126 1.6e-10 2e-05 yes
Poisson, after the deductible q0.5 65.125 65.125 0.00 bkt 0 bkt yes
Poisson, after the deductible q0.9 404.8125 404.8125 0.00 bkt 0 bkt yes
Poisson, after the deductible q0.99 732.5 732.5 0.00 bkt 0 bkt yes
Poisson, after the deductible q0.999 998.8125 998.8125 0.00 bkt 0 bkt yes
Poisson gross mean 449.999977 449.999977 2.8e-13 1e-06 yes
-- 5 retro and swing
layer loss mean 449.999977 449.999977 3.3e-13 1e-06 yes
layer loss sd 234.831337 234.831337 3.9e-12 1e-06 yes
layer loss cv 0.521847442 0.521847442 3.5e-12 1e-06 yes
layer loss skew 0.607746445 0.607746445 2.0e-10 2e-05 yes
layer loss q0.5 425.125 425.125 0.00 bkt 0 bkt yes
layer loss q0.9 764.8125 764.8125 0.00 bkt 0 bkt yes
layer loss q0.99 1092.5 1092.5 0.00 bkt 0 bkt yes
layer loss q0.999 1358.8125 1358.8125 0.00 bkt 0 bkt yes
retro premium 624.50973 624.50973 4.6e-13 1e-06 yes
retro premium, LossSensitivePremium 624.50973 624.50973 6.9e-14 1e-06 yes
retro rate on subject premium 0.0520424775 0.0520424775 4.6e-13 1e-06 yes
P(minimum premium) 0.239650834 0.239650834 1.7e-15 1e-06 yes
P(maximum premium) 0.0418237453 0.0418237453 8.6e-13 1e-06 yes
swing premium, 100% placed 838.319362 838.319362 3.4e-13 1e-06 yes
swing premium, 40% placed 335.327745 335.327745 3.5e-13 1e-06 yes
-- 5 profit commission
three-year loss mean 2699.99991 2699.99991 1.8e-12 1e-06 yes
three-year loss sd 1194.86167 1194.86167 1.8e-11 1e-06 yes
three-year loss cv 0.442541373 0.442541373 1.6e-11 1e-06 yes
three-year loss skew 0.516204689 0.516204689 7.3e-10 2e-05 yes
three-year loss q0.5 2595.5 2595.5 0.00 bkt 0 bkt yes
three-year loss q0.9 4292.5 4292.5 0.00 bkt 0 bkt yes
three-year loss q0.99 5900.25 5900.25 0.00 bkt 0 bkt yes
three-year loss q0.999 7195 7195 0.00 bkt 0 bkt yes
ceded loss ratio 0.479999984 0.479999984 3.4e-13 1e-06 yes
profit commission 370.724957 370.724957 1.4e-15 1e-06 yes
profit commission rate 0.0823833237 0.0823833237 1.3e-15 1e-06 yes
rate at the expected loss ratio 0.080000004 0.080000004 5.1e-13 1e-06 yes
P(profit commission > 0) 0.922755956 0.922755956 1.2e-15 1e-06 yes
-- 5 sliding scale
expected claims 11.494352 11.494352 2.6e-15 1e-06 yes
ceded loss mean 2499.99875 2499.99875 3.5e-13 1e-06 yes
ceded loss sd 1212.89973 1212.89973 8.4e-12 1e-06 yes
ceded loss cv 0.485160135 0.485160135 8.1e-12 1e-06 yes
ceded loss skew 0.648568507 0.648568507 6.5e-10 2e-05 yes
ceded loss q0.5 2367 2367 0.00 bkt 0 bkt yes
ceded loss q0.9 4128.5 4128.5 0.00 bkt 0 bkt yes
ceded loss q0.99 5855 5855 0.00 bkt 0 bkt yes
ceded loss q0.999 7272.5 7272.5 0.00 bkt 0 bkt yes
ceded loss ratio 0.499999751 0.499999751 3.5e-13 1e-06 yes
expected commission 1517.10427 1517.10427 9.2e-14 1e-06 yes
expected commission rate 0.303420854 0.303420854 9.2e-14 1e-06 yes
rate at the expected loss ratio 0.287500187 0.287500187 4.6e-13 1e-06 yes
P(loss ratio <= 35%) 0.295079988 0.295079988 8.1e-15 1e-06 yes
P(loss ratio >= 65%) 0.248544663 0.248544663 1.1e-13 1e-06 yes
-- 6 ceded view
assets, the 99% quantile 1824 1824 0.0e+00 1e-06 yes
F(assets) 0.990037317 0.990037317 4.0e-15 1e-06 yes
expected loss E[min(X, a)] 196.417196 196.417196 1.2e-13 1e-06 yes
CCoC premium 344.379269 344.379269 6.5e-14 1e-06 yes
capital * 1479.62073 1479.62073 1.5e-14 1e-06 yes
return on capital * 0.1 0.1 4.7e-15 1e-06 yes
ccoc: g(0.05) at aggregate's parameter * 0.136363636 0.136363636 4.1e-16 1e-06 yes
ccoc: g(0.5) at aggregate's parameter * 0.545454545 0.545454545 2.0e-16 1e-06 yes
ccoc: parameter r * 0.1 0.1 6.9e-16 1e-06 yes
ccoc: price of min(X, a) * 344.379269 344.379269 1.7e-16 1e-06 yes
ph: g(0.05) at aggregate's parameter 0.113901694 0.113901694 2.8e-09 1e-06 yes
ph: g(0.5) at aggregate's parameter 0.604925149 0.604925148 6.5e-10 1e-06 yes
ph: parameter rho 0.725171455 0.725171456 1.3e-09 1e-06 yes
ph: price of min(X, a) * 344.37927 344.379269 2.0e-09 1e-06 yes
ph: unlimited price 369.852591 369.852591 8.8e-10 1e-06 yes
wang: g(0.05) at aggregate's parameter 0.104437292 0.104437292 9.2e-13 1e-06 yes
wang: g(0.5) at aggregate's parameter 0.651061385 0.651061385 3.0e-13 1e-06 yes
wang: parameter lambda 0.388187572 0.388187572 1.4e-12 1e-06 yes
wang: price of min(X, a) * 344.379269 344.379269 7.0e-13 1e-06 yes
wang: unlimited price 360.449861 360.449861 3.4e-12 1e-06 yes
dual: g(0.05) at aggregate's parameter 0.0921889858 0.0921889858 6.1e-14 1e-06 yes
dual: g(0.5) at aggregate's parameter 0.729370351 0.729370351 3.2e-14 1e-06 yes
dual: parameter beta 1.88560819 1.88560819 6.5e-14 1e-06 yes
dual: price of min(X, a) * 344.379269 344.379269 5.5e-14 1e-06 yes
dual: unlimited price 354.69921 354.69921 4.7e-13 1e-06 yes
tvar: g(0.05) at aggregate's parameter 0.0876652545 0.0876652544 1.0e-09 1e-06 yes
tvar: g(0.5) at aggregate's parameter 0.876652545 0.876652544 1.0e-09 1e-06 yes
tvar: parameter p 0.429648607 0.429648606 1.4e-09 1e-06 yes
tvar: price of min(X, a) * 344.37927 344.379269 1.0e-09 1e-06 yes
tvar: unlimited price 353.997819 353.997819 1.0e-09 1e-06 yes
fixed ph0.7: price of min(X, a) 363.110828 363.110828 1.4e-15 1e-06 yes
fixed wang0.4: price of min(X, a) 349.740174 349.740174 2.6e-15 1e-06 yes
fixed dual1.8: price of min(X, a) 331.010339 331.010339 1.7e-15 1e-06 yes
fixed tvar0.3: price of min(X, a) 280.595994 280.595994 6.1e-16 1e-06 yes
fixed ccoc0.1: price of min(X, a) * 344.379269 344.379269 1.2e-15 1e-06 yes
-- 6 gross view
assets, the 99% quantile 5440 5440 0.0e+00 1e-06 yes
F(assets) 0.990014951 0.990014951 2.2e-16 1e-06 yes
expected loss E[min(X, a)] 941.883899 941.883899 3.3e-14 1e-06 yes
CCoC premium 1350.80354 1350.80354 2.3e-14 1e-06 yes
capital * 4089.19646 4089.19646 7.6e-15 1e-06 yes
return on capital * 0.1 0.1 8.6e-15 1e-06 yes
ccoc: g(0.05) at aggregate's parameter * 0.136363636 0.136363636 1.6e-15 1e-06 yes
ccoc: g(0.5) at aggregate's parameter * 0.545454545 0.545454545 2.0e-16 1e-06 yes
ccoc: parameter r * 0.1 0.1 3.1e-15 1e-06 yes
ccoc: price of min(X, a) * 1350.80354 1350.80354 1.7e-13 1e-06 yes
ph: g(0.05) at aggregate's parameter 0.123313176 0.123313176 4.5e-14 1e-06 yes
ph: g(0.5) at aggregate's parameter 0.616139992 0.616139992 1.0e-14 1e-06 yes
ph: parameter rho 0.698669916 0.698669916 2.1e-14 1e-06 yes
ph: price of min(X, a) * 1350.80354 1350.80354 3.0e-13 1e-06 yes
ph: unlimited price 1400.87857 1400.87859 1.6e-08 1e-06 yes
wang: g(0.05) at aggregate's parameter 0.110369024 0.110369024 1.7e-13 1e-06 yes
wang: g(0.5) at aggregate's parameter 0.662861612 0.662861612 5.5e-14 1e-06 yes
wang: parameter lambda 0.420285672 0.420285672 2.4e-13 1e-06 yes
wang: price of min(X, a) * 1350.80354 1350.80354 2.4e-13 1e-06 yes
wang: unlimited price 1378.22496 1378.22496 3.3e-11 1e-06 yes
dual: g(0.05) at aggregate's parameter 0.092502634 0.092502634 5.9e-15 1e-06 yes
dual: g(0.5) at aggregate's parameter 0.73063116 0.73063116 3.5e-15 1e-06 yes
dual: parameter beta 1.89234512 1.89234512 7.2e-15 1e-06 yes
dual: price of min(X, a) * 1350.80354 1350.80354 3.2e-13 1e-06 yes
dual: unlimited price 1366.43439 1366.43439 4.0e-12 1e-06 yes
tvar: g(0.05) at aggregate's parameter 0.0808291916 0.0808291912 4.9e-09 1e-06 yes
tvar: g(0.5) at aggregate's parameter 0.808291916 0.808291912 4.9e-09 1e-06 yes
tvar: parameter p 0.381411604 0.381411601 8.0e-09 1e-06 yes
tvar: price of min(X, a) * 1350.80355 1350.80354 3.2e-09 1e-06 yes
tvar: unlimited price 1364.18388 1364.18387 3.2e-09 1e-06 yes
fixed ph0.7: price of min(X, a) 1348.28798 1348.28798 3.2e-13 1e-06 yes
fixed wang0.4: price of min(X, a) 1328.19389 1328.19389 3.2e-13 1e-06 yes
fixed dual1.8: price of min(X, a) 1315.25173 1315.25173 3.1e-13 1e-06 yes
fixed tvar0.3: price of min(X, a) 1244.59755 1244.59755 2.8e-13 1e-06 yes
fixed ccoc0.1: price of min(X, a) * 1350.80354 1350.80354 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, 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.
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.
prospiciotakes the bucket from the caller, so each section gives the bucket that aggregate chose, for parity only. recommend_grid and fft_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.The grid mean is not the exact mean.
est_min aggregate and Grid.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 (Lognormal.lev, Mixture.lev, layer), and compare grid with grid, as the tables do.A share off the grid. aggregate re-buckets a ceded amount between its buckets, which adds a little variance.
prospiciogives 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.The tail beyond the grid.
prospicioputs the probability beyond the last grid point on that point. aggregate (withnormalize=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.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_centralin 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. Removeprospicio’s probability above 10,000, and the difference falls under 1e-13 (the cell 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 isxsden_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 the notebook 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.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_meanand the attachment probability are conditional on the claim reaching the layer,net ofholds 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.
quoted = [(k, AGG[k] / AGG[(k[0], k[1] + "_central")] - 1.0) for k in AGG
if k[1].endswith("_skew") and (k[0], k[1] + "_central") in AGG]
quoted.sort(key=lambda kv: -abs(kv[1]))
print(f"{len(quoted)} skewness values; aggregate's quoted skew is within {abs(quoted[0][1]):.1e} of its density's.")
print("largest differences, with the density deficit that aggregate places one bucket past the grid (above 1e-12):")
for (example, quantity), diff in quoted[:4]:
deficit = AGG[(example, quantity.replace("_skew", "_density_deficit"))]
beyond = POINTS * AGG[(example, "bs")] # one bucket past the grid's top
print(f" {example} {quantity}: {diff:+.1e} (deficit {deficit:.1e} at {beyond:,.0f} adds about "
f"{deficit * beyond**3:,.0f} 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.
layer = tower_grids.ceded[1]
central = AGG[("tower_gross", "layer_250x250_ceded_skew_central")]
kept = [(i * layer.step, q) for i, q in enumerate(layer.probs) if i * layer.step < 10000.0]
mean = sum(x * q for x, q in kept)
var = sum((x - mean) ** 2 * q for x, q in kept)
below = sum((x - mean) ** 3 * q for x, q in kept) / var**1.5
whole = moments(layer)[3]
print(f"\nlayer 250 xs 250, skewness of aggregate's density {central:.10f}; prospicio's on the whole grid "
f"{whole:.10f} ({whole / central - 1:+.1e}), below 10,000 {below:.10f} ({below / central - 1:+.1e}); "
f"probability dropped {sum(q for i, q in enumerate(layer.probs) if i * layer.step >= 10000.0):.1e}")27 skewness values; aggregate's quoted skew is within 8.6e-07 of its density's.
largest differences, with the density deficit that aggregate places one bucket past the grid (above 1e-12):
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)
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

