# Pricing Insurance Risk: the case studies in prospicio

Stephen Mildenhall and John Major's book *Pricing Insurance Risk* (Wiley, 2022) applies one method, in four steps, to four case studies:

1.  Build the distribution of the total of a book from its units.
2.  Select a capital standard.
3.  Price the total with a spectral risk measure calibrated to a target return.
4.  Split the price over the units by the natural allocation.

Mildenhall's package [aggregate](../reference/aggregate.Clash.md#prospicio.aggregate.Clash.aggregate) made the book's exhibits. Version 0.30.1 still holds the code (`aggregate.extensions.case_studies`) and the case studies as DecL programs in its tests. This guide runs the case studies in prospicio, with the value that [aggregate](../reference/aggregate.Clash.md#prospicio.aggregate.Clash.aggregate) 0.30.1 returns beside each number. The settings are those of `case_studies.py`: a 10% return on capital, and each case's capital standard and grid. If distortion, natural allocation or lifted capital are new words, read [CAS Monograph 15 reproduced](capital-modeling-monograph-15.md) first.


# 1. The method in one function

Each case study has two independent units on one grid. [Portfolio.from_independent](../reference/pricing.Portfolio.md#prospicio.pricing.Portfolio.from_independent) combines them and keeps each unit's expected loss given the total. The assets are the quantile of the total at the capital standard [p](../reference/models.Elpd.md#prospicio.models.Elpd.p).

The constant cost of capital (CCoC) at 10% sets the premium of the total, `P = v E[min(X, a)] + d a`, with `v = 1 / 1.1` and `d = 1 - v`; it earns exactly 10% on the capital `a - P`. The code calibrates the four other distortions (proportional hazard (PH), Wang, dual power and TVaR) to the same total premium. They differ only in how they split it.


``` python
import math

import pandas as pd
from great_tables import GT

from prospicio.aggregate import fft
from prospicio.distributions import Count, Gamma, Grid, Lognormal, Poisson
from prospicio.pricing import Portfolio
from prospicio.reinsurance import Layer, Tower

FAMILIES = ["ccoc", "ph", "wang", "dual", "tvar"]
RETURN = 0.10


def discretize(severity, step, points):
    """A severity on a grid, its mass above the top spread over the grid as aggregate does."""
    probs = Grid.rounding(severity, step, 2 * points)[0].probs[:points]
    total = sum(probs)
    return Grid(step, [q / total for q in probs])


def calibrate(book, p):
    """The five distortions that price the book's total at a 10% return at standard p."""
    a = book.assets(p)
    capped = Portfolio(["total"], [[min(x, a)] for x in book.totals], book.probs)
    return {f: capped.calibrate(f, assets=a, return_on_capital=RETURN) for f in FAMILIES}


def show(book, p, distortions, aggregate_030):
    """Price the book under each distortion. Print the assets and the largest gap to aggregate 0.30.1.

    Returns the prices and a frame whose rows alternate prospicio and aggregate 0.30.1.
    """
    priced = {f: book.price(d, p=p) for f, d in distortions.items()}
    first = priced["ccoc"]
    losses = ", ".join(f"{u} {x.loss:.3f}" for u, x in zip(book.units, first.allocated))
    print(f"assets {book.assets(p):.3f}; loss within assets: {losses}, total {first.total.loss:.3f}")
    with_parameter = len(aggregate_030["ccoc"]) == len(book.units) + 2
    rows, largest = [], 0.0
    for f, pr in priced.items():
        ref = list(aggregate_030[f])
        mine, theirs = [], []
        if with_parameter:
            ((_, value),) = distortions[f].parameters.items()
            mine, theirs = [value], [ref.pop(0)]
        got = [x.premium for x in [*pr.allocated, pr.total]]
        largest = max(largest, *(abs(g - w) for g, w in zip(got, ref)))
        rows += [(f, *mine, *got), (f"{f}, aggregate", *theirs, *ref)]
    print(f"largest difference in a premium: {largest:.4f}")
    columns = ["distortion", *(["parameter"] if with_parameter else []), *book.units, "total"]
    return priced, pd.DataFrame(rows, columns=columns)


def comparison(frame, title, subtitle):
    """The frame of `show` as a table: premiums at 3 decimals, the distortion's parameter at 4."""
    table = GT(frame, rowname_col="distortion").tab_header(title, subtitle)
    premiums = [c for c in frame.columns[1:] if c != "parameter"]
    table = table.fmt_number(premiums, decimals=3, use_seps=False)
    return table.fmt_number("parameter", decimals=4) if "parameter" in frame else table
```


The premium of the total depends only on the total capped at the assets, so [calibrate](../reference/risk.calibrate.md#prospicio.risk.calibrate) fits the distortions on that capped total, a one-unit portfolio. The parameters are the same, and on the half million points of section 6 this is much faster. `discretize` renormalizes as [aggregate](../reference/aggregate.Clash.md#prospicio.aggregate.Clash.aggregate) does (`normalize=True`): it spreads the probability above the top of the grid over the grid. [Grid.rounding](../reference/distributions.Grid.md#prospicio.distributions.Grid.rounding) keeps it on the last point. Section 6 shows why this matters for a thick tail.


# 2. Discrete: a book you can price by hand

The first case study is two units with three outcomes each:

``` text
port Discrete
    agg X1 1 claim dsev [0 8 10] [1/2 1/4 1/4] fixed
    agg X2 1 claim dsev [0 1 90] [1/2 1/4 1/4] fixed
```

The nine joint outcomes have different totals, so you can check every number with a pencil. The 90 of X2 makes the tail. `case_studies.py` prices the book at `p = 1`, so the assets are the largest total, 100, and no outcome defaults.


``` python
x1 = Grid(1.0, [0.5] + [0.0] * 7 + [0.25, 0.0, 0.25])
x2 = Grid(1.0, [0.5, 0.25] + [0.0] * 88 + [0.25])
discrete = Portfolio.from_independent(["X1", "X2"], [x1, x2])
outcomes = pd.DataFrame({"total": discrete.totals, "probability": discrete.probs})
(GT(outcomes)
 .tab_header("Discrete: the nine joint outcomes", "Total loss of X1 and X2 and its probability")
 .fmt_number("total", decimals=0)
 .fmt_number("probability", decimals=4, drop_trailing_zeros=True))
```


<style>
#udzutnwlmb table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }

#udzutnwlmb thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#udzutnwlmb p { margin: 0; padding: 0; }
 #udzutnwlmb .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #udzutnwlmb .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #udzutnwlmb .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #udzutnwlmb .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
 #udzutnwlmb .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #udzutnwlmb .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #udzutnwlmb .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #udzutnwlmb .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
 #udzutnwlmb .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #udzutnwlmb .gt_column_spanner_outer:first-child { padding-left: 0; }
 #udzutnwlmb .gt_column_spanner_outer:last-child { padding-right: 0; }
 #udzutnwlmb .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #udzutnwlmb .gt_spanner_row { border-bottom-style: hidden; }
 #udzutnwlmb .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #udzutnwlmb .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #udzutnwlmb .gt_from_md> :first-child { margin-top: 0; }
 #udzutnwlmb .gt_from_md> :last-child { margin-bottom: 0; }
 #udzutnwlmb .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #udzutnwlmb .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
 #udzutnwlmb .gt_indent_1 { text-indent: 5px; }
 #udzutnwlmb .gt_indent_2 { text-indent: calc(5px * 2); }
 #udzutnwlmb .gt_indent_3 { text-indent: calc(5px * 3); }
 #udzutnwlmb .gt_indent_4 { text-indent: calc(5px * 4); }
 #udzutnwlmb .gt_indent_5 { text-indent: calc(5px * 5); }
 #udzutnwlmb .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
 #udzutnwlmb .gt_row_group_first td { border-top-width: 2px; }
 #udzutnwlmb .gt_row_group_first th { border-top-width: 2px; }
 #udzutnwlmb .gt_striped { color: #333333; background-color: #F4F4F4; }
 #udzutnwlmb .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #udzutnwlmb .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #udzutnwlmb .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #udzutnwlmb .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #udzutnwlmb .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #udzutnwlmb .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #udzutnwlmb .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #udzutnwlmb .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #udzutnwlmb .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #udzutnwlmb .gt_left { text-align: left; }
 #udzutnwlmb .gt_center { text-align: center; }
 #udzutnwlmb .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #udzutnwlmb .gt_font_normal { font-weight: normal; }
 #udzutnwlmb .gt_font_bold { font-weight: bold; }
 #udzutnwlmb .gt_font_italic { font-style: italic; }
 #udzutnwlmb .gt_super { font-size: 65%; }
 #udzutnwlmb .gt_footnotes { color: font-color(#FFFFFF); background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #udzutnwlmb .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #udzutnwlmb .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #udzutnwlmb .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #udzutnwlmb .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #udzutnwlmb .gt_asterisk { font-size: 100%; vertical-align: 0; }
 
</style>

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="2" id="title" class="gt_heading gt_title gt_font_normal">Discrete: the nine joint outcomes</th>
</tr>
<tr class="gt_heading">
<th colspan="2" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Total loss of X1 and X2 and its probability</th>
</tr>
<tr class="gt_col_headings">
<th id="total" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">total</th>
<th id="probability" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">probability</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<td class="gt_row gt_right" headers="total">0</td>
<td class="gt_row gt_right" headers="probability">0.25</td>
</tr>
<tr>
<td class="gt_row gt_right" headers="total">1</td>
<td class="gt_row gt_right" headers="probability">0.125</td>
</tr>
<tr>
<td class="gt_row gt_right" headers="total">8</td>
<td class="gt_row gt_right" headers="probability">0.125</td>
</tr>
<tr>
<td class="gt_row gt_right" headers="total">9</td>
<td class="gt_row gt_right" headers="probability">0.0625</td>
</tr>
<tr>
<td class="gt_row gt_right" headers="total">10</td>
<td class="gt_row gt_right" headers="probability">0.125</td>
</tr>
<tr>
<td class="gt_row gt_right" headers="total">11</td>
<td class="gt_row gt_right" headers="probability">0.0625</td>
</tr>
<tr>
<td class="gt_row gt_right" headers="total">90</td>
<td class="gt_row gt_right" headers="probability">0.125</td>
</tr>
<tr>
<td class="gt_row gt_right" headers="total">98</td>
<td class="gt_row gt_right" headers="probability">0.0625</td>
</tr>
<tr>
<td class="gt_row gt_right" headers="total">100</td>
<td class="gt_row gt_right" headers="probability">0.0625</td>
</tr>
</tbody>
</table>


``` python
DISCRETE_030 = {  # aggregate 0.30.1: (parameter, P X1, P X2, P total)
    "ccoc": (0.1000, 5.0000, 28.8636, 33.8636),
    "ph": (0.8236, 4.8989, 28.9648, 33.8636),
    "wang": (0.2014, 4.9954, 28.8682, 33.8636),
    "dual": (1.3202, 5.1691, 28.6945, 33.8636),
    "tvar": (0.1953, 5.5922, 28.2715, 33.8636),
}
discrete_d = calibrate(discrete, 1.0)
discrete_p, discrete_t = show(discrete, 1.0, discrete_d, DISCRETE_030)
```


    assets 100.000; loss within assets: X1 4.500, X2 22.750, total 27.250
    largest difference in a premium: 0.0000


``` python
comparison(discrete_t, "Discrete: premium by unit", "Standard p = 1, 10% return; each distortion against aggregate 0.30.1")
```


<style>
#lahhtylkoo table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }

#lahhtylkoo thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#lahhtylkoo p { margin: 0; padding: 0; }
 #lahhtylkoo .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #lahhtylkoo .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #lahhtylkoo .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #lahhtylkoo .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
 #lahhtylkoo .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #lahhtylkoo .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #lahhtylkoo .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #lahhtylkoo .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
 #lahhtylkoo .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #lahhtylkoo .gt_column_spanner_outer:first-child { padding-left: 0; }
 #lahhtylkoo .gt_column_spanner_outer:last-child { padding-right: 0; }
 #lahhtylkoo .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #lahhtylkoo .gt_spanner_row { border-bottom-style: hidden; }
 #lahhtylkoo .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #lahhtylkoo .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #lahhtylkoo .gt_from_md> :first-child { margin-top: 0; }
 #lahhtylkoo .gt_from_md> :last-child { margin-bottom: 0; }
 #lahhtylkoo .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #lahhtylkoo .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
 #lahhtylkoo .gt_indent_1 { text-indent: 5px; }
 #lahhtylkoo .gt_indent_2 { text-indent: calc(5px * 2); }
 #lahhtylkoo .gt_indent_3 { text-indent: calc(5px * 3); }
 #lahhtylkoo .gt_indent_4 { text-indent: calc(5px * 4); }
 #lahhtylkoo .gt_indent_5 { text-indent: calc(5px * 5); }
 #lahhtylkoo .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
 #lahhtylkoo .gt_row_group_first td { border-top-width: 2px; }
 #lahhtylkoo .gt_row_group_first th { border-top-width: 2px; }
 #lahhtylkoo .gt_striped { color: #333333; background-color: #F4F4F4; }
 #lahhtylkoo .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #lahhtylkoo .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #lahhtylkoo .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #lahhtylkoo .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #lahhtylkoo .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #lahhtylkoo .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #lahhtylkoo .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #lahhtylkoo .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #lahhtylkoo .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #lahhtylkoo .gt_left { text-align: left; }
 #lahhtylkoo .gt_center { text-align: center; }
 #lahhtylkoo .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #lahhtylkoo .gt_font_normal { font-weight: normal; }
 #lahhtylkoo .gt_font_bold { font-weight: bold; }
 #lahhtylkoo .gt_font_italic { font-style: italic; }
 #lahhtylkoo .gt_super { font-size: 65%; }
 #lahhtylkoo .gt_footnotes { color: font-color(#FFFFFF); background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #lahhtylkoo .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #lahhtylkoo .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #lahhtylkoo .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #lahhtylkoo .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #lahhtylkoo .gt_asterisk { font-size: 100%; vertical-align: 0; }
 
</style>

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="5" id="title" class="gt_heading gt_title gt_font_normal">Discrete: premium by unit</th>
</tr>
<tr class="gt_heading">
<th colspan="5" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Standard p = 1, 10% return; each distortion against aggregate 0.30.1</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="parameter" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">parameter</th>
<th id="X1" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">X1</th>
<th id="X2" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">X2</th>
<th id="total" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">total</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">ccoc</th>
<td class="gt_row gt_right" headers="stub-1 parameter">0.1000</td>
<td class="gt_row gt_right" headers="stub-1 X1">5.000</td>
<td class="gt_row gt_right" headers="stub-1 X2">28.864</td>
<td class="gt_row gt_right" headers="stub-1 total">33.864</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">ccoc, aggregate</th>
<td class="gt_row gt_right" headers="stub-2 parameter">0.1000</td>
<td class="gt_row gt_right" headers="stub-2 X1">5.000</td>
<td class="gt_row gt_right" headers="stub-2 X2">28.864</td>
<td class="gt_row gt_right" headers="stub-2 total">33.864</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">ph</th>
<td class="gt_row gt_right" headers="stub-3 parameter">0.8236</td>
<td class="gt_row gt_right" headers="stub-3 X1">4.899</td>
<td class="gt_row gt_right" headers="stub-3 X2">28.965</td>
<td class="gt_row gt_right" headers="stub-3 total">33.864</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">ph, aggregate</th>
<td class="gt_row gt_right" headers="stub-4 parameter">0.8236</td>
<td class="gt_row gt_right" headers="stub-4 X1">4.899</td>
<td class="gt_row gt_right" headers="stub-4 X2">28.965</td>
<td class="gt_row gt_right" headers="stub-4 total">33.864</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">wang</th>
<td class="gt_row gt_right" headers="stub-5 parameter">0.2014</td>
<td class="gt_row gt_right" headers="stub-5 X1">4.995</td>
<td class="gt_row gt_right" headers="stub-5 X2">28.868</td>
<td class="gt_row gt_right" headers="stub-5 total">33.864</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">wang, aggregate</th>
<td class="gt_row gt_right" headers="stub-6 parameter">0.2014</td>
<td class="gt_row gt_right" headers="stub-6 X1">4.995</td>
<td class="gt_row gt_right" headers="stub-6 X2">28.868</td>
<td class="gt_row gt_right" headers="stub-6 total">33.864</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">dual</th>
<td class="gt_row gt_right" headers="stub-7 parameter">1.3202</td>
<td class="gt_row gt_right" headers="stub-7 X1">5.169</td>
<td class="gt_row gt_right" headers="stub-7 X2">28.695</td>
<td class="gt_row gt_right" headers="stub-7 total">33.864</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">dual, aggregate</th>
<td class="gt_row gt_right" headers="stub-8 parameter">1.3202</td>
<td class="gt_row gt_right" headers="stub-8 X1">5.169</td>
<td class="gt_row gt_right" headers="stub-8 X2">28.695</td>
<td class="gt_row gt_right" headers="stub-8 total">33.864</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">tvar</th>
<td class="gt_row gt_right" headers="stub-9 parameter">0.1953</td>
<td class="gt_row gt_right" headers="stub-9 X1">5.592</td>
<td class="gt_row gt_right" headers="stub-9 X2">28.271</td>
<td class="gt_row gt_right" headers="stub-9 total">33.864</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">tvar, aggregate</th>
<td class="gt_row gt_right" headers="stub-10 parameter">0.1953</td>
<td class="gt_row gt_right" headers="stub-10 X1">5.592</td>
<td class="gt_row gt_right" headers="stub-10 X2">28.271</td>
<td class="gt_row gt_right" headers="stub-10 total">33.864</td>
</tr>
</tbody>
</table>


The parameters and all fifteen premiums agree. The total premium is `27.25 / 1.1 + 100 / 11 = 33.864`. The distortions disagree about X1. The CCoC discounts each unit's expected loss by `v` and adds `d` times its share of the assets in the worst outcome. There X1 loses 10 and X2 loses 90, so X1 pays `4.5 / 1.1 + 10 / 11 = 5.000`. TVaR at 0.195 weights every outcome above the 19.5% quantile equally, and X1 contributes to many of them, so it pays 5.592.


# 3. Tame: when the choice hardly matters

Tame has two gamma units with mean 50 and small CVs, 0.10 and 0.15:

``` text
port Tame
    agg A 1 claim sev gamma 50 cv 0.10 fixed
    agg B 1 claim sev gamma 50 cv 0.15 fixed
```

[aggregate](../reference/aggregate.Clash.md#prospicio.aggregate.Clash.aggregate)'s `tame.py` sets the standard at 99.99%. This guide uses 99.9%, as in the other continuous cases, and ran [aggregate](../reference/aggregate.Clash.md#prospicio.aggregate.Clash.aggregate) at 99.9% too. The grid has a step of 1/64 and 2^16 points:


``` python
STEP, POINTS = 1 / 64, 2**16
a_unit = discretize(Gamma.from_mean_cv(50.0, 0.10), STEP, POINTS)
b_unit = discretize(Gamma.from_mean_cv(50.0, 0.15), STEP, POINTS)
tame = Portfolio.from_independent(["A", "B"], [a_unit, b_unit])

TAME_030 = {  # aggregate 0.30.1, linear allocation
    "ccoc": (0.1000, 50.6820, 52.0950, 102.7770),
    "ph": (0.7289, 50.8134, 51.9636, 102.7770),
    "wang": (0.3062, 50.8437, 51.9333, 102.7770),
    "dual": (1.4415, 50.8693, 51.9077, 102.7770),
    "tvar": (0.1793, 50.8958, 51.8812, 102.7770),
}
tame_d = calibrate(tame, 0.999)
tame_p, tame_t = show(tame, 0.999, tame_d, TAME_030)
```


    assets 130.578; loss within assets: A 49.999, B 49.998, total 99.997
    largest difference in a premium: 0.0003


``` python
comparison(tame_t, "Tame: premium by unit", "Standard p = 99.9%, 10% return; each distortion against aggregate 0.30.1")
```


<style>
#mjfwdubcad table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }

#mjfwdubcad thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#mjfwdubcad p { margin: 0; padding: 0; }
 #mjfwdubcad .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #mjfwdubcad .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #mjfwdubcad .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #mjfwdubcad .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
 #mjfwdubcad .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #mjfwdubcad .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #mjfwdubcad .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #mjfwdubcad .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
 #mjfwdubcad .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #mjfwdubcad .gt_column_spanner_outer:first-child { padding-left: 0; }
 #mjfwdubcad .gt_column_spanner_outer:last-child { padding-right: 0; }
 #mjfwdubcad .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #mjfwdubcad .gt_spanner_row { border-bottom-style: hidden; }
 #mjfwdubcad .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #mjfwdubcad .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #mjfwdubcad .gt_from_md> :first-child { margin-top: 0; }
 #mjfwdubcad .gt_from_md> :last-child { margin-bottom: 0; }
 #mjfwdubcad .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #mjfwdubcad .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
 #mjfwdubcad .gt_indent_1 { text-indent: 5px; }
 #mjfwdubcad .gt_indent_2 { text-indent: calc(5px * 2); }
 #mjfwdubcad .gt_indent_3 { text-indent: calc(5px * 3); }
 #mjfwdubcad .gt_indent_4 { text-indent: calc(5px * 4); }
 #mjfwdubcad .gt_indent_5 { text-indent: calc(5px * 5); }
 #mjfwdubcad .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
 #mjfwdubcad .gt_row_group_first td { border-top-width: 2px; }
 #mjfwdubcad .gt_row_group_first th { border-top-width: 2px; }
 #mjfwdubcad .gt_striped { color: #333333; background-color: #F4F4F4; }
 #mjfwdubcad .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #mjfwdubcad .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #mjfwdubcad .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #mjfwdubcad .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #mjfwdubcad .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #mjfwdubcad .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #mjfwdubcad .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #mjfwdubcad .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #mjfwdubcad .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #mjfwdubcad .gt_left { text-align: left; }
 #mjfwdubcad .gt_center { text-align: center; }
 #mjfwdubcad .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #mjfwdubcad .gt_font_normal { font-weight: normal; }
 #mjfwdubcad .gt_font_bold { font-weight: bold; }
 #mjfwdubcad .gt_font_italic { font-style: italic; }
 #mjfwdubcad .gt_super { font-size: 65%; }
 #mjfwdubcad .gt_footnotes { color: font-color(#FFFFFF); background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #mjfwdubcad .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #mjfwdubcad .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #mjfwdubcad .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #mjfwdubcad .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #mjfwdubcad .gt_asterisk { font-size: 100%; vertical-align: 0; }
 
</style>

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="5" id="title" class="gt_heading gt_title gt_font_normal">Tame: premium by unit</th>
</tr>
<tr class="gt_heading">
<th colspan="5" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Standard p = 99.9%, 10% return; each distortion against aggregate 0.30.1</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="parameter" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">parameter</th>
<th id="A" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">A</th>
<th id="B" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">B</th>
<th id="total" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">total</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">ccoc</th>
<td class="gt_row gt_right" headers="stub-1 parameter">0.1000</td>
<td class="gt_row gt_right" headers="stub-1 A">50.682</td>
<td class="gt_row gt_right" headers="stub-1 B">52.095</td>
<td class="gt_row gt_right" headers="stub-1 total">102.777</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">ccoc, aggregate</th>
<td class="gt_row gt_right" headers="stub-2 parameter">0.1000</td>
<td class="gt_row gt_right" headers="stub-2 A">50.682</td>
<td class="gt_row gt_right" headers="stub-2 B">52.095</td>
<td class="gt_row gt_right" headers="stub-2 total">102.777</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">ph</th>
<td class="gt_row gt_right" headers="stub-3 parameter">0.7289</td>
<td class="gt_row gt_right" headers="stub-3 A">50.813</td>
<td class="gt_row gt_right" headers="stub-3 B">51.964</td>
<td class="gt_row gt_right" headers="stub-3 total">102.777</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">ph, aggregate</th>
<td class="gt_row gt_right" headers="stub-4 parameter">0.7289</td>
<td class="gt_row gt_right" headers="stub-4 A">50.813</td>
<td class="gt_row gt_right" headers="stub-4 B">51.964</td>
<td class="gt_row gt_right" headers="stub-4 total">102.777</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">wang</th>
<td class="gt_row gt_right" headers="stub-5 parameter">0.3062</td>
<td class="gt_row gt_right" headers="stub-5 A">50.844</td>
<td class="gt_row gt_right" headers="stub-5 B">51.933</td>
<td class="gt_row gt_right" headers="stub-5 total">102.777</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">wang, aggregate</th>
<td class="gt_row gt_right" headers="stub-6 parameter">0.3062</td>
<td class="gt_row gt_right" headers="stub-6 A">50.844</td>
<td class="gt_row gt_right" headers="stub-6 B">51.933</td>
<td class="gt_row gt_right" headers="stub-6 total">102.777</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">dual</th>
<td class="gt_row gt_right" headers="stub-7 parameter">1.4415</td>
<td class="gt_row gt_right" headers="stub-7 A">50.869</td>
<td class="gt_row gt_right" headers="stub-7 B">51.908</td>
<td class="gt_row gt_right" headers="stub-7 total">102.777</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">dual, aggregate</th>
<td class="gt_row gt_right" headers="stub-8 parameter">1.4415</td>
<td class="gt_row gt_right" headers="stub-8 A">50.869</td>
<td class="gt_row gt_right" headers="stub-8 B">51.908</td>
<td class="gt_row gt_right" headers="stub-8 total">102.777</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">tvar</th>
<td class="gt_row gt_right" headers="stub-9 parameter">0.1793</td>
<td class="gt_row gt_right" headers="stub-9 A">50.896</td>
<td class="gt_row gt_right" headers="stub-9 B">51.881</td>
<td class="gt_row gt_right" headers="stub-9 total">102.777</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">tvar, aggregate</th>
<td class="gt_row gt_right" headers="stub-10 parameter">0.1793</td>
<td class="gt_row gt_right" headers="stub-10 A">50.896</td>
<td class="gt_row gt_right" headers="stub-10 B">51.881</td>
<td class="gt_row gt_right" headers="stub-10 total">102.777</td>
</tr>
</tbody>
</table>


All values agree to the third decimal. B, the more volatile unit, pays the larger margin under each distortion. The distortions move A's premium over a range of 0.21 and B's by the same amount the other way. Thin, similar tails leave little to disagree about.


# 4. Cat and non-cat: who pays depends on the distortion

Cat/Non-Cat puts a large, steady unit next to a small, volatile one. NonCat is a gamma with mean 80 and CV 0.15, and Cat is a lognormal with mean 20 and CV 1. The total has mean 100, as in Tame, but a real tail:

``` text
port CNC.Gross
    agg CNC.NonCat 1 claim sev gamma   80 cv 0.15 fixed
    agg CNC.Cat    1 claim sev lognorm 20 cv 1.00 fixed
```


``` python
noncat = discretize(Gamma.from_mean_cv(80.0, 0.15), STEP, POINTS)
cat = discretize(Lognormal.from_mean_cv(20.0, 1.0), STEP, POINTS)
cnc = Portfolio.from_independent(["NonCat", "Cat"], [noncat, cat])

CNC_030 = {  # aggregate 0.30.1, linear allocation
    "ccoc": (0.1000, 79.2018, 35.9470, 115.1488),
    "ph": (0.5965, 82.3610, 32.7897, 115.1507),
    "wang": (0.6109, 83.8990, 31.2519, 115.1509),
    "dual": (2.4634, 85.4756, 29.6755, 115.1510),
    "tvar": (0.4816, 86.4562, 28.6948, 115.1511),
}
cnc_d = calibrate(cnc, 0.999)
cnc_p, cnc_t = show(cnc, 0.999, cnc_d, CNC_030)
```


    assets 267.203; loss within assets: NonCat 79.988, Cat 19.958, total 99.946
    largest difference in a premium: 0.0025


``` python
comparison(cnc_t, "Cat/Non-Cat: premium by unit", "Standard p = 99.9%, 10% return; each distortion against aggregate 0.30.1")
```


<style>
#kdilpgmjmq table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }

#kdilpgmjmq thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#kdilpgmjmq p { margin: 0; padding: 0; }
 #kdilpgmjmq .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #kdilpgmjmq .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #kdilpgmjmq .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #kdilpgmjmq .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
 #kdilpgmjmq .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #kdilpgmjmq .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #kdilpgmjmq .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #kdilpgmjmq .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
 #kdilpgmjmq .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #kdilpgmjmq .gt_column_spanner_outer:first-child { padding-left: 0; }
 #kdilpgmjmq .gt_column_spanner_outer:last-child { padding-right: 0; }
 #kdilpgmjmq .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #kdilpgmjmq .gt_spanner_row { border-bottom-style: hidden; }
 #kdilpgmjmq .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #kdilpgmjmq .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #kdilpgmjmq .gt_from_md> :first-child { margin-top: 0; }
 #kdilpgmjmq .gt_from_md> :last-child { margin-bottom: 0; }
 #kdilpgmjmq .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #kdilpgmjmq .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
 #kdilpgmjmq .gt_indent_1 { text-indent: 5px; }
 #kdilpgmjmq .gt_indent_2 { text-indent: calc(5px * 2); }
 #kdilpgmjmq .gt_indent_3 { text-indent: calc(5px * 3); }
 #kdilpgmjmq .gt_indent_4 { text-indent: calc(5px * 4); }
 #kdilpgmjmq .gt_indent_5 { text-indent: calc(5px * 5); }
 #kdilpgmjmq .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
 #kdilpgmjmq .gt_row_group_first td { border-top-width: 2px; }
 #kdilpgmjmq .gt_row_group_first th { border-top-width: 2px; }
 #kdilpgmjmq .gt_striped { color: #333333; background-color: #F4F4F4; }
 #kdilpgmjmq .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #kdilpgmjmq .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #kdilpgmjmq .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #kdilpgmjmq .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #kdilpgmjmq .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #kdilpgmjmq .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #kdilpgmjmq .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #kdilpgmjmq .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #kdilpgmjmq .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #kdilpgmjmq .gt_left { text-align: left; }
 #kdilpgmjmq .gt_center { text-align: center; }
 #kdilpgmjmq .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #kdilpgmjmq .gt_font_normal { font-weight: normal; }
 #kdilpgmjmq .gt_font_bold { font-weight: bold; }
 #kdilpgmjmq .gt_font_italic { font-style: italic; }
 #kdilpgmjmq .gt_super { font-size: 65%; }
 #kdilpgmjmq .gt_footnotes { color: font-color(#FFFFFF); background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #kdilpgmjmq .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #kdilpgmjmq .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #kdilpgmjmq .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #kdilpgmjmq .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #kdilpgmjmq .gt_asterisk { font-size: 100%; vertical-align: 0; }
 
</style>

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="5" id="title" class="gt_heading gt_title gt_font_normal">Cat/Non-Cat: premium by unit</th>
</tr>
<tr class="gt_heading">
<th colspan="5" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Standard p = 99.9%, 10% return; each distortion against aggregate 0.30.1</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="parameter" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">parameter</th>
<th id="NonCat" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">NonCat</th>
<th id="Cat" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Cat</th>
<th id="total" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">total</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">ccoc</th>
<td class="gt_row gt_right" headers="stub-1 parameter">0.1000</td>
<td class="gt_row gt_right" headers="stub-1 NonCat">79.202</td>
<td class="gt_row gt_right" headers="stub-1 Cat">35.950</td>
<td class="gt_row gt_right" headers="stub-1 total">115.151</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">ccoc, aggregate</th>
<td class="gt_row gt_right" headers="stub-2 parameter">0.1000</td>
<td class="gt_row gt_right" headers="stub-2 NonCat">79.202</td>
<td class="gt_row gt_right" headers="stub-2 Cat">35.947</td>
<td class="gt_row gt_right" headers="stub-2 total">115.149</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">ph</th>
<td class="gt_row gt_right" headers="stub-3 parameter">0.5965</td>
<td class="gt_row gt_right" headers="stub-3 NonCat">82.361</td>
<td class="gt_row gt_right" headers="stub-3 Cat">32.790</td>
<td class="gt_row gt_right" headers="stub-3 total">115.151</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">ph, aggregate</th>
<td class="gt_row gt_right" headers="stub-4 parameter">0.5965</td>
<td class="gt_row gt_right" headers="stub-4 NonCat">82.361</td>
<td class="gt_row gt_right" headers="stub-4 Cat">32.790</td>
<td class="gt_row gt_right" headers="stub-4 total">115.151</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">wang</th>
<td class="gt_row gt_right" headers="stub-5 parameter">0.6109</td>
<td class="gt_row gt_right" headers="stub-5 NonCat">83.899</td>
<td class="gt_row gt_right" headers="stub-5 Cat">31.252</td>
<td class="gt_row gt_right" headers="stub-5 total">115.151</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">wang, aggregate</th>
<td class="gt_row gt_right" headers="stub-6 parameter">0.6109</td>
<td class="gt_row gt_right" headers="stub-6 NonCat">83.899</td>
<td class="gt_row gt_right" headers="stub-6 Cat">31.252</td>
<td class="gt_row gt_right" headers="stub-6 total">115.151</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">dual</th>
<td class="gt_row gt_right" headers="stub-7 parameter">2.4634</td>
<td class="gt_row gt_right" headers="stub-7 NonCat">85.476</td>
<td class="gt_row gt_right" headers="stub-7 Cat">29.676</td>
<td class="gt_row gt_right" headers="stub-7 total">115.151</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">dual, aggregate</th>
<td class="gt_row gt_right" headers="stub-8 parameter">2.4634</td>
<td class="gt_row gt_right" headers="stub-8 NonCat">85.476</td>
<td class="gt_row gt_right" headers="stub-8 Cat">29.675</td>
<td class="gt_row gt_right" headers="stub-8 total">115.151</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">tvar</th>
<td class="gt_row gt_right" headers="stub-9 parameter">0.4816</td>
<td class="gt_row gt_right" headers="stub-9 NonCat">86.456</td>
<td class="gt_row gt_right" headers="stub-9 Cat">28.695</td>
<td class="gt_row gt_right" headers="stub-9 total">115.151</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">tvar, aggregate</th>
<td class="gt_row gt_right" headers="stub-10 parameter">0.4816</td>
<td class="gt_row gt_right" headers="stub-10 NonCat">86.456</td>
<td class="gt_row gt_right" headers="stub-10 Cat">28.695</td>
<td class="gt_row gt_right" headers="stub-10 total">115.151</td>
</tr>
</tbody>
</table>


The parameters agree and the premiums agree to within 0.003. The largest difference is in the CCoC row, and [aggregate](../reference/aggregate.Clash.md#prospicio.aggregate.Clash.aggregate) causes it: its linear allocation adds up to 115.149, 0.002 less than the premium it calibrated (115.151, which its lifted allocation does reach). The units of prospicio add up to the calibrated premium.

Now the split matters: the CCoC charges NonCat less than its expected loss. The margins and NonCat's assets in the linear allocation show why:


``` python
margins = pd.DataFrame({
    "distortion": FAMILIES,
    "NonCat margin": [cnc_p[f].allocated[0].premium - cnc_p[f].allocated[0].loss for f in FAMILIES],
    "Cat margin": [cnc_p[f].allocated[1].premium - cnc_p[f].allocated[1].loss for f in FAMILIES],
    "NonCat assets": [cnc_p[f].allocated[0].assets for f in FAMILIES],
})
(GT(margins, rowname_col="distortion")
 .tab_header("Cat/Non-Cat: margin and assets by unit", "Margin is premium minus expected loss; linear allocation")
 .fmt_number(["NonCat margin", "Cat margin", "NonCat assets"], decimals=2))
```


<style>
#hwtiafqpvd table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }

#hwtiafqpvd thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#hwtiafqpvd p { margin: 0; padding: 0; }
 #hwtiafqpvd .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #hwtiafqpvd .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #hwtiafqpvd .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #hwtiafqpvd .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
 #hwtiafqpvd .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #hwtiafqpvd .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #hwtiafqpvd .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #hwtiafqpvd .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
 #hwtiafqpvd .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #hwtiafqpvd .gt_column_spanner_outer:first-child { padding-left: 0; }
 #hwtiafqpvd .gt_column_spanner_outer:last-child { padding-right: 0; }
 #hwtiafqpvd .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #hwtiafqpvd .gt_spanner_row { border-bottom-style: hidden; }
 #hwtiafqpvd .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #hwtiafqpvd .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #hwtiafqpvd .gt_from_md> :first-child { margin-top: 0; }
 #hwtiafqpvd .gt_from_md> :last-child { margin-bottom: 0; }
 #hwtiafqpvd .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #hwtiafqpvd .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
 #hwtiafqpvd .gt_indent_1 { text-indent: 5px; }
 #hwtiafqpvd .gt_indent_2 { text-indent: calc(5px * 2); }
 #hwtiafqpvd .gt_indent_3 { text-indent: calc(5px * 3); }
 #hwtiafqpvd .gt_indent_4 { text-indent: calc(5px * 4); }
 #hwtiafqpvd .gt_indent_5 { text-indent: calc(5px * 5); }
 #hwtiafqpvd .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
 #hwtiafqpvd .gt_row_group_first td { border-top-width: 2px; }
 #hwtiafqpvd .gt_row_group_first th { border-top-width: 2px; }
 #hwtiafqpvd .gt_striped { color: #333333; background-color: #F4F4F4; }
 #hwtiafqpvd .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #hwtiafqpvd .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #hwtiafqpvd .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #hwtiafqpvd .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #hwtiafqpvd .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #hwtiafqpvd .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #hwtiafqpvd .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #hwtiafqpvd .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #hwtiafqpvd .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #hwtiafqpvd .gt_left { text-align: left; }
 #hwtiafqpvd .gt_center { text-align: center; }
 #hwtiafqpvd .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #hwtiafqpvd .gt_font_normal { font-weight: normal; }
 #hwtiafqpvd .gt_font_bold { font-weight: bold; }
 #hwtiafqpvd .gt_font_italic { font-style: italic; }
 #hwtiafqpvd .gt_super { font-size: 65%; }
 #hwtiafqpvd .gt_footnotes { color: font-color(#FFFFFF); background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #hwtiafqpvd .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #hwtiafqpvd .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #hwtiafqpvd .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #hwtiafqpvd .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #hwtiafqpvd .gt_asterisk { font-size: 100%; vertical-align: 0; }
 
</style>

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="4" id="title" class="gt_heading gt_title gt_font_normal">Cat/Non-Cat: margin and assets by unit</th>
</tr>
<tr class="gt_heading">
<th colspan="4" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Margin is premium minus expected loss; linear allocation</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="NonCat-margin" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">NonCat margin</th>
<th id="Cat-margin" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Cat margin</th>
<th id="NonCat-assets" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">NonCat assets</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">ccoc</th>
<td class="gt_row gt_right" headers="stub-1 NonCat-margin">−0.79</td>
<td class="gt_row gt_right" headers="stub-1 Cat-margin">15.99</td>
<td class="gt_row gt_right" headers="stub-1 NonCat-assets">71.34</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">ph</th>
<td class="gt_row gt_right" headers="stub-2 NonCat-margin">2.37</td>
<td class="gt_row gt_right" headers="stub-2 Cat-margin">12.83</td>
<td class="gt_row gt_right" headers="stub-2 NonCat-assets">108.30</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">wang</th>
<td class="gt_row gt_right" headers="stub-3 NonCat-margin">3.91</td>
<td class="gt_row gt_right" headers="stub-3 Cat-margin">11.29</td>
<td class="gt_row gt_right" headers="stub-3 NonCat-assets">124.54</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">dual</th>
<td class="gt_row gt_right" headers="stub-4 NonCat-margin">5.49</td>
<td class="gt_row gt_right" headers="stub-4 Cat-margin">9.72</td>
<td class="gt_row gt_right" headers="stub-4 NonCat-assets">143.91</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">tvar</th>
<td class="gt_row gt_right" headers="stub-5 NonCat-margin">6.47</td>
<td class="gt_row gt_right" headers="stub-5 Cat-margin">8.74</td>
<td class="gt_row gt_right" headers="stub-5 NonCat-assets">149.64</td>
</tr>
</tbody>
</table>


``` python
import matplotlib.pyplot as plt
import numpy as np

x = np.arange(len(FAMILIES))
fig, ax = plt.subplots()
for k, (unit, shift) in enumerate([("NonCat", -0.2), ("Cat", 0.2)]):
    unit_margin = [cnc_p[f].allocated[k].premium - cnc_p[f].allocated[k].loss for f in FAMILIES]
    ax.bar(x + shift, unit_margin, width=0.4, label=unit)
ax.axhline(0, color="0.75")
ax.set_xticks(x, FAMILIES)
ax.set_xlabel("distortion")
ax.set_ylabel("margin (premium minus expected loss)")
ax.set_title("Cat/Non-Cat: the margin of each unit, by distortion")
ax.legend()
```


<figure class="p-figure figure">
<img src="data:image/svg+xml;base64,PHN2ZyB4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjQ1MS40OTMwNDdwdCIgaGVpZ2h0PSIyNjIuMTAzODQ0cHQiIHZpZXdib3g9IjAgMCA0NTEuNDkzMDQ3IDI2Mi4xMDM4NDQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIj4KIDxtZXRhZGF0YT4KICA8cmRmIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgPHdvcms+CiAgICA8dHlwZSByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIj48L3R5cGU+CiAgICA8ZGF0ZT4yMDI2LTExLTI5VDE3OjIzOjQ2Ljg1MTM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uNzI3NDIyIiB5PSI0MC41NzY0MDYiIHRyYW5zZm9ybT0icm90YXRlKC0wIDM5My43Mjc0MjIgNDAuNTc2NDA2KSI+Tm9uQ2F0PC90ZXh0PgogICAgPC9nPgogICAgPGcgaWQ9InBhdGNoXzE2Ij4KICAgICA8cGF0aCBkPSJNIDM2Mi45Mjc0MjIgNTcuMDc3MjY2IApMIDM4NC45Mjc0MjIgNTcuMDc3MjY2IApMIDM4NC45Mjc0MjIgNDkuMzc3MjY2IApMIDM2Mi45Mjc0MjIgNDkuMzc3MjY2IAp6CiIgc3R5bGU9ImZpbGw6IHZhcigtLXAtc2VyaWVzLTIpIiAvPgogICAgPC9nPgogICAgPGcgaWQ9InRleHRfMTciPgogICAgIDx0ZXh0IHN0eWxlPSJmb250LXNpemU6IDExcHg7IGZvbnQtZmFtaWx5OiB2YXIoLS1wLWZvbnQpOyB0ZXh0LWFuY2hvcjogc3RhcnQ7IGZpbGw6IHZhcigtLXAtaW5rKSIgeD0iMzkzLjcyNzQyMiIgeT0iNTcuMDc3MjY2IiB0cmFuc2Zvcm09InJvdGF0ZSgtMCAzOTMuNzI3NDIyIDU3LjA3NzI2NikiPkNhdDwvdGV4dD4KICAgIDwvZz4KICAgPC9nPgogIDwvZz4KIDwvZz4KIDxkZWZzPgogIDxjbGlwcGF0aCBpZD0icGZkNDAyOWQ5ZmMiPgogICA8cmVjdCB4PSI1My42OTMwNDciIHk9IjIyLjMxODEyNSIgd2lkdGg9IjM5MC42IiBoZWlnaHQ9IjE5OS41ODQiIC8+CiAgPC9jbGlwcGF0aD4KIDwvZGVmcz4KPC9zdmc+" />
</figure>


Under the CCoC a unit pays `v` times its expected loss, plus `d` times its share of the assets in the outcomes at or above the assets. NonCat's share there, 71.34, is below its mean of 80, because a large cat loss causes the book's 99.9% outcome. So the CCoC gives almost all of the margin to Cat. The other distortions weight the whole upper tail, where NonCat's own variation counts. The right distortion depends on what the capital providers get paid for, the question of [Risk loads and distortions](risk-loads-and-distortions.md).


# 5. Cat and non-cat, net of an aggregate cover

The net version buys an aggregate stop loss on the cat unit, 79.64 excess of 41.11:

``` text
agg CNC.Net.Cat 1 claim sev lognorm 20 cv 1.00 fixed aggregate net of 79.64 xs 41.11
```

The cover attaches at the 90% quantile of the cat distribution and exhausts at its 99.5% quantile, 120.75. As in `case_studies.py`, the net book is priced with the distortions calibrated on the gross book, at the net book's 99.9% assets.


``` python
print(f"cat quantiles: 90% {cat.quantile(0.9):.3f}, 99.5% {cat.quantile(0.995):.3f}")
cover = Tower([Layer.stop_loss("79.64 xs 41.11", 79.64, 41.11)]).on_grid(Count.fixed(1), cat, POINTS)
print(f"cat mean {cat.mean():.4f}, ceded {cover.ceded[0].mean():.4f}, net {cover.net.mean():.4f}"
      "  (aggregate 0.30.1: net 17.7870)")
cnc_net = Portfolio.from_independent(["NonCat", "Cat"], [noncat, cover.net])

CNC_NET_030 = {  # aggregate 0.30.1, linear allocation, gross distortions: (P NonCat, P Cat, P total)
    "ccoc": (78.8836, 27.0171, 105.9008),
    "ph": (83.6084, 23.9472, 107.5556),
    "wang": (84.9090, 23.8837, 108.7927),
    "dual": (85.9201, 24.2165, 110.1366),
    "tvar": (86.4892, 24.3973, 110.8865),
}
cnc_net_p, cnc_net_t = show(cnc_net, 0.999, cnc_d, CNC_NET_030)
```


    cat quantiles: 90% 41.109, 99.5% 120.750
    cat mean 19.9998, ceded 2.2142, net 17.7856  (aggregate 0.30.1: net 17.7870)
    assets 187.578; loss within assets: NonCat 79.985, Cat 17.747, total 97.732
    largest difference in a premium: 0.0035


``` python
comparison(cnc_net_t, "Cat/Non-Cat net of 79.64 xs 41.11: premium by unit",
           "Standard p = 99.9%, gross distortions; each against aggregate 0.30.1")
```


<style>
#rbhhqtadta table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }

#rbhhqtadta thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#rbhhqtadta p { margin: 0; padding: 0; }
 #rbhhqtadta .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #rbhhqtadta .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #rbhhqtadta .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #rbhhqtadta .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
 #rbhhqtadta .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #rbhhqtadta .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #rbhhqtadta .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #rbhhqtadta .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
 #rbhhqtadta .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #rbhhqtadta .gt_column_spanner_outer:first-child { padding-left: 0; }
 #rbhhqtadta .gt_column_spanner_outer:last-child { padding-right: 0; }
 #rbhhqtadta .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #rbhhqtadta .gt_spanner_row { border-bottom-style: hidden; }
 #rbhhqtadta .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #rbhhqtadta .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #rbhhqtadta .gt_from_md> :first-child { margin-top: 0; }
 #rbhhqtadta .gt_from_md> :last-child { margin-bottom: 0; }
 #rbhhqtadta .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #rbhhqtadta .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
 #rbhhqtadta .gt_indent_1 { text-indent: 5px; }
 #rbhhqtadta .gt_indent_2 { text-indent: calc(5px * 2); }
 #rbhhqtadta .gt_indent_3 { text-indent: calc(5px * 3); }
 #rbhhqtadta .gt_indent_4 { text-indent: calc(5px * 4); }
 #rbhhqtadta .gt_indent_5 { text-indent: calc(5px * 5); }
 #rbhhqtadta .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
 #rbhhqtadta .gt_row_group_first td { border-top-width: 2px; }
 #rbhhqtadta .gt_row_group_first th { border-top-width: 2px; }
 #rbhhqtadta .gt_striped { color: #333333; background-color: #F4F4F4; }
 #rbhhqtadta .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #rbhhqtadta .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #rbhhqtadta .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #rbhhqtadta .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #rbhhqtadta .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #rbhhqtadta .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #rbhhqtadta .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #rbhhqtadta .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #rbhhqtadta .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #rbhhqtadta .gt_left { text-align: left; }
 #rbhhqtadta .gt_center { text-align: center; }
 #rbhhqtadta .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #rbhhqtadta .gt_font_normal { font-weight: normal; }
 #rbhhqtadta .gt_font_bold { font-weight: bold; }
 #rbhhqtadta .gt_font_italic { font-style: italic; }
 #rbhhqtadta .gt_super { font-size: 65%; }
 #rbhhqtadta .gt_footnotes { color: font-color(#FFFFFF); background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #rbhhqtadta .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #rbhhqtadta .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #rbhhqtadta .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #rbhhqtadta .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #rbhhqtadta .gt_asterisk { font-size: 100%; vertical-align: 0; }
 
</style>

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="4" id="title" class="gt_heading gt_title gt_font_normal">Cat/Non-Cat net of 79.64 xs 41.11: premium by unit</th>
</tr>
<tr class="gt_heading">
<th colspan="4" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Standard p = 99.9%, gross distortions; each against aggregate 0.30.1</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="NonCat" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">NonCat</th>
<th id="Cat" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Cat</th>
<th id="total" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">total</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">ccoc</th>
<td class="gt_row gt_right" headers="stub-1 NonCat">78.883</td>
<td class="gt_row gt_right" headers="stub-1 Cat">27.016</td>
<td class="gt_row gt_right" headers="stub-1 total">105.900</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">ccoc, aggregate</th>
<td class="gt_row gt_right" headers="stub-2 NonCat">78.884</td>
<td class="gt_row gt_right" headers="stub-2 Cat">27.017</td>
<td class="gt_row gt_right" headers="stub-2 total">105.901</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">ph</th>
<td class="gt_row gt_right" headers="stub-3 NonCat">83.609</td>
<td class="gt_row gt_right" headers="stub-3 Cat">23.944</td>
<td class="gt_row gt_right" headers="stub-3 total">107.553</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">ph, aggregate</th>
<td class="gt_row gt_right" headers="stub-4 NonCat">83.608</td>
<td class="gt_row gt_right" headers="stub-4 Cat">23.947</td>
<td class="gt_row gt_right" headers="stub-4 total">107.556</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">wang</th>
<td class="gt_row gt_right" headers="stub-5 NonCat">84.910</td>
<td class="gt_row gt_right" headers="stub-5 Cat">23.880</td>
<td class="gt_row gt_right" headers="stub-5 total">108.790</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">wang, aggregate</th>
<td class="gt_row gt_right" headers="stub-6 NonCat">84.909</td>
<td class="gt_row gt_right" headers="stub-6 Cat">23.884</td>
<td class="gt_row gt_right" headers="stub-6 total">108.793</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">dual</th>
<td class="gt_row gt_right" headers="stub-7 NonCat">85.921</td>
<td class="gt_row gt_right" headers="stub-7 Cat">24.213</td>
<td class="gt_row gt_right" headers="stub-7 total">110.134</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">dual, aggregate</th>
<td class="gt_row gt_right" headers="stub-8 NonCat">85.920</td>
<td class="gt_row gt_right" headers="stub-8 Cat">24.216</td>
<td class="gt_row gt_right" headers="stub-8 total">110.137</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">tvar</th>
<td class="gt_row gt_right" headers="stub-9 NonCat">86.489</td>
<td class="gt_row gt_right" headers="stub-9 Cat">24.394</td>
<td class="gt_row gt_right" headers="stub-9 total">110.884</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">tvar, aggregate</th>
<td class="gt_row gt_right" headers="stub-10 NonCat">86.489</td>
<td class="gt_row gt_right" headers="stub-10 Cat">24.397</td>
<td class="gt_row gt_right" headers="stub-10 total">110.886</td>
</tr>
</tbody>
</table>


The attachment 41.11 lies between two grid points (41.109375 and 41.125). [Tower](../reference/reinsurance.Tower.md#prospicio.reinsurance.Tower) splits each recovery between adjacent points, so the mean is exact on the grid. [aggregate](../reference/aggregate.Clash.md#prospicio.aggregate.Clash.aggregate) places the cover differently, which moves the net cat mean by 0.0014 and the net premiums by up to 0.004. The assets, 187.578, agree.

The cover removes 2.21 of expected loss and 79.6 of assets. With the distortions at their gross calibration, the premium falls by different amounts:


``` python
saving = pd.DataFrame({
    "distortion": FAMILIES,
    "gross P": [cnc_p[f].total.premium for f in FAMILIES],
    "net P": [cnc_net_p[f].total.premium for f in FAMILIES],
})
saving["saving"] = saving["gross P"] - saving["net P"]
(GT(saving, rowname_col="distortion")
 .tab_header("Cat/Non-Cat: premium of the book gross and net of the cover",
             "Each distortion at its gross calibration, 10% return, p = 99.9%")
 .fmt_number(["gross P", "net P", "saving"], decimals=2))
```


<style>
#dluxqjuqkn table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }

#dluxqjuqkn thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#dluxqjuqkn p { margin: 0; padding: 0; }
 #dluxqjuqkn .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #dluxqjuqkn .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #dluxqjuqkn .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #dluxqjuqkn .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
 #dluxqjuqkn .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #dluxqjuqkn .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #dluxqjuqkn .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #dluxqjuqkn .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
 #dluxqjuqkn .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #dluxqjuqkn .gt_column_spanner_outer:first-child { padding-left: 0; }
 #dluxqjuqkn .gt_column_spanner_outer:last-child { padding-right: 0; }
 #dluxqjuqkn .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #dluxqjuqkn .gt_spanner_row { border-bottom-style: hidden; }
 #dluxqjuqkn .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #dluxqjuqkn .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #dluxqjuqkn .gt_from_md> :first-child { margin-top: 0; }
 #dluxqjuqkn .gt_from_md> :last-child { margin-bottom: 0; }
 #dluxqjuqkn .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #dluxqjuqkn .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
 #dluxqjuqkn .gt_indent_1 { text-indent: 5px; }
 #dluxqjuqkn .gt_indent_2 { text-indent: calc(5px * 2); }
 #dluxqjuqkn .gt_indent_3 { text-indent: calc(5px * 3); }
 #dluxqjuqkn .gt_indent_4 { text-indent: calc(5px * 4); }
 #dluxqjuqkn .gt_indent_5 { text-indent: calc(5px * 5); }
 #dluxqjuqkn .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
 #dluxqjuqkn .gt_row_group_first td { border-top-width: 2px; }
 #dluxqjuqkn .gt_row_group_first th { border-top-width: 2px; }
 #dluxqjuqkn .gt_striped { color: #333333; background-color: #F4F4F4; }
 #dluxqjuqkn .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #dluxqjuqkn .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #dluxqjuqkn .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #dluxqjuqkn .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #dluxqjuqkn .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #dluxqjuqkn .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #dluxqjuqkn .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #dluxqjuqkn .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #dluxqjuqkn .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #dluxqjuqkn .gt_left { text-align: left; }
 #dluxqjuqkn .gt_center { text-align: center; }
 #dluxqjuqkn .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #dluxqjuqkn .gt_font_normal { font-weight: normal; }
 #dluxqjuqkn .gt_font_bold { font-weight: bold; }
 #dluxqjuqkn .gt_font_italic { font-style: italic; }
 #dluxqjuqkn .gt_super { font-size: 65%; }
 #dluxqjuqkn .gt_footnotes { color: font-color(#FFFFFF); background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #dluxqjuqkn .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #dluxqjuqkn .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #dluxqjuqkn .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #dluxqjuqkn .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #dluxqjuqkn .gt_asterisk { font-size: 100%; vertical-align: 0; }
 
</style>

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="4" id="title" class="gt_heading gt_title gt_font_normal">Cat/Non-Cat: premium of the book gross and net of the cover</th>
</tr>
<tr class="gt_heading">
<th colspan="4" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Each distortion at its gross calibration, 10% return, p = 99.9%</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="gross-P" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">gross P</th>
<th id="net-P" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">net P</th>
<th id="saving" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">saving</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">ccoc</th>
<td class="gt_row gt_right" headers="stub-1 gross-P">115.15</td>
<td class="gt_row gt_right" headers="stub-1 net-P">105.90</td>
<td class="gt_row gt_right" headers="stub-1 saving">9.25</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">ph</th>
<td class="gt_row gt_right" headers="stub-2 gross-P">115.15</td>
<td class="gt_row gt_right" headers="stub-2 net-P">107.55</td>
<td class="gt_row gt_right" headers="stub-2 saving">7.60</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">wang</th>
<td class="gt_row gt_right" headers="stub-3 gross-P">115.15</td>
<td class="gt_row gt_right" headers="stub-3 net-P">108.79</td>
<td class="gt_row gt_right" headers="stub-3 saving">6.36</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">dual</th>
<td class="gt_row gt_right" headers="stub-4 gross-P">115.15</td>
<td class="gt_row gt_right" headers="stub-4 net-P">110.13</td>
<td class="gt_row gt_right" headers="stub-4 saving">5.02</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">tvar</th>
<td class="gt_row gt_right" headers="stub-5 gross-P">115.15</td>
<td class="gt_row gt_right" headers="stub-5 net-P">110.88</td>
<td class="gt_row gt_right" headers="stub-5 saving">4.27</td>
</tr>
</tbody>
</table>


Under the CCoC the saving is four times the expected recovery, because the CCoC prices the tail that the cover removes. Read each saving as the most that the cedent can pay for the cover under that measure: its expected loss plus the margin it releases. Which distortion the cedent uses is a business decision.


# 6. Hurricane and severe convective storm

Two catastrophe perils, each with a frequency and a severity. SCS (severe convective storm) has 70 Poisson events a year with a lognormal severity of mean 1 and shape 1.9. Hu (hurricane) has 2 Poisson events a year with a lognormal severity of mean 15 and shape 2.5, a much thicker tail. The grid has a step of 1/4 and 2^19 points:

``` text
port HuSCS.Gross
    agg SCS 70 claims sev 0.16447 * lognorm 1.9 poisson
    agg Hu   2 claims sev 0.65905 * lognorm 2.5 poisson
```

The scale of each lognormal is `m exp(-sigma^2 / 2)` for its mean `m`. The DecL parser of 0.30.1 reads the test suite's `exp(-1.9**2 / 2)` with `-1.9**2` as `(-1.9)**2`, so that program gives SCS events a mean of 36.97, not 1. `hs.py` builds the program in Python and gets 1. The comparison here uses the numbers.


``` python
HU_STEP, HU_POINTS = 0.25, 2**19
scs_sev = discretize(Lognormal(-(1.9**2) / 2, 1.9), HU_STEP, HU_POINTS)
hu_sev = discretize(Lognormal(math.log(15.0) - 2.5**2 / 2, 2.5), HU_STEP, HU_POINTS)
scs, _ = fft(Poisson(70.0), scs_sev, HU_POINTS)
hu, _ = fft(Poisson(2.0), hu_sev, HU_POINTS)
print(f"annual means: SCS {scs.mean():.4f}, Hu {hu.mean():.4f}  (aggregate 0.30.1: 69.1332, 29.7272)")
hs = Portfolio.from_independent(["SCS", "Hu"], [scs, hu])

HS_030 = {  # aggregate 0.30.1, linear allocation
    "ccoc": (0.1000, 69.9780, 251.3356, 321.3136),
    "ph": (0.4492, 92.8223, 228.4915, 321.3138),
    "wang": (1.1897, 107.3655, 213.9484, 321.3138),
    "dual": (12.0290, 128.7668, 192.5471, 321.3139),
    "tvar": (0.8990, 135.7558, 185.5581, 321.3139),
}
hs_d = calibrate(hs, 0.999)
hs_p, hs_t = show(hs, 0.999, hs_d, HS_030)
```


    annual means: SCS 69.1332, Hu 29.7273  (aggregate 0.30.1: 69.1332, 29.7272)
    assets 2583.000; loss within assets: SCS 69.087, Hu 26.058, total 95.145
    largest difference in a premium: 0.0012


``` python
comparison(hs_t, "Hurricane/SCS: premium by unit", "Standard p = 99.9%, 10% return; each distortion against aggregate 0.30.1")
```


<style>
#sxmjtibbxs table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }

#sxmjtibbxs thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#sxmjtibbxs p { margin: 0; padding: 0; }
 #sxmjtibbxs .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #sxmjtibbxs .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #sxmjtibbxs .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #sxmjtibbxs .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
 #sxmjtibbxs .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #sxmjtibbxs .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #sxmjtibbxs .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #sxmjtibbxs .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
 #sxmjtibbxs .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #sxmjtibbxs .gt_column_spanner_outer:first-child { padding-left: 0; }
 #sxmjtibbxs .gt_column_spanner_outer:last-child { padding-right: 0; }
 #sxmjtibbxs .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #sxmjtibbxs .gt_spanner_row { border-bottom-style: hidden; }
 #sxmjtibbxs .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #sxmjtibbxs .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #sxmjtibbxs .gt_from_md> :first-child { margin-top: 0; }
 #sxmjtibbxs .gt_from_md> :last-child { margin-bottom: 0; }
 #sxmjtibbxs .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #sxmjtibbxs .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
 #sxmjtibbxs .gt_indent_1 { text-indent: 5px; }
 #sxmjtibbxs .gt_indent_2 { text-indent: calc(5px * 2); }
 #sxmjtibbxs .gt_indent_3 { text-indent: calc(5px * 3); }
 #sxmjtibbxs .gt_indent_4 { text-indent: calc(5px * 4); }
 #sxmjtibbxs .gt_indent_5 { text-indent: calc(5px * 5); }
 #sxmjtibbxs .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
 #sxmjtibbxs .gt_row_group_first td { border-top-width: 2px; }
 #sxmjtibbxs .gt_row_group_first th { border-top-width: 2px; }
 #sxmjtibbxs .gt_striped { color: #333333; background-color: #F4F4F4; }
 #sxmjtibbxs .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #sxmjtibbxs .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #sxmjtibbxs .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #sxmjtibbxs .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #sxmjtibbxs .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #sxmjtibbxs .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #sxmjtibbxs .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #sxmjtibbxs .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #sxmjtibbxs .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #sxmjtibbxs .gt_left { text-align: left; }
 #sxmjtibbxs .gt_center { text-align: center; }
 #sxmjtibbxs .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #sxmjtibbxs .gt_font_normal { font-weight: normal; }
 #sxmjtibbxs .gt_font_bold { font-weight: bold; }
 #sxmjtibbxs .gt_font_italic { font-style: italic; }
 #sxmjtibbxs .gt_super { font-size: 65%; }
 #sxmjtibbxs .gt_footnotes { color: font-color(#FFFFFF); background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #sxmjtibbxs .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #sxmjtibbxs .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #sxmjtibbxs .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #sxmjtibbxs .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #sxmjtibbxs .gt_asterisk { font-size: 100%; vertical-align: 0; }
 
</style>

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="5" id="title" class="gt_heading gt_title gt_font_normal">Hurricane/SCS: premium by unit</th>
</tr>
<tr class="gt_heading">
<th colspan="5" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Standard p = 99.9%, 10% return; each distortion against aggregate 0.30.1</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="parameter" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">parameter</th>
<th id="SCS" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">SCS</th>
<th id="Hu" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Hu</th>
<th id="total" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">total</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">ccoc</th>
<td class="gt_row gt_right" headers="stub-1 parameter">0.1000</td>
<td class="gt_row gt_right" headers="stub-1 SCS">69.977</td>
<td class="gt_row gt_right" headers="stub-1 Hu">251.337</td>
<td class="gt_row gt_right" headers="stub-1 total">321.314</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">ccoc, aggregate</th>
<td class="gt_row gt_right" headers="stub-2 parameter">0.1000</td>
<td class="gt_row gt_right" headers="stub-2 SCS">69.978</td>
<td class="gt_row gt_right" headers="stub-2 Hu">251.336</td>
<td class="gt_row gt_right" headers="stub-2 total">321.314</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">ph</th>
<td class="gt_row gt_right" headers="stub-3 parameter">0.4492</td>
<td class="gt_row gt_right" headers="stub-3 SCS">92.822</td>
<td class="gt_row gt_right" headers="stub-3 Hu">228.492</td>
<td class="gt_row gt_right" headers="stub-3 total">321.314</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">ph, aggregate</th>
<td class="gt_row gt_right" headers="stub-4 parameter">0.4492</td>
<td class="gt_row gt_right" headers="stub-4 SCS">92.822</td>
<td class="gt_row gt_right" headers="stub-4 Hu">228.492</td>
<td class="gt_row gt_right" headers="stub-4 total">321.314</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">wang</th>
<td class="gt_row gt_right" headers="stub-5 parameter">1.1897</td>
<td class="gt_row gt_right" headers="stub-5 SCS">107.365</td>
<td class="gt_row gt_right" headers="stub-5 Hu">213.949</td>
<td class="gt_row gt_right" headers="stub-5 total">321.314</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">wang, aggregate</th>
<td class="gt_row gt_right" headers="stub-6 parameter">1.1897</td>
<td class="gt_row gt_right" headers="stub-6 SCS">107.365</td>
<td class="gt_row gt_right" headers="stub-6 Hu">213.948</td>
<td class="gt_row gt_right" headers="stub-6 total">321.314</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">dual</th>
<td class="gt_row gt_right" headers="stub-7 parameter">12.0290</td>
<td class="gt_row gt_right" headers="stub-7 SCS">128.767</td>
<td class="gt_row gt_right" headers="stub-7 Hu">192.547</td>
<td class="gt_row gt_right" headers="stub-7 total">321.314</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">dual, aggregate</th>
<td class="gt_row gt_right" headers="stub-8 parameter">12.0290</td>
<td class="gt_row gt_right" headers="stub-8 SCS">128.767</td>
<td class="gt_row gt_right" headers="stub-8 Hu">192.547</td>
<td class="gt_row gt_right" headers="stub-8 total">321.314</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">tvar</th>
<td class="gt_row gt_right" headers="stub-9 parameter">0.8990</td>
<td class="gt_row gt_right" headers="stub-9 SCS">135.756</td>
<td class="gt_row gt_right" headers="stub-9 Hu">185.558</td>
<td class="gt_row gt_right" headers="stub-9 total">321.314</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">tvar, aggregate</th>
<td class="gt_row gt_right" headers="stub-10 parameter">0.8990</td>
<td class="gt_row gt_right" headers="stub-10 SCS">135.756</td>
<td class="gt_row gt_right" headers="stub-10 Hu">185.558</td>
<td class="gt_row gt_right" headers="stub-10 total">321.314</td>
</tr>
</tbody>
</table>


The parameters agree, and the premiums agree to within 0.0012. This difference is again [aggregate](../reference/aggregate.Clash.md#prospicio.aggregate.Clash.aggregate)'s CCoC total, below its calibrated premium (321.3136 against 321.3140). The annual means are below 70 and 30 because the grid stops at 131,072. Renormalizing the severity, as [aggregate](../reference/aggregate.Clash.md#prospicio.aggregate.Clash.aggregate) does, makes Hu lose 0.27 of its mean of 30.

The 99.9% assets, 2,583, are twenty-six times the expected loss, and the premium of 321.31 is a loss ratio of 30%. The tail is so thick that the top of the grid changes the answer. With [Grid.rounding](../reference/distributions.Grid.md#prospicio.distributions.Grid.rounding), which keeps the probability above the grid on its last point, the 99.9% assets move:


``` python
lumped = Grid.rounding(Lognormal(math.log(15.0) - 2.5**2 / 2, 2.5), HU_STEP, HU_POINTS)[0]
hu_lumped, _ = fft(Poisson(2.0), lumped, HU_POINTS)
hs_lumped = Portfolio.from_independent(["SCS", "Hu"], [scs, hu_lumped])
print(f"Hu mean {hu_lumped.mean():.4f}, assets at 99.9% {hs_lumped.assets(0.999):.2f}")
```


    Hu mean 29.8662, assets at 99.9% 2584.75


Neither convention gives the true distribution. The first loses the hurricanes above 131,072, and the second puts them all at 131,072. For a severity this thick, check the answer against the grid before you quote it.

The net version buys a per-occurrence cover on hurricanes, 372.4 excess of 40.25, about the band between the 95% and 99.5% severity quantiles:

``` text
agg Net.Hu 2 claims sev 0.65905 * lognorm 2.5 occurrence net of 372.4 xs 40.25 poisson
```


``` python
print(f"Hu severity quantiles: 95% {hu_sev.quantile(0.95):.2f}, 99.5% {hu_sev.quantile(0.995):.2f}")
hu_cover = Tower([Layer("372.4 xs 40.25", 372.4, 40.25)]).on_grid(Poisson(2.0), hu_sev, HU_POINTS)
print(f"net Hu mean {hu_cover.net.mean():.4f}  (aggregate 0.30.1: 19.6066)")
hs_net = Portfolio.from_independent(["SCS", "Hu"], [scs, hu_cover.net])

HS_NET_030 = {  # aggregate 0.30.1, linear allocation, gross distortions: (P SCS, P Hu, P total)
    "ccoc": (70.8172, 207.5519, 278.3692),
    "ph": (103.5237, 157.0879, 260.6115),
    "wang": (121.5553, 131.7081, 253.2635),
    "dual": (148.2679, 92.9822, 241.2502),
    "tvar": (155.4211, 83.3008, 238.7219),
}
hs_net_p, hs_net_t = show(hs_net, 0.999, hs_d, HS_NET_030)
```


    Hu severity quantiles: 95% 40.25, 99.5% 412.50
    net Hu mean 19.6066  (aggregate 0.30.1: 19.6066)
    assets 2211.750; loss within assets: SCS 69.079, Hu 15.952, total 85.031
    largest difference in a premium: 0.0012


``` python
comparison(hs_net_t, "Hurricane/SCS net of 372.4 xs 40.25: premium by unit",
           "Standard p = 99.9%, gross distortions; each against aggregate 0.30.1")
```


<style>
#pfsgzblvrl table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }

#pfsgzblvrl thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#pfsgzblvrl p { margin: 0; padding: 0; }
 #pfsgzblvrl .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #pfsgzblvrl .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #pfsgzblvrl .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #pfsgzblvrl .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
 #pfsgzblvrl .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #pfsgzblvrl .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #pfsgzblvrl .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #pfsgzblvrl .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
 #pfsgzblvrl .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #pfsgzblvrl .gt_column_spanner_outer:first-child { padding-left: 0; }
 #pfsgzblvrl .gt_column_spanner_outer:last-child { padding-right: 0; }
 #pfsgzblvrl .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #pfsgzblvrl .gt_spanner_row { border-bottom-style: hidden; }
 #pfsgzblvrl .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #pfsgzblvrl .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #pfsgzblvrl .gt_from_md> :first-child { margin-top: 0; }
 #pfsgzblvrl .gt_from_md> :last-child { margin-bottom: 0; }
 #pfsgzblvrl .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #pfsgzblvrl .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
 #pfsgzblvrl .gt_indent_1 { text-indent: 5px; }
 #pfsgzblvrl .gt_indent_2 { text-indent: calc(5px * 2); }
 #pfsgzblvrl .gt_indent_3 { text-indent: calc(5px * 3); }
 #pfsgzblvrl .gt_indent_4 { text-indent: calc(5px * 4); }
 #pfsgzblvrl .gt_indent_5 { text-indent: calc(5px * 5); }
 #pfsgzblvrl .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
 #pfsgzblvrl .gt_row_group_first td { border-top-width: 2px; }
 #pfsgzblvrl .gt_row_group_first th { border-top-width: 2px; }
 #pfsgzblvrl .gt_striped { color: #333333; background-color: #F4F4F4; }
 #pfsgzblvrl .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #pfsgzblvrl .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #pfsgzblvrl .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #pfsgzblvrl .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #pfsgzblvrl .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #pfsgzblvrl .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #pfsgzblvrl .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #pfsgzblvrl .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #pfsgzblvrl .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #pfsgzblvrl .gt_left { text-align: left; }
 #pfsgzblvrl .gt_center { text-align: center; }
 #pfsgzblvrl .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #pfsgzblvrl .gt_font_normal { font-weight: normal; }
 #pfsgzblvrl .gt_font_bold { font-weight: bold; }
 #pfsgzblvrl .gt_font_italic { font-style: italic; }
 #pfsgzblvrl .gt_super { font-size: 65%; }
 #pfsgzblvrl .gt_footnotes { color: font-color(#FFFFFF); background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #pfsgzblvrl .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #pfsgzblvrl .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #pfsgzblvrl .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #pfsgzblvrl .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #pfsgzblvrl .gt_asterisk { font-size: 100%; vertical-align: 0; }
 
</style>

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="4" id="title" class="gt_heading gt_title gt_font_normal">Hurricane/SCS net of 372.4 xs 40.25: premium by unit</th>
</tr>
<tr class="gt_heading">
<th colspan="4" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Standard p = 99.9%, gross distortions; each against aggregate 0.30.1</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="SCS" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">SCS</th>
<th id="Hu" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Hu</th>
<th id="total" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">total</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">ccoc</th>
<td class="gt_row gt_right" headers="stub-1 SCS">70.816</td>
<td class="gt_row gt_right" headers="stub-1 Hu">207.553</td>
<td class="gt_row gt_right" headers="stub-1 total">278.369</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">ccoc, aggregate</th>
<td class="gt_row gt_right" headers="stub-2 SCS">70.817</td>
<td class="gt_row gt_right" headers="stub-2 Hu">207.552</td>
<td class="gt_row gt_right" headers="stub-2 total">278.369</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">ph</th>
<td class="gt_row gt_right" headers="stub-3 SCS">103.523</td>
<td class="gt_row gt_right" headers="stub-3 Hu">157.088</td>
<td class="gt_row gt_right" headers="stub-3 total">260.612</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">ph, aggregate</th>
<td class="gt_row gt_right" headers="stub-4 SCS">103.524</td>
<td class="gt_row gt_right" headers="stub-4 Hu">157.088</td>
<td class="gt_row gt_right" headers="stub-4 total">260.611</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">wang</th>
<td class="gt_row gt_right" headers="stub-5 SCS">121.555</td>
<td class="gt_row gt_right" headers="stub-5 Hu">131.708</td>
<td class="gt_row gt_right" headers="stub-5 total">253.263</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">wang, aggregate</th>
<td class="gt_row gt_right" headers="stub-6 SCS">121.555</td>
<td class="gt_row gt_right" headers="stub-6 Hu">131.708</td>
<td class="gt_row gt_right" headers="stub-6 total">253.263</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">dual</th>
<td class="gt_row gt_right" headers="stub-7 SCS">148.268</td>
<td class="gt_row gt_right" headers="stub-7 Hu">92.982</td>
<td class="gt_row gt_right" headers="stub-7 total">241.250</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">dual, aggregate</th>
<td class="gt_row gt_right" headers="stub-8 SCS">148.268</td>
<td class="gt_row gt_right" headers="stub-8 Hu">92.982</td>
<td class="gt_row gt_right" headers="stub-8 total">241.250</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">tvar</th>
<td class="gt_row gt_right" headers="stub-9 SCS">155.421</td>
<td class="gt_row gt_right" headers="stub-9 Hu">83.301</td>
<td class="gt_row gt_right" headers="stub-9 total">238.722</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">tvar, aggregate</th>
<td class="gt_row gt_right" headers="stub-10 SCS">155.421</td>
<td class="gt_row gt_right" headers="stub-10 Hu">83.301</td>
<td class="gt_row gt_right" headers="stub-10 total">238.722</td>
</tr>
</tbody>
</table>


``` python
fig, ax = plt.subplots()
x = np.arange(len(FAMILIES))
ax.bar(x - 0.2, [hs_p[f].allocated[1].premium for f in FAMILIES], width=0.4, label="gross")
ax.bar(x + 0.2, [hs_net_p[f].allocated[1].premium for f in FAMILIES], width=0.4, label="net of the cover")
ax.set_xticks(x, FAMILIES)
ax.set_xlabel("distortion")
ax.set_ylabel("premium of Hu")
ax.set_title("Hurricane/SCS: the premium of Hu, gross and net of 372.4 xs 40.25")
ax.legend()
```


<figure class="p-figure figure">
<img src="data:image/svg+xml;base64,PHN2ZyB4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjQ2My4zMjg5ODRwdCIgaGVpZ2h0PSIyNjIuMTAzODQ0cHQiIHZpZXdib3g9IjAgMCA0NjMuMzI4OTg0IDI2Mi4xMDM4NDQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIj4KIDxtZXRhZGF0YT4KICA8cmRmIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5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3RleHQ+CiAgICA8L2c+CiAgICA8ZyBpZD0icGF0Y2hfMTYiPgogICAgIDxwYXRoIGQ9Ik0gMzEyLjMyMjI2NiA1Ny4wNzcyNjYgCkwgMzM0LjMyMjI2NiA1Ny4wNzcyNjYgCkwgMzM0LjMyMjI2NiA0OS4zNzcyNjYgCkwgMzEyLjMyMjI2NiA0OS4zNzcyNjYgCnoKIiBzdHlsZT0iZmlsbDogdmFyKC0tcC1zZXJpZXMtMikiIC8+CiAgICA8L2c+CiAgICA8ZyBpZD0idGV4dF8xNiI+CiAgICAgPHRleHQgc3R5bGU9ImZvbnQtc2l6ZTogMTFweDsgZm9udC1mYW1pbHk6IHZhcigtLXAtZm9udCk7IHRleHQtYW5jaG9yOiBzdGFydDsgZmlsbDogdmFyKC0tcC1pbmspIiB4PSIzNDMuMTIyMjY2IiB5PSI1Ny4wNzcyNjYiIHRyYW5zZm9ybT0icm90YXRlKC0wIDM0My4xMjIyNjYgNTcuMDc3MjY2KSI+bmV0IG9mIHRoZSBjb3ZlcjwvdGV4dD4KICAgIDwvZz4KICAgPC9nPgogIDwvZz4KIDwvZz4KIDxkZWZzPgogIDxjbGlwcGF0aCBpZD0icDU0MjMyZmFhZjUiPgogICA8cmVjdCB4PSI1MC4xOTcxMDkiIHk9IjIyLjMxODEyNSIgd2lkdGg9IjM5MC42IiBoZWlnaHQ9IjE5OS41ODQiIC8+CiAgPC9jbGlwcGF0aD4KIDwvZGVmcz4KPC9zdmc+" />
</figure>


The net book also agrees to within 0.0012. The cover removes a third of the hurricane loss (10.1 of 29.7) but only 371 of the 2,583 of assets: hurricanes above the top of the cover, 412.65, cause the 99.9% outcome, and the cedent keeps them. Under the dual power and TVaR, which load SCS more, the Hu premium falls by more than half.


# 7. Lifted capital: the version difference again

The tables above use the linear allocation, the default. With `allocation="lifted"`, the capital of each unit, and in one case the premium, differ between [aggregate](../reference/aggregate.Clash.md#prospicio.aggregate.Clash.aggregate) 0.30.1 and prospicio. [CAS Monograph 15 reproduced](capital-modeling-monograph-15.md#5-capital-by-unit-if-you-must) shows the same difference for InsCo and traces it to a change in [aggregate](../reference/aggregate.Clash.md#prospicio.aggregate.Clash.aggregate) between 0.30.1 and 1.0.1; prospicio's tests of the natural allocation use 1.0.1. The code below compares the two on the gross Cat/Non-Cat book (P is the premium, Q the capital):


``` python
LIFTED_030 = {  # aggregate 0.30.1, lifted: (P NonCat, Q NonCat, P Cat, Q Cat)
    "ccoc": (74.6401, -39.5909, 40.5110, 191.6431),
    "ph": (82.2573, 48.5354, 32.8938, 103.5170),
    "wang": (83.8865, 59.8745, 31.2646, 92.1783),
    "dual": (85.4756, 63.0400, 29.6755, 89.0144),
    "tvar": (86.4562, 63.1853, 28.6949, 88.8705),
}
rows = []
for f, d in cnc_d.items():
    nc, ct = cnc.price(d, p=0.999, allocation="lifted").allocated
    rows += [(f, nc.premium, nc.capital, ct.premium, ct.capital), (f"{f}, aggregate", *LIFTED_030[f])]
lifted = pd.DataFrame(rows, columns=["distortion", "NonCat P", "NonCat Q", "Cat P", "Cat Q"])
(GT(lifted, rowname_col="distortion")
 .tab_header("Cat/Non-Cat: premium and capital by unit, lifted allocation",
             "Standard p = 99.9%, 10% return; each distortion against aggregate 0.30.1")
 .fmt_number(["NonCat P", "NonCat Q", "Cat P", "Cat Q"], decimals=2, use_seps=False))
```


<style>
#myavkcqday table {
          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', 'Fira Sans', 'Droid Sans', Arial, sans-serif;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
        }

#myavkcqday thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#myavkcqday p { margin: 0; padding: 0; }
 #myavkcqday .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }
 #myavkcqday .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #myavkcqday .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
 #myavkcqday .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
 #myavkcqday .gt_heading { background-color: #FFFFFF; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #myavkcqday .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #myavkcqday .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
 #myavkcqday .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; overflow-x: hidden; }
 #myavkcqday .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
 #myavkcqday .gt_column_spanner_outer:first-child { padding-left: 0; }
 #myavkcqday .gt_column_spanner_outer:last-child { padding-right: 0; }
 #myavkcqday .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
 #myavkcqday .gt_spanner_row { border-bottom-style: hidden; }
 #myavkcqday .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }
 #myavkcqday .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }
 #myavkcqday .gt_from_md> :first-child { margin-top: 0; }
 #myavkcqday .gt_from_md> :last-child { margin-bottom: 0; }
 #myavkcqday .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }
 #myavkcqday .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; }
 #myavkcqday .gt_indent_1 { text-indent: 5px; }
 #myavkcqday .gt_indent_2 { text-indent: calc(5px * 2); }
 #myavkcqday .gt_indent_3 { text-indent: calc(5px * 3); }
 #myavkcqday .gt_indent_4 { text-indent: calc(5px * 4); }
 #myavkcqday .gt_indent_5 { text-indent: calc(5px * 5); }
 #myavkcqday .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 5px; padding-right: 5px; vertical-align: top; }
 #myavkcqday .gt_row_group_first td { border-top-width: 2px; }
 #myavkcqday .gt_row_group_first th { border-top-width: 2px; }
 #myavkcqday .gt_striped { color: #333333; background-color: #F4F4F4; }
 #myavkcqday .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #myavkcqday .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #myavkcqday .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #myavkcqday .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #myavkcqday .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #myavkcqday .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #myavkcqday .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #myavkcqday .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #myavkcqday .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #myavkcqday .gt_left { text-align: left; }
 #myavkcqday .gt_center { text-align: center; }
 #myavkcqday .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #myavkcqday .gt_font_normal { font-weight: normal; }
 #myavkcqday .gt_font_bold { font-weight: bold; }
 #myavkcqday .gt_font_italic { font-style: italic; }
 #myavkcqday .gt_super { font-size: 65%; }
 #myavkcqday .gt_footnotes { color: font-color(#FFFFFF); background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #myavkcqday .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #myavkcqday .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }
 #myavkcqday .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #myavkcqday .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #myavkcqday .gt_asterisk { font-size: 100%; vertical-align: 0; }
 
</style>

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="5" id="title" class="gt_heading gt_title gt_font_normal">Cat/Non-Cat: premium and capital by unit, lifted allocation</th>
</tr>
<tr class="gt_heading">
<th colspan="5" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Standard p = 99.9%, 10% return; each distortion against aggregate 0.30.1</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="NonCat-P" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">NonCat P</th>
<th id="NonCat-Q" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">NonCat Q</th>
<th id="Cat-P" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Cat P</th>
<th id="Cat-Q" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Cat Q</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">ccoc</th>
<td class="gt_row gt_right" headers="stub-1 NonCat-P">75.43</td>
<td class="gt_row gt_right" headers="stub-1 NonCat-Q">−45.58</td>
<td class="gt_row gt_right" headers="stub-1 Cat-P">39.72</td>
<td class="gt_row gt_right" headers="stub-1 Cat-Q">197.63</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">ccoc, aggregate</th>
<td class="gt_row gt_right" headers="stub-2 NonCat-P">74.64</td>
<td class="gt_row gt_right" headers="stub-2 NonCat-Q">−39.59</td>
<td class="gt_row gt_right" headers="stub-2 Cat-P">40.51</td>
<td class="gt_row gt_right" headers="stub-2 Cat-Q">191.64</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">ph</th>
<td class="gt_row gt_right" headers="stub-3 NonCat-P">82.26</td>
<td class="gt_row gt_right" headers="stub-3 NonCat-Q">48.80</td>
<td class="gt_row gt_right" headers="stub-3 Cat-P">32.89</td>
<td class="gt_row gt_right" headers="stub-3 Cat-Q">103.25</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">ph, aggregate</th>
<td class="gt_row gt_right" headers="stub-4 NonCat-P">82.26</td>
<td class="gt_row gt_right" headers="stub-4 NonCat-Q">48.54</td>
<td class="gt_row gt_right" headers="stub-4 Cat-P">32.89</td>
<td class="gt_row gt_right" headers="stub-4 Cat-Q">103.52</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">wang</th>
<td class="gt_row gt_right" headers="stub-5 NonCat-P">83.89</td>
<td class="gt_row gt_right" headers="stub-5 NonCat-Q">59.88</td>
<td class="gt_row gt_right" headers="stub-5 Cat-P">31.26</td>
<td class="gt_row gt_right" headers="stub-5 Cat-Q">92.18</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">wang, aggregate</th>
<td class="gt_row gt_right" headers="stub-6 NonCat-P">83.89</td>
<td class="gt_row gt_right" headers="stub-6 NonCat-Q">59.87</td>
<td class="gt_row gt_right" headers="stub-6 Cat-P">31.26</td>
<td class="gt_row gt_right" headers="stub-6 Cat-Q">92.18</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">dual</th>
<td class="gt_row gt_right" headers="stub-7 NonCat-P">85.48</td>
<td class="gt_row gt_right" headers="stub-7 NonCat-Q">63.04</td>
<td class="gt_row gt_right" headers="stub-7 Cat-P">29.68</td>
<td class="gt_row gt_right" headers="stub-7 Cat-Q">89.01</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">dual, aggregate</th>
<td class="gt_row gt_right" headers="stub-8 NonCat-P">85.48</td>
<td class="gt_row gt_right" headers="stub-8 NonCat-Q">63.04</td>
<td class="gt_row gt_right" headers="stub-8 Cat-P">29.68</td>
<td class="gt_row gt_right" headers="stub-8 Cat-Q">89.01</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">tvar</th>
<td class="gt_row gt_right" headers="stub-9 NonCat-P">86.46</td>
<td class="gt_row gt_right" headers="stub-9 NonCat-Q">63.18</td>
<td class="gt_row gt_right" headers="stub-9 Cat-P">28.69</td>
<td class="gt_row gt_right" headers="stub-9 Cat-Q">88.87</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">tvar, aggregate</th>
<td class="gt_row gt_right" headers="stub-10 NonCat-P">86.46</td>
<td class="gt_row gt_right" headers="stub-10 NonCat-Q">63.19</td>
<td class="gt_row gt_right" headers="stub-10 Cat-P">28.69</td>
<td class="gt_row gt_right" headers="stub-10 Cat-Q">88.87</td>
</tr>
</tbody>
</table>


The table shows two decimals because the CCoC row is sensitive to round-off: it moves in the fourth decimal when the CCoC's [r](../reference/distributions.NegativeBinomial.md#prospicio.distributions.NegativeBinomial.r) changes in its last bit. Wang, dual power and TVaR agree to about 0.004. Under PH the premiums agree and the capital does not (NonCat 48.80 against 48.54). Under the CCoC the premiums also differ (NonCat 75.43 against 74.64), and both programs give NonCat a negative capital. The totals agree in each row. As in the monograph guide, use the premiums and margins of the linear allocation, which agree, and treat capital by unit under the CCoC and PH as dependent on the version.

Where to go next: [prospicio for aggregate users](prospicio-for-aggregate-users.md) for the DecL clauses used above. [What a reinsurance price is](reinsurance-price.md) for how a reinsurer prices the covers of sections 5 and 6.
