# Iman-Conover, uncertainty and capital by layer: CAS Monograph 15, chapter 8

CAS Monograph 15 is *Introduction to Capital Modeling and Portfolio Management* (John Major and Stephen Mildenhall, 2026). Chapter 8 covers parameter uncertainty, the Iman-Conover method, capital allocation by layer and Bodoff's layer allocation. This guide runs each topic in prospicio and shows the monograph's numbers beside prospicio's.

Exact numbers (Example 2's regional means and percentiles, the InsCo tables of sections 8.3 and 8.4) agree with prospicio to the printed digits. Numbers from one sample of 1,000 simulations (the achieved correlations of Examples 1 and 2) agree within sampling error, whose size the guide shows. The explanations are in new words; the table numbers are the monograph's.

Companion guides: [chapter 9](capital-modeling-monograph-15.md), [chapters 3 and 4](capital-modeling-monograph-15-theory.md), [chapters 5 and 6](capital-modeling-monograph-15-applications.md) and [chapters 1, 2 and 7](capital-modeling-monograph-15-practice.md).


# 1. Parameter uncertainty

Section 8.1 separates process risk (the randomness of a loss with a known distribution) from parameter uncertainty (an unknown distribution). It gives four responses: ignore the uncertainty, report a range, absorb it into a predictive distribution, or isolate a credible worst case. Take a lognormal severity with [sigma](../reference/reserving.MackFit.md#prospicio.reserving.MackFit.sigma) 1.2 and a mean of about 100, whose log-scale location is known only to within 0.3 in each direction:


``` python
import math

import pandas as pd
from great_tables import GT

from prospicio.distributions import Lognormal

SIGMA = 1.2
best = math.log(100.0) - SIGMA**2 / 2
severities = [Lognormal(best + shift, SIGMA) for shift in (-0.3, 0.0, 0.3)]

def mixture_quantile(dists, p, lo=0.0, hi=1e6):
    """The p quantile of an equal mixture, by bisection on its cdf."""
    for _ in range(200):
        mid = (lo + hi) / 2
        lo, hi = (mid, hi) if sum(d.cdf(mid) for d in dists) / len(dists) < p else (lo, mid)
    return (lo + hi) / 2

responses = pd.DataFrame(
    [{"response": f"report, {name}", "mean": d.mean(), "q": d.quantile(0.995)}
     for name, d in zip(("low", "best", "high"), severities)]
    + [{"response": "ignore it", "mean": None, "q": severities[1].quantile(0.995)},
       {"response": "absorb it", "mean": None, "q": mixture_quantile(severities, 0.995)},
       {"response": "isolate it", "mean": None, "q": severities[2].quantile(0.995)}]
)
(GT(responses, rowname_col="response")
 .tab_header("Responses to parameter uncertainty", "Lognormal severity with sigma 1.2; the location moves by 0.3")
 .cols_label(q="99.5% quantile")
 .fmt_number(["mean", "q"], decimals=1, use_seps=False)
 .sub_missing(missing_text=""))
```


<style>
#azycjzkelh 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;
        }

#azycjzkelh thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#azycjzkelh p { margin: 0; padding: 0; }
 #azycjzkelh .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; }
 #azycjzkelh .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #azycjzkelh .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; }
 #azycjzkelh .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; }
 #azycjzkelh .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; }
 #azycjzkelh .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #azycjzkelh .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; }
 #azycjzkelh .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; }
 #azycjzkelh .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; }
 #azycjzkelh .gt_column_spanner_outer:first-child { padding-left: 0; }
 #azycjzkelh .gt_column_spanner_outer:last-child { padding-right: 0; }
 #azycjzkelh .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%; }
 #azycjzkelh .gt_spanner_row { border-bottom-style: hidden; }
 #azycjzkelh .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; }
 #azycjzkelh .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; }
 #azycjzkelh .gt_from_md> :first-child { margin-top: 0; }
 #azycjzkelh .gt_from_md> :last-child { margin-bottom: 0; }
 #azycjzkelh .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; }
 #azycjzkelh .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; }
 #azycjzkelh .gt_indent_1 { text-indent: 5px; }
 #azycjzkelh .gt_indent_2 { text-indent: calc(5px * 2); }
 #azycjzkelh .gt_indent_3 { text-indent: calc(5px * 3); }
 #azycjzkelh .gt_indent_4 { text-indent: calc(5px * 4); }
 #azycjzkelh .gt_indent_5 { text-indent: calc(5px * 5); }
 #azycjzkelh .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; }
 #azycjzkelh .gt_row_group_first td { border-top-width: 2px; }
 #azycjzkelh .gt_row_group_first th { border-top-width: 2px; }
 #azycjzkelh .gt_striped { color: #333333; background-color: #F4F4F4; }
 #azycjzkelh .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; }
 #azycjzkelh .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #azycjzkelh .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #azycjzkelh .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #azycjzkelh .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #azycjzkelh .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #azycjzkelh .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #azycjzkelh .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; }
 #azycjzkelh .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #azycjzkelh .gt_left { text-align: left; }
 #azycjzkelh .gt_center { text-align: center; }
 #azycjzkelh .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #azycjzkelh .gt_font_normal { font-weight: normal; }
 #azycjzkelh .gt_font_bold { font-weight: bold; }
 #azycjzkelh .gt_font_italic { font-style: italic; }
 #azycjzkelh .gt_super { font-size: 65%; }
 #azycjzkelh .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; }
 #azycjzkelh .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #azycjzkelh .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; }
 #azycjzkelh .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #azycjzkelh .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #azycjzkelh .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="3" id="title" class="gt_heading gt_title gt_font_normal">Responses to parameter uncertainty</th>
</tr>
<tr class="gt_heading">
<th colspan="3" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Lognormal severity with sigma 1.2; the location moves by 0.3</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="mean" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">mean</th>
<th id="q" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">99.5% quantile</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">report, low</th>
<td class="gt_row gt_right" headers="stub-1 mean">74.1</td>
<td class="gt_row gt_right" headers="stub-1 q">793.3</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">report, best</th>
<td class="gt_row gt_right" headers="stub-2 mean">100.0</td>
<td class="gt_row gt_right" headers="stub-2 q">1070.8</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">report, high</th>
<td class="gt_row gt_right" headers="stub-3 mean">135.0</td>
<td class="gt_row gt_right" headers="stub-3 q">1445.4</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">ignore it</th>
<td class="gt_row gt_right" headers="stub-4 mean"></td>
<td class="gt_row gt_right" headers="stub-4 q">1070.8</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">absorb it</th>
<td class="gt_row gt_right" headers="stub-5 mean"></td>
<td class="gt_row gt_right" headers="stub-5 q">1139.9</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">isolate it</th>
<td class="gt_row gt_right" headers="stub-6 mean"></td>
<td class="gt_row gt_right" headers="stub-6 q">1445.4</td>
</tr>
</tbody>
</table>


Absorbing the uncertainty, with equal weights on the three locations, gives a quantile about 6% above the best estimate. This is the downward bias that the monograph finds in a quantile that ignores parameter uncertainty.

[PredictiveDistribution.blend](../reference/distributions.PredictiveDistribution.md#prospicio.distributions.PredictiveDistribution.blend) does the same mixing of whole simulations: it takes each simulation from one of several models with given weights. The Bayesian models (for example `BayesOdp` in reserving) return predictive distributions that already include parameter uncertainty.


# 2. Example 1: three units

Section 8.2.2 correlates three units: Auto, GL and Property. Each unit has a lognormal severity limited per occurrence and a gamma-mixed Poisson count:

| Unit     | Expected loss | Limit  | Severity mean | Severity CV | Mixing CV |
|----------|---------------|--------|---------------|-------------|-----------|
| Auto     | 5,000         | 2,000  | 30            | 2           | 0.2       |
| GL       | 2,000         | 5,000  | 50            | 5           | 0.3       |
| Property | 7,000         | 10,000 | 100           | 5           | 0.1       |

prospicio compounds each unit by FFT. Then it draws 1,000 independent years from the three distributions, as the monograph does:


``` python
import numpy as np

from prospicio.aggregate import fft
from prospicio.distributions import Count, Grid, PredictiveDistribution
from prospicio.risk import GaussianCopula, iman_conover, simulate

def unit(loss, limit, mean, cv, mixing_cv, step=1.0, points=2**16):
    """A unit's annual loss: limited lognormal claims, gamma-mixed Poisson count."""
    severity, _ = Grid.local_moment(Lognormal.from_mean_cv(mean, cv), step, points)
    claim, _ = severity.map(lambda x: min(x, limit))
    annual, _ = fft(Count.mixed_poisson(loss / claim.mean(), mixing_cv), claim, points)
    return annual

UNITS = {"Auto": (5000, 2000, 30, 2, 0.2), "GL": (2000, 5000, 50, 5, 0.3),
         "Property": (7000, 10000, 100, 5, 0.1)}
grids = [unit(*args) for args in UNITS.values()]
KEYS = [(name,) for name in UNITS]
IDENTITY = np.eye(3).tolist()
sample = simulate(GaussianCopula(IDENTITY), grids, 1000, 815, keys=KEYS, dims=["unit"])
X = np.array(sample.draw_matrix())

BOOK_81 = {"Auto": (5011.7, 0.257), "GL": (2092.4, 0.660), "Property": (7117.8, 0.467)}
table_81 = pd.DataFrame(
    [{"unit": name, "fft_mean": g.mean(), "fft_cv": g.variance() ** 0.5 / g.mean(),
      "mean": X[:, j].mean(), "cv": X[:, j].std(ddof=1) / X[:, j].mean(),
      "book_mean": BOOK_81[name][0], "book_cv": BOOK_81[name][1]}
     for j, (name, g) in enumerate(zip(UNITS, grids))]
)
(GT(table_81, rowname_col="unit")
 .tab_header("Table 8.1: three units, model and sample", "Annual loss; the sample has 1,000 years")
 .cols_label(fft_mean="FFT mean", fft_cv="FFT cv", mean="sample mean", cv="sample cv",
             book_mean="book mean", book_cv="book cv")
 .fmt_number(["fft_mean", "mean", "book_mean"], decimals=1, use_seps=False)
 .fmt_number(["fft_cv", "cv", "book_cv"], decimals=3))
```


<style>
#iduriagtfa 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;
        }

#iduriagtfa thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#iduriagtfa p { margin: 0; padding: 0; }
 #iduriagtfa .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; }
 #iduriagtfa .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #iduriagtfa .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; }
 #iduriagtfa .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; }
 #iduriagtfa .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; }
 #iduriagtfa .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #iduriagtfa .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; }
 #iduriagtfa .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; }
 #iduriagtfa .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; }
 #iduriagtfa .gt_column_spanner_outer:first-child { padding-left: 0; }
 #iduriagtfa .gt_column_spanner_outer:last-child { padding-right: 0; }
 #iduriagtfa .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%; }
 #iduriagtfa .gt_spanner_row { border-bottom-style: hidden; }
 #iduriagtfa .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; }
 #iduriagtfa .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; }
 #iduriagtfa .gt_from_md> :first-child { margin-top: 0; }
 #iduriagtfa .gt_from_md> :last-child { margin-bottom: 0; }
 #iduriagtfa .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; }
 #iduriagtfa .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; }
 #iduriagtfa .gt_indent_1 { text-indent: 5px; }
 #iduriagtfa .gt_indent_2 { text-indent: calc(5px * 2); }
 #iduriagtfa .gt_indent_3 { text-indent: calc(5px * 3); }
 #iduriagtfa .gt_indent_4 { text-indent: calc(5px * 4); }
 #iduriagtfa .gt_indent_5 { text-indent: calc(5px * 5); }
 #iduriagtfa .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; }
 #iduriagtfa .gt_row_group_first td { border-top-width: 2px; }
 #iduriagtfa .gt_row_group_first th { border-top-width: 2px; }
 #iduriagtfa .gt_striped { color: #333333; background-color: #F4F4F4; }
 #iduriagtfa .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; }
 #iduriagtfa .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #iduriagtfa .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #iduriagtfa .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #iduriagtfa .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #iduriagtfa .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #iduriagtfa .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #iduriagtfa .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; }
 #iduriagtfa .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #iduriagtfa .gt_left { text-align: left; }
 #iduriagtfa .gt_center { text-align: center; }
 #iduriagtfa .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #iduriagtfa .gt_font_normal { font-weight: normal; }
 #iduriagtfa .gt_font_bold { font-weight: bold; }
 #iduriagtfa .gt_font_italic { font-style: italic; }
 #iduriagtfa .gt_super { font-size: 65%; }
 #iduriagtfa .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; }
 #iduriagtfa .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #iduriagtfa .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; }
 #iduriagtfa .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #iduriagtfa .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #iduriagtfa .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="7" id="title" class="gt_heading gt_title gt_font_normal">Table 8.1: three units, model and sample</th>
</tr>
<tr class="gt_heading">
<th colspan="7" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Annual loss; the sample has 1,000 years</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="fft_mean" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">FFT mean</th>
<th id="fft_cv" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">FFT cv</th>
<th id="mean" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">sample mean</th>
<th id="cv" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">sample cv</th>
<th id="book_mean" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book mean</th>
<th id="book_cv" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book cv</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">Auto</th>
<td class="gt_row gt_right" headers="stub-1 fft_mean">5000.0</td>
<td class="gt_row gt_right" headers="stub-1 fft_cv">0.262</td>
<td class="gt_row gt_right" headers="stub-1 mean">4998.8</td>
<td class="gt_row gt_right" headers="stub-1 cv">0.262</td>
<td class="gt_row gt_right" headers="stub-1 book_mean">5011.7</td>
<td class="gt_row gt_right" headers="stub-1 book_cv">0.257</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">GL</th>
<td class="gt_row gt_right" headers="stub-2 fft_mean">2000.0</td>
<td class="gt_row gt_right" headers="stub-2 fft_cv">0.672</td>
<td class="gt_row gt_right" headers="stub-2 mean">2042.0</td>
<td class="gt_row gt_right" headers="stub-2 cv">0.644</td>
<td class="gt_row gt_right" headers="stub-2 book_mean">2092.4</td>
<td class="gt_row gt_right" headers="stub-2 book_cv">0.660</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">Property</th>
<td class="gt_row gt_right" headers="stub-3 fft_mean">7000.0</td>
<td class="gt_row gt_right" headers="stub-3 fft_cv">0.465</td>
<td class="gt_row gt_right" headers="stub-3 mean">7017.0</td>
<td class="gt_row gt_right" headers="stub-3 cv">0.454</td>
<td class="gt_row gt_right" headers="stub-3 book_mean">7117.8</td>
<td class="gt_row gt_right" headers="stub-3 book_cv">0.467</td>
</tr>
</tbody>
</table>


The FFT columns are the model. Both samples differ from it by a few percent, which is sampling error, not a model difference.


# 3. The target and the achieved correlation

The target (Table 8.2) has a correlation of -0.3 between Auto and GL, 0.8 between GL and Property, and 0 between Auto and Property. A target must be a correlation matrix: symmetric and positive definite. prospicio refuses one that is not:


``` python
TARGET = [[1.0, -0.3, 0.0], [-0.3, 1.0, 0.8], [0.0, 0.8, 1.0]]
print("eigenvalues of the target:", np.linalg.eigvalsh(TARGET).round(3))
try:
    iman_conover(sample, [[1.0, 0.9, 0.9], [0.9, 1.0, -0.9], [0.9, -0.9, 1.0]], 1)
except ValueError:
    print("not positive definite: ValueError")
```


    eigenvalues of the target: [0.146 1.    1.854]
    not positive definite: ValueError


[iman_conover](../reference/risk.iman_conover.md#prospicio.risk.iman_conover) reorders each column of the sample. Each unit keeps exactly its own 1,000 values, and only the grouping of the values into years changes:


``` python
PAIRS = [(0, 1), (0, 2), (1, 2)]
NAMES = ["Auto-GL", "Auto-Property", "GL-Property"]

def ranks(a):
    """Ranks from 0, ties in order of appearance (as R's rank(ties.method = "first"))."""
    return np.argsort(np.argsort(a, axis=0, kind="stable"), axis=0, kind="stable")

def pairs(m):
    """Pearson and Spearman correlation of each pair of columns."""
    pearson, spearman = np.corrcoef(m.T), np.corrcoef(ranks(m).T)
    return [(pearson[i, j], spearman[i, j]) for i, j in PAIRS]

joint = iman_conover(sample, TARGET, 1)
Y = np.array(joint.draw_matrix())
print("marginals unchanged:", all(np.array_equal(np.sort(X[:, j]), np.sort(Y[:, j])) for j in range(3)))
```


    marginals unchanged: True


The achieved correlations, against the monograph's Table 8.3:


``` python
BOOK_83 = [(-0.271, -0.287), (0.003, 0.003), (0.772, 0.779)]  # (linear, rank)
table_83 = pd.DataFrame(
    [{"pair": name, "target": TARGET[i][j], "pearson": pe, "book_pearson": bp,
      "spearman": sp, "book_spearman": bs}
     for name, (i, j), (pe, sp), (bp, bs) in zip(NAMES, PAIRS, pairs(Y), BOOK_83)]
)
(GT(table_83, rowname_col="pair")
 .tab_header("Table 8.3: achieved correlation", "Of the reordered sample, against the target")
 .cols_label(pearson="Pearson", book_pearson="Pearson, book", spearman="Spearman",
             book_spearman="Spearman, book")
 .fmt_number(["target"], decimals=1)
 .fmt_number(["pearson", "book_pearson", "spearman", "book_spearman"], decimals=3))
```


<style>
#kwsmzdwrfc 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;
        }

#kwsmzdwrfc thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#kwsmzdwrfc p { margin: 0; padding: 0; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .gt_column_spanner_outer:first-child { padding-left: 0; }
 #kwsmzdwrfc .gt_column_spanner_outer:last-child { padding-right: 0; }
 #kwsmzdwrfc .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%; }
 #kwsmzdwrfc .gt_spanner_row { border-bottom-style: hidden; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .gt_from_md> :first-child { margin-top: 0; }
 #kwsmzdwrfc .gt_from_md> :last-child { margin-bottom: 0; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .gt_indent_1 { text-indent: 5px; }
 #kwsmzdwrfc .gt_indent_2 { text-indent: calc(5px * 2); }
 #kwsmzdwrfc .gt_indent_3 { text-indent: calc(5px * 3); }
 #kwsmzdwrfc .gt_indent_4 { text-indent: calc(5px * 4); }
 #kwsmzdwrfc .gt_indent_5 { text-indent: calc(5px * 5); }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .gt_row_group_first td { border-top-width: 2px; }
 #kwsmzdwrfc .gt_row_group_first th { border-top-width: 2px; }
 #kwsmzdwrfc .gt_striped { color: #333333; background-color: #F4F4F4; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #kwsmzdwrfc .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #kwsmzdwrfc .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #kwsmzdwrfc .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #kwsmzdwrfc .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #kwsmzdwrfc .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #kwsmzdwrfc .gt_left { text-align: left; }
 #kwsmzdwrfc .gt_center { text-align: center; }
 #kwsmzdwrfc .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #kwsmzdwrfc .gt_font_normal { font-weight: normal; }
 #kwsmzdwrfc .gt_font_bold { font-weight: bold; }
 #kwsmzdwrfc .gt_font_italic { font-style: italic; }
 #kwsmzdwrfc .gt_super { font-size: 65%; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #kwsmzdwrfc .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; }
 #kwsmzdwrfc .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #kwsmzdwrfc .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #kwsmzdwrfc .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="6" id="title" class="gt_heading gt_title gt_font_normal">Table 8.3: achieved correlation</th>
</tr>
<tr class="gt_heading">
<th colspan="6" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Of the reordered sample, against the target</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="target" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">target</th>
<th id="pearson" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Pearson</th>
<th id="book_pearson" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Pearson, book</th>
<th id="spearman" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Spearman</th>
<th id="book_spearman" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Spearman, book</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">Auto-GL</th>
<td class="gt_row gt_right" headers="stub-1 target">−0.3</td>
<td class="gt_row gt_right" headers="stub-1 pearson">−0.278</td>
<td class="gt_row gt_right" headers="stub-1 book_pearson">−0.271</td>
<td class="gt_row gt_right" headers="stub-1 spearman">−0.270</td>
<td class="gt_row gt_right" headers="stub-1 book_spearman">−0.287</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">Auto-Property</th>
<td class="gt_row gt_right" headers="stub-2 target">0.0</td>
<td class="gt_row gt_right" headers="stub-2 pearson">−0.002</td>
<td class="gt_row gt_right" headers="stub-2 book_pearson">0.003</td>
<td class="gt_row gt_right" headers="stub-2 spearman">0.003</td>
<td class="gt_row gt_right" headers="stub-2 book_spearman">0.003</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">GL-Property</th>
<td class="gt_row gt_right" headers="stub-3 target">0.8</td>
<td class="gt_row gt_right" headers="stub-3 pearson">0.773</td>
<td class="gt_row gt_right" headers="stub-3 book_pearson">0.772</td>
<td class="gt_row gt_right" headers="stub-3 spearman">0.784</td>
<td class="gt_row gt_right" headers="stub-3 book_spearman">0.779</td>
</tr>
</tbody>
</table>


As in the monograph, Auto-GL and GL-Property land a little inside the target. To see how far a sample of 1,000 moves the digits, repeat with 100 samples and shuffles:


``` python
runs = []
for s in range(100):
    draw = simulate(GaussianCopula(IDENTITY), grids, 1000, 1000 + s, keys=KEYS, dims=["unit"])
    runs.append(pairs(np.array(iman_conover(draw, TARGET, s).draw_matrix())))
runs = np.array(runs)  # run, pair, (Pearson, Spearman)

def flat(x):
    """Round to 3 places and turn -0.0 into 0.0."""
    return round(float(x), 3) + 0.0

spread_rows = []
for k, (name, (i, j)) in enumerate(zip(NAMES, PAIRS)):
    pe, sp = runs[:, k, 0], runs[:, k, 1]
    spread_rows.append({
        "pair": name, "p5": flat(np.quantile(pe, 0.05)), "pm": flat(pe.mean()), "p95": flat(np.quantile(pe, 0.95)),
        "s5": flat(np.quantile(sp, 0.05)), "sm": flat(sp.mean()), "s95": flat(np.quantile(sp, 0.95)),
        "gauss": flat(6 / np.pi * np.arcsin(TARGET[i][j] / 2)),
    })
(GT(pd.DataFrame(spread_rows), rowname_col="pair")
 .tab_header("Achieved correlation over 100 samples", "5%, mean and 95% quantiles; Gaussian Spearman = (6/pi) asin(r/2)")
 .cols_label(p5="Pearson 5%", pm="Pearson mean", p95="Pearson 95%", s5="Spearman 5%", sm="Spearman mean",
             s95="Spearman 95%", gauss="Gaussian Spearman")
 .fmt_number(["p5", "pm", "p95", "s5", "sm", "s95", "gauss"], decimals=3))
```


<style>
#mbcpdqkjkv 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;
        }

#mbcpdqkjkv thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#mbcpdqkjkv p { margin: 0; padding: 0; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .gt_column_spanner_outer:first-child { padding-left: 0; }
 #mbcpdqkjkv .gt_column_spanner_outer:last-child { padding-right: 0; }
 #mbcpdqkjkv .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%; }
 #mbcpdqkjkv .gt_spanner_row { border-bottom-style: hidden; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .gt_from_md> :first-child { margin-top: 0; }
 #mbcpdqkjkv .gt_from_md> :last-child { margin-bottom: 0; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .gt_indent_1 { text-indent: 5px; }
 #mbcpdqkjkv .gt_indent_2 { text-indent: calc(5px * 2); }
 #mbcpdqkjkv .gt_indent_3 { text-indent: calc(5px * 3); }
 #mbcpdqkjkv .gt_indent_4 { text-indent: calc(5px * 4); }
 #mbcpdqkjkv .gt_indent_5 { text-indent: calc(5px * 5); }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .gt_row_group_first td { border-top-width: 2px; }
 #mbcpdqkjkv .gt_row_group_first th { border-top-width: 2px; }
 #mbcpdqkjkv .gt_striped { color: #333333; background-color: #F4F4F4; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #mbcpdqkjkv .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #mbcpdqkjkv .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #mbcpdqkjkv .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #mbcpdqkjkv .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #mbcpdqkjkv .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #mbcpdqkjkv .gt_left { text-align: left; }
 #mbcpdqkjkv .gt_center { text-align: center; }
 #mbcpdqkjkv .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #mbcpdqkjkv .gt_font_normal { font-weight: normal; }
 #mbcpdqkjkv .gt_font_bold { font-weight: bold; }
 #mbcpdqkjkv .gt_font_italic { font-style: italic; }
 #mbcpdqkjkv .gt_super { font-size: 65%; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #mbcpdqkjkv .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; }
 #mbcpdqkjkv .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #mbcpdqkjkv .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #mbcpdqkjkv .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="8" id="title" class="gt_heading gt_title gt_font_normal">Achieved correlation over 100 samples</th>
</tr>
<tr class="gt_heading">
<th colspan="8" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">5%, mean and 95% quantiles; Gaussian Spearman = (6/pi) asin(r/2)</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="p5" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Pearson 5%</th>
<th id="pm" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Pearson mean</th>
<th id="p95" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Pearson 95%</th>
<th id="s5" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Spearman 5%</th>
<th id="sm" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Spearman mean</th>
<th id="s95" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Spearman 95%</th>
<th id="gauss" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Gaussian Spearman</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">Auto-GL</th>
<td class="gt_row gt_right" headers="stub-1 p5">−0.286</td>
<td class="gt_row gt_right" headers="stub-1 pm">−0.269</td>
<td class="gt_row gt_right" headers="stub-1 p95">−0.252</td>
<td class="gt_row gt_right" headers="stub-1 s5">−0.298</td>
<td class="gt_row gt_right" headers="stub-1 sm">−0.286</td>
<td class="gt_row gt_right" headers="stub-1 s95">−0.271</td>
<td class="gt_row gt_right" headers="stub-1 gauss">−0.288</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">Auto-Property</th>
<td class="gt_row gt_right" headers="stub-2 p5">−0.020</td>
<td class="gt_row gt_right" headers="stub-2 pm">0.000</td>
<td class="gt_row gt_right" headers="stub-2 p95">0.021</td>
<td class="gt_row gt_right" headers="stub-2 s5">−0.012</td>
<td class="gt_row gt_right" headers="stub-2 sm">0.000</td>
<td class="gt_row gt_right" headers="stub-2 s95">0.016</td>
<td class="gt_row gt_right" headers="stub-2 gauss">0.000</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">GL-Property</th>
<td class="gt_row gt_right" headers="stub-3 p5">0.752</td>
<td class="gt_row gt_right" headers="stub-3 pm">0.773</td>
<td class="gt_row gt_right" headers="stub-3 p95">0.791</td>
<td class="gt_row gt_right" headers="stub-3 s5">0.778</td>
<td class="gt_row gt_right" headers="stub-3 sm">0.787</td>
<td class="gt_row gt_right" headers="stub-3 s95">0.795</td>
<td class="gt_row gt_right" headers="stub-3 gauss">0.786</td>
</tr>
</tbody>
</table>


``` python
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
for k, name in enumerate(NAMES):
    i, j = PAIRS[k]
    ax.plot([TARGET[i][j]] * 2, [k - 0.3, k + 0.3], color="0.75", lw=3, label="target (Pearson)" if k == 0 else None)
    ax.plot([6 / np.pi * np.arcsin(TARGET[i][j] / 2)] * 2, [k - 0.3, k + 0.3], color="0.4", lw=1, ls="--",
            label="Gaussian Spearman of the target" if k == 0 else None)
    for off, kind, label in ((-0.1, 0, "Pearson"), (0.1, 1, "Spearman")):
        v = runs[:, k, kind]
        ax.hlines(k + off, np.quantile(v, 0.05), np.quantile(v, 0.95), color=f"C{kind}", lw=2,
                  label=label if k == 0 else None)
        ax.plot(v.mean(), k + off, "o", color=f"C{kind}")
ax.set_yticks(range(3), NAMES)
ax.invert_yaxis()
ax.set_xlabel("achieved correlation (mean and 90% range of 100 samples)")
ax.set_title("Achieved against target correlation")
ax.legend()
```


<figure class="p-figure figure">
Utd2lkdGg6IDAuOCIgLz4KICAgICAgPC9kZWZzPgogICAgICA8Zz4KICAgICAgIDx1c2UgaHJlZj0iI200MGEzMjAwZTY4IiB4PSI5MC40NTkyMTkiIHk9IjUyLjMyNTUxIiBzdHlsZT0iZmlsbDogdmFyKC0tcC1tdXRlZCk7IHN0cm9rZTogdmFyKC0tcC1tdXRlZCk7IHN0cm9rZS13aWR0aDogMC44IiAvPgogICAgICA8L2c+CiAgICAgPC9nPgogICAgIDxnIGlkPSJ0ZXh0XzgiPgogICAgICA8dGV4dCBzdHlsZT0iZm9udC1zaXplOiAxMXB4OyBmb250LWZhbWlseTogdmFyKC0tcC1mb250KTsgdGV4dC1hbmNob3I6IGVuZDsgZmlsbDogdmFyKC0tcC1tdXRlZCkiIHg9IjgzLjQ1OTIxOSIgeT0iNTYuNTA0MjIxIiB0cmFuc2Zvcm09InJvdGF0ZSgtMCA4My40NTkyMTkgNTYuNTA0MjIxKSI+QXV0by1HTDwvdGV4dD4KICAgICA8L2c+CiAgICA8L2c+CiAgICA8ZyBpZD0ieXRpY2tfMiI+CiAgICAgPGcgaWQ9ImxpbmUyZF8xNSI+CiAgICAgIDxwYXRoIGQ9Ik0gOTAuNDU5MjE5IDEyMi4xMTAxMjUgCkwgNDgxLjA1OTIxOSAxMjIuMTEwMTI1IAoiIGNsaXAtcGF0aD0idXJsKCNwZjBlODBmOGM3OCkiIHN0eWxlPSJmaWxsOiBub25lOyBzdHJva2U6IHZhcigtLXAtcnVsZSk7IHN0cm9rZS13aWR0aDogMC44OyBzdHJva2UtbGluZWNhcDogc3F1YXJlIiAvPgogICAgIDwvZz4KICAgICA8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NzcwMzEgODYuMjI4OTg0IAoiIHN0eWxlPSJmaWxsOiBub25lOyBzdHJva2U6IHZhcigtLXAtc2VyaWVzLTIpOyBzdHJva2Utd2lkdGg6IDIiIC8+CiAgICA8L2c+CiAgICA8ZyBpZD0idGV4dF8xNSI+CiAgICAgPHRleHQgc3R5bGU9ImZvbnQtc2l6ZTogMTFweDsgZm9udC1mYW1pbHk6IHZhcigtLXAtZm9udCk7IHRleHQtYW5jaG9yOiBzdGFydDsgZmlsbDogdmFyKC0tcC1pbmspIiB4PSIyODguMzc3MDMxIiB5PSI5MC4wNzg5ODQiIHRyYW5zZm9ybT0icm90YXRlKC0wIDI4OC4zNzcwMzEgOTAuMDc4OTg0KSI+U3BlYXJtYW48L3RleHQ+CiAgICA8L2c+CiAgIDwvZz4KICA8L2c+CiA8L2c+CiA8ZGVmcz4KICA8Y2xpcHBhdGggaWQ9InBmMGU4MGY4Yzc4Ij4KICAgPHJlY3QgeD0iOTAuNDU5MjE5IiB5PSIyMi4zMTgxMjUiIHdpZHRoPSIzOTAuNiIgaGVpZ2h0PSIxOTkuNTg0IiAvPgogIDwvY2xpcHBhdGg+CiA8L2RlZnM+Cjwvc3ZnPg==" />
</figure>


Every value of Table 8.3 is inside these 90% ranges. Two results are not sampling error:

- **The rank correlation is the Gaussian rank correlation of the target.** Iman-Conover copies the ranks of reference scores that have exactly the target correlation, so Spearman's rho is near `(6/pi) asin(r/2)`, the rank correlation of a bivariate normal with correlation [r](../reference/distributions.NegativeBinomial.md#prospicio.distributions.NegativeBinomial.r).
- **The linear correlation is less than the target.** Pearson's correlation depends on the marginals: skewed marginals cannot reach a high linear correlation even when their ranks agree. The maximum is the correlation of the two samples sorted together:


``` python
def bounds(a, b):
    """The largest and smallest Pearson correlation any pairing of a and b can have."""
    return np.corrcoef(np.sort(a), np.sort(b))[0, 1], np.corrcoef(np.sort(a), np.sort(b)[::-1])[0, 1]

hi, lo = bounds(X[:, 1], X[:, 2])
print(f"GL-Property: at most {hi:.3f}, at least {lo:.3f}")
hi, lo = bounds(X[:, 0], X[:, 1])
print(f"Auto-GL:     at most {hi:.3f}, at least {lo:.3f}")
```


    GL-Property: at most 0.997, at least -0.779
    Auto-GL:     at most 0.963, at least -0.890


So a request for a very high Pearson correlation can disappoint. Set the input a little above the output you need, or use the rank correlation, which Iman-Conover controls directly.


# 4. The output's row order

Item 6 of section 8.2.5 warns that some implementations return an Iman-Conover sample in a systematic row order. prospicio does: the first column of its reference holds the scores in increasing order, so the first unit comes out sorted:


``` python
print("Auto sorted ascending:", bool(np.all(np.diff(Y[:, 0]) >= 0)))
print(f"mean of the first 100 years: Auto {Y[:100, 0].mean():7.1f}  (all 1,000: {Y[:, 0].mean():7.1f})")
u = np.array(GaussianCopula(IDENTITY).sample(1000, 99))
shuffled = Y[np.argsort(u[:, 0])]
print(f"after a random row order:     Auto {shuffled[:100, 0].mean():7.1f}")
```


    Auto sorted ascending: True
    mean of the first 100 years: Auto  2965.4  (all 1,000:  4998.8)
    after a random row order:     Auto  4856.5


So the first 100 rows are not a random sample. Statistics over all rows (means, quantiles, a [Portfolio](../reference/pricing.Portfolio.md#prospicio.pricing.Portfolio) built from them) do not depend on the row order. Shuffle the rows, as above, before you take a subset or pair them with another simulation.


# 5. The algorithm by hand

Section 8.2.8 derives the method in four steps:

1.  Take [n](../reference/pricing.TrendFit.md#prospicio.pricing.TrendFit.n) scores with mean 0 and variance 1. The monograph prefers the evenly spaced normal quantiles `Phi^-1(i / (n + 1))`.
2.  Put an independently permuted copy of the scores in each of `m` columns to make [M](../reference/distributions.TemperedStable.md#prospicio.distributions.TemperedStable.M). Then `M'M / n` is close to the identity.
3.  Let `S = C'C` be the Cholesky factorization of the target, and `M'M / n = F'F` that of the actual correlation of [M](../reference/distributions.TemperedStable.md#prospicio.distributions.TemperedStable.M). Then `T = M F^-1 C` has correlation exactly `S`.
4.  Give each column of the input the rank order of the matching column of `T`.


``` python
from statistics import NormalDist

def iman_conover_by_hand(x, target, scores, seed):
    n, m = x.shape
    scores = (scores - scores.mean()) / np.sqrt(np.mean((scores - scores.mean()) ** 2))
    u = np.array(GaussianCopula(np.eye(m).tolist()).sample(n, seed))
    M = np.column_stack([scores[np.argsort(u[:, j])] for j in range(m)])
    F = np.linalg.cholesky(M.T @ M / n).T  # upper triangular, M'M/n = F'F
    C = np.linalg.cholesky(np.array(target)).T
    T = M @ np.linalg.inv(F) @ C
    out = np.column_stack([np.sort(x[:, j])[ranks(T[:, j])] for j in range(m)])
    return out, M, T

n = 1000
normal_scores = np.array([NormalDist().inv_cdf(i / (n + 1)) for i in range(1, n + 1)])
Z, M, T = iman_conover_by_hand(X, TARGET, normal_scores, 3)
print(f"largest error of M'M/n against the identity: {np.abs(M.T @ M / n - np.eye(3)).max():.3f}")
print("T'T/n equals the target to 1e-12:", bool(np.abs(T.T @ T / n - np.array(TARGET)).max() < 1e-12))
```


    largest error of M'M/n against the identity: 0.035
    T'T/n equals the target to 1e-12: True


The Spearman correlations of the by-hand result and of prospicio's:


``` python
by_hand = pd.DataFrame(
    {"pair": NAMES, "hand": [s for _, s in pairs(Z)], "lib": [s for _, s in pairs(Y)]}
)
(GT(by_hand, rowname_col="pair")
 .tab_header("Spearman correlation of the reordered sample", "By hand and by prospicio")
 .cols_label(hand="by hand", lib="prospicio")
 .fmt_number(["hand", "lib"], decimals=3))
```


<style>
#ltludfdyzg 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;
        }

#ltludfdyzg thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#ltludfdyzg p { margin: 0; padding: 0; }
 #ltludfdyzg .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; }
 #ltludfdyzg .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #ltludfdyzg .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; }
 #ltludfdyzg .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; }
 #ltludfdyzg .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; }
 #ltludfdyzg .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #ltludfdyzg .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; }
 #ltludfdyzg .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; }
 #ltludfdyzg .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; }
 #ltludfdyzg .gt_column_spanner_outer:first-child { padding-left: 0; }
 #ltludfdyzg .gt_column_spanner_outer:last-child { padding-right: 0; }
 #ltludfdyzg .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%; }
 #ltludfdyzg .gt_spanner_row { border-bottom-style: hidden; }
 #ltludfdyzg .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; }
 #ltludfdyzg .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; }
 #ltludfdyzg .gt_from_md> :first-child { margin-top: 0; }
 #ltludfdyzg .gt_from_md> :last-child { margin-bottom: 0; }
 #ltludfdyzg .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; }
 #ltludfdyzg .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; }
 #ltludfdyzg .gt_indent_1 { text-indent: 5px; }
 #ltludfdyzg .gt_indent_2 { text-indent: calc(5px * 2); }
 #ltludfdyzg .gt_indent_3 { text-indent: calc(5px * 3); }
 #ltludfdyzg .gt_indent_4 { text-indent: calc(5px * 4); }
 #ltludfdyzg .gt_indent_5 { text-indent: calc(5px * 5); }
 #ltludfdyzg .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; }
 #ltludfdyzg .gt_row_group_first td { border-top-width: 2px; }
 #ltludfdyzg .gt_row_group_first th { border-top-width: 2px; }
 #ltludfdyzg .gt_striped { color: #333333; background-color: #F4F4F4; }
 #ltludfdyzg .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; }
 #ltludfdyzg .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #ltludfdyzg .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #ltludfdyzg .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #ltludfdyzg .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #ltludfdyzg .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #ltludfdyzg .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #ltludfdyzg .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; }
 #ltludfdyzg .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #ltludfdyzg .gt_left { text-align: left; }
 #ltludfdyzg .gt_center { text-align: center; }
 #ltludfdyzg .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #ltludfdyzg .gt_font_normal { font-weight: normal; }
 #ltludfdyzg .gt_font_bold { font-weight: bold; }
 #ltludfdyzg .gt_font_italic { font-style: italic; }
 #ltludfdyzg .gt_super { font-size: 65%; }
 #ltludfdyzg .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; }
 #ltludfdyzg .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #ltludfdyzg .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; }
 #ltludfdyzg .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #ltludfdyzg .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #ltludfdyzg .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="3" id="title" class="gt_heading gt_title gt_font_normal">Spearman correlation of the reordered sample</th>
</tr>
<tr class="gt_heading">
<th colspan="3" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">By hand and by prospicio</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="hand" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">by hand</th>
<th id="lib" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">prospicio</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">Auto-GL</th>
<td class="gt_row gt_right" headers="stub-1 hand">−0.281</td>
<td class="gt_row gt_right" headers="stub-1 lib">−0.270</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">Auto-Property</th>
<td class="gt_row gt_right" headers="stub-2 hand">−0.002</td>
<td class="gt_row gt_right" headers="stub-2 lib">0.003</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">GL-Property</th>
<td class="gt_row gt_right" headers="stub-3 hand">0.788</td>
<td class="gt_row gt_right" headers="stub-3 lib">0.784</td>
</tr>
</tbody>
</table>


The `F^-1` step removes the few hundredths of error that the permutations leave in the correlation of [M](../reference/distributions.TemperedStable.md#prospicio.distributions.TemperedStable.M). The results differ because the permutations differ.


# 6. Other reference distributions and copulas

Section 8.2.3 replaces the normal scores with Student t scores, which put more weight on joint extremes. `iman_conover_by_hand` takes any scores. The monograph's extreme example is t with 2 degrees of freedom, with quantile `(2u - 1) / sqrt(2 u (1 - u))`. Count the years in which GL and Property are both in their worst 1%, out of 10,000, under each reference:


``` python
n = 10_000
draws = np.array(simulate(GaussianCopula(IDENTITY), grids, n, 4, keys=KEYS, dims=["unit"]).draw_matrix())
uu = np.arange(1, n + 1) / (n + 1)
SCORES = {
    "normal": np.array([NormalDist().inv_cdf(v) for v in uu]),
    "t, 2 dof": (2 * uu - 1) / np.sqrt(2 * uu * (1 - uu)),
}
for name, scores in SCORES.items():
    Z, _, _ = iman_conover_by_hand(draws, TARGET, scores, 5)
    worst = (ranks(Z[:, 1]) >= 0.99 * n) & (ranks(Z[:, 2]) >= 0.99 * n)
    print(f"{name:9s} GL-Property Spearman {pairs(Z)[2][1]:.3f}, years in both worst 1%: {worst.sum()}")
print("if independent, about", n // 10_000)
```


    normal    GL-Property Spearman 0.787, years in both worst 1%: 34
    t, 2 dof  GL-Property Spearman 0.714, years in both worst 1%: 68
    if independent, about 1


With t scores the joint extremes are about twice as frequent although the rank correlation is lower (the pinched scatter of Figure 8.3). The monograph warns that this flexibility is not a reason to use it.

Section 8.2.4 asks if a copula can be the reference. A multivariate Archimedean copula has a single parameter and cannot match a correlation matrix. Instead, simulate directly with a prospicio copula ([simulate](../reference/risk.simulate.md#prospicio.risk.simulate) with a [GaussianCopula](../reference/risk.GaussianCopula.md#prospicio.risk.GaussianCopula), [StudentTCopula](../reference/risk.StudentTCopula.md#prospicio.risk.StudentTCopula), [ArchimedeanCopula](../reference/risk.ArchimedeanCopula.md#prospicio.risk.ArchimedeanCopula), `NestedArchimedeanCopula` or `VineCopula`). Nested Archimedean copulas and vines avoid the single parameter: a vine uses one bivariate copula per edge, so each pair has its own strength and tail.


# 7. Iman-Conover against the normal copula

The normal copula method (section 8.2.5) draws correlated normals and maps each to its unit's distribution through the quantile function. With normal scores, Iman-Conover does the same to an existing sample and corrects the reference to the exact correlation. Both methods, 100 times on the same units:


``` python
normal_copula = GaussianCopula(TARGET)
spread = {"Iman-Conover": [], "normal copula": []}
for s in range(100):
    draw = simulate(GaussianCopula(IDENTITY), grids, 1000, 3000 + s, keys=KEYS, dims=["unit"])
    spread["Iman-Conover"].append(pairs(np.array(iman_conover(draw, TARGET, s).draw_matrix()))[2][1])
    copula_draw = simulate(normal_copula, grids, 1000, 5000 + s, keys=KEYS, dims=["unit"])
    spread["normal copula"].append(pairs(np.array(copula_draw.draw_matrix()))[2][1])
for name, values in spread.items():
    print(f"{name:14s} GL-Property Spearman: mean {np.mean(values):.3f}, sd {np.std(values):.4f}")
```


    Iman-Conover   GL-Property Spearman: mean 0.787, sd 0.0052
    normal copula  GL-Property Spearman: mean 0.787, sd 0.0142


``` python
fig, ax = plt.subplots()
bins = np.linspace(0.74, 0.83, 28)
for name, values in spread.items():
    ax.hist(values, bins=bins, alpha=0.6, label=name)
ax.axvline(6 / np.pi * np.arcsin(0.4), color="0.75", lw=2)
ax.set_xlabel("GL-Property Spearman correlation of one sample (grey line: 0.786)")
ax.set_ylabel("samples out of 100")
ax.set_title("Iman-Conover varies less than the normal copula")
ax.legend()
```


<figure class="p-figure figure">
<img src="data:image/svg+xml;base64,PHN2ZyB4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjQ0MC45OTgzNTlwdCIgaGVpZ2h0PSIyNjIuMTAyOTg0cHQiIHZpZXdib3g9IjAgMCA0NDAuOTk4MzU5IDI2Mi4xMDI5ODQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIj4KIDxtZXRhZGF0YT4KICA8cmRmIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgPHdvcms+CiAgICA8dHlwZSByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIj48L3R5cGU+CiAgICA8ZGF0ZT4yMDI2LTExLTI5VDE3OjIxOjExLjM1ODM3OTwvZGF0ZT4KICAgIDxmb3JtYXQ+aW1hZ2Uvc3ZnK3htbDwvZm9ybWF0PgogICAgPGNyZWF0b3I+CiAgICAgPGFnZW50PgogICAgICA8dGl0bGU+TWF0cGxvdGxpYiB2My4xMS4yLCBodHRwczovL21hdHBsb3RsaWIub3JnLzwvdGl0bGU+CiAgICAgPC9hZ2VudD4KICAgIDwvY3JlYXRvcj4KICAgPC93b3JrPgogIDwvcmRmPgogPC9tZXRhZGF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Y2IAp6CiIgc3R5bGU9ImZpbGw6IHZhcigtLXAtc2VyaWVzLTIpOyBvcGFjaXR5OiAwLjYiIC8+CiAgICA8L2c+CiAgICA8ZyBpZD0idGV4dF8xNiI+CiAgICAgPHRleHQgc3R5bGU9ImZvbnQtc2l6ZTogMTFweDsgZm9udC1mYW1pbHk6IHZhcigtLXAtZm9udCk7IHRleHQtYW5jaG9yOiBzdGFydDsgZmlsbDogdmFyKC0tcC1pbmspIiB4PSIzNDUuMzI5MTQxIiB5PSI1Ny4wNzcyNjYiIHRyYW5zZm9ybT0icm90YXRlKC0wIDM0NS4zMjkxNDEgNTcuMDc3MjY2KSI+bm9ybWFsIGNvcHVsYTwvdGV4dD4KICAgIDwvZz4KICAgPC9nPgogIDwvZz4KIDwvZz4KIDxkZWZzPgogIDxjbGlwcGF0aCBpZD0icDIwYTVhODc5MWYiPgogICA8cmVjdCB4PSI0My4xOTgzNTkiIHk9IjIyLjMxODEyNSIgd2lkdGg9IjM5MC42IiBoZWlnaHQ9IjE5OS41ODQiIC8+CiAgPC9jbGlwcGF0aD4KIDwvZGVmcz4KPC9zdmc+" />
</figure>


Both methods centre on 0.786, the Gaussian rank correlation. Iman-Conover varies much less, because only the small gap between the rank and linear correlations of the normal reference remains. But the normal copula makes each year independently, so you can split, subset or extend its output freely. An Iman-Conover sample is made in one piece and needs the care of section 4.


# 8. Example 2: block Iman-Conover

A large correlation matrix estimated from data is mostly noise. Block Iman-Conover (section 8.2.6) uses the correlations that data can estimate: between lines within each region, and between the region totals.

Example 2 (section 8.2.7) has four regions, each with Auto (AL), GL and Property (Pr). Each line has the model of Example 1, except that the GL severity CV is 4. The first step computes the region totals with independent lines, by FFT (Table 8.4):


``` python
from prospicio.pricing import Portfolio

LINES = {"AL": (2000, 30, 2, 0.2), "GL": (5000, 50, 4, 0.3), "Pr": (10000, 100, 5, 0.1)}
REGIONS = {"North": (4000, 2000, 2000), "East": (3000, 1000, 3000),
           "South": (5000, 2000, 7000), "West": (5000, 2000, 2000)}
BOOK_84 = {"North": (8000, 0.298, 16237), "East": (7000, 0.347, 15920),
           "South": (14000, 0.266, 25737), "West": (9000, 0.276, 17331)}
region_grids = {r: [unit(loss, *LINES[line]) for loss, line in zip(losses, LINES)]
                for r, losses in REGIONS.items()}
rows = []
for r, gs in region_grids.items():
    total = Portfolio.from_independent(list(LINES), gs)
    xs, ps = np.array(total.totals), np.array(total.probs)
    mean = (xs * ps).sum()
    cv = np.sqrt(((xs - mean) ** 2 * ps).sum()) / mean
    rows.append({"region": r, "mean": mean, "cv": cv, "p99": total.assets(0.99), "book_mean": BOOK_84[r][0],
                 "book_cv": BOOK_84[r][1], "book_p99": BOOK_84[r][2]})
(GT(pd.DataFrame(rows), rowname_col="region")
 .tab_header("Table 8.4: region totals with independent lines", "Annual loss")
 .cols_label(p99="99th pct", book_mean="book mean", book_cv="book cv", book_p99="book 99th pct")
 .fmt_number(["mean"], decimals=1, use_seps=False)
 .fmt_number(["cv", "book_cv"], decimals=3)
 .fmt_number(["p99", "book_p99", "book_mean"], decimals=0, use_seps=False))
```


<style>
#gnungnohfr 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;
        }

#gnungnohfr thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#gnungnohfr p { margin: 0; padding: 0; }
 #gnungnohfr .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; }
 #gnungnohfr .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #gnungnohfr .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; }
 #gnungnohfr .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; }
 #gnungnohfr .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; }
 #gnungnohfr .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #gnungnohfr .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; }
 #gnungnohfr .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; }
 #gnungnohfr .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; }
 #gnungnohfr .gt_column_spanner_outer:first-child { padding-left: 0; }
 #gnungnohfr .gt_column_spanner_outer:last-child { padding-right: 0; }
 #gnungnohfr .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%; }
 #gnungnohfr .gt_spanner_row { border-bottom-style: hidden; }
 #gnungnohfr .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; }
 #gnungnohfr .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; }
 #gnungnohfr .gt_from_md> :first-child { margin-top: 0; }
 #gnungnohfr .gt_from_md> :last-child { margin-bottom: 0; }
 #gnungnohfr .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; }
 #gnungnohfr .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; }
 #gnungnohfr .gt_indent_1 { text-indent: 5px; }
 #gnungnohfr .gt_indent_2 { text-indent: calc(5px * 2); }
 #gnungnohfr .gt_indent_3 { text-indent: calc(5px * 3); }
 #gnungnohfr .gt_indent_4 { text-indent: calc(5px * 4); }
 #gnungnohfr .gt_indent_5 { text-indent: calc(5px * 5); }
 #gnungnohfr .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; }
 #gnungnohfr .gt_row_group_first td { border-top-width: 2px; }
 #gnungnohfr .gt_row_group_first th { border-top-width: 2px; }
 #gnungnohfr .gt_striped { color: #333333; background-color: #F4F4F4; }
 #gnungnohfr .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; }
 #gnungnohfr .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #gnungnohfr .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #gnungnohfr .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #gnungnohfr .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #gnungnohfr .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #gnungnohfr .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #gnungnohfr .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; }
 #gnungnohfr .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #gnungnohfr .gt_left { text-align: left; }
 #gnungnohfr .gt_center { text-align: center; }
 #gnungnohfr .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #gnungnohfr .gt_font_normal { font-weight: normal; }
 #gnungnohfr .gt_font_bold { font-weight: bold; }
 #gnungnohfr .gt_font_italic { font-style: italic; }
 #gnungnohfr .gt_super { font-size: 65%; }
 #gnungnohfr .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; }
 #gnungnohfr .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #gnungnohfr .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; }
 #gnungnohfr .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #gnungnohfr .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #gnungnohfr .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="7" id="title" class="gt_heading gt_title gt_font_normal">Table 8.4: region totals with independent lines</th>
</tr>
<tr class="gt_heading">
<th colspan="7" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Annual loss</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="mean" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">mean</th>
<th id="cv" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">cv</th>
<th id="p99" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">99th pct</th>
<th id="book_mean" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book mean</th>
<th id="book_cv" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book cv</th>
<th id="book_p99" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book 99th pct</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">North</th>
<td class="gt_row gt_right" headers="stub-1 mean">8000.0</td>
<td class="gt_row gt_right" headers="stub-1 cv">0.298</td>
<td class="gt_row gt_right" headers="stub-1 p99">16236</td>
<td class="gt_row gt_right" headers="stub-1 book_mean">8000</td>
<td class="gt_row gt_right" headers="stub-1 book_cv">0.298</td>
<td class="gt_row gt_right" headers="stub-1 book_p99">16237</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">East</th>
<td class="gt_row gt_right" headers="stub-2 mean">7000.0</td>
<td class="gt_row gt_right" headers="stub-2 cv">0.347</td>
<td class="gt_row gt_right" headers="stub-2 p99">15920</td>
<td class="gt_row gt_right" headers="stub-2 book_mean">7000</td>
<td class="gt_row gt_right" headers="stub-2 book_cv">0.347</td>
<td class="gt_row gt_right" headers="stub-2 book_p99">15920</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">South</th>
<td class="gt_row gt_right" headers="stub-3 mean">14000.0</td>
<td class="gt_row gt_right" headers="stub-3 cv">0.266</td>
<td class="gt_row gt_right" headers="stub-3 p99">25737</td>
<td class="gt_row gt_right" headers="stub-3 book_mean">14000</td>
<td class="gt_row gt_right" headers="stub-3 book_cv">0.266</td>
<td class="gt_row gt_right" headers="stub-3 book_p99">25737</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">West</th>
<td class="gt_row gt_right" headers="stub-4 mean">9000.0</td>
<td class="gt_row gt_right" headers="stub-4 cv">0.276</td>
<td class="gt_row gt_right" headers="stub-4 p99">17330</td>
<td class="gt_row gt_right" headers="stub-4 book_mean">9000</td>
<td class="gt_row gt_right" headers="stub-4 book_cv">0.276</td>
<td class="gt_row gt_right" headers="stub-4 book_p99">17331</td>
</tr>
</tbody>
</table>


The means and CVs agree to the printed digits. The 99th percentiles differ by at most 1.5 in 16,000 to 26,000, from the discretization step: a step of 0.5 gives 16,236.5, 15,920.5, 25,737 and 17,329.5.

The block method has three steps:

1.  Correlate the lines within each region by ordinary Iman-Conover. Here every region has the same 3 x 3 matrix (Table 8.6 (e)), but each region can have its own matrix.
2.  Stack the regions into one [PredictiveDistribution](../reference/distributions.PredictiveDistribution.md#prospicio.distributions.PredictiveDistribution) with a `region` dimension.
3.  Correlate the region totals: move the years of each region as whole rows, which keeps the structure within the region.

[reorder_groups](../reference/distributions.PredictiveDistribution.md#prospicio.distributions.PredictiveDistribution.reorder_groups) does the last step:


``` python
INTRA = [[1.0, 0.6, 0.2], [0.6, 1.0, 0.4], [0.2, 0.4, 1.0]]
INTER = [[1.0, 0.7, 0.2, 0.0], [0.7, 1.0, 0.4, 0.2], [0.2, 0.4, 1.0, 0.8], [0.0, 0.2, 0.8, 1.0]]
parts = []
for k, (r, gs) in enumerate(region_grids.items()):
    draw = simulate(GaussianCopula(IDENTITY), gs, 1000, 100 + k,
                    keys=[(line,) for line in LINES], dims=["line"])
    parts.append((r, iman_conover(draw, INTRA, k)))
stacked = PredictiveDistribution.join(parts, "region")
bic = stacked.reorder_groups("region", INTER, 7)
print(bic.dims, bic.components()[:4], "...")
```


    ['region', 'line'] [('North', 'AL'), ('North', 'GL'), ('North', 'Pr'), ('East', 'AL')] ...


The correlations between the region totals (Table 8.5):


``` python
B = np.array(bic.draw_matrix())
totals = B.reshape(1000, 4, 3).sum(axis=2)
achieved = np.corrcoef(totals.T)
BOOK_85 = {(0, 1): 0.683, (0, 2): 0.167, (0, 3): -0.002, (1, 2): 0.369, (1, 3): 0.197, (2, 3): 0.799}
names = list(REGIONS)
table_85 = pd.DataFrame(
    [{"pair": f"{names[i]}-{names[j]}", "target": INTER[i][j], "achieved": achieved[i, j], "book": book}
     for (i, j), book in BOOK_85.items()]
)
(GT(table_85, rowname_col="pair")
 .tab_header("Table 8.5: correlation of the region totals", "Target, achieved and the monograph's sample")
 .fmt_number(["target"], decimals=1)
 .fmt_number(["achieved", "book"], decimals=3))
```


<style>
#zagdjiogze 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;
        }

#zagdjiogze thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#zagdjiogze p { margin: 0; padding: 0; }
 #zagdjiogze .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; }
 #zagdjiogze .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #zagdjiogze .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; }
 #zagdjiogze .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; }
 #zagdjiogze .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; }
 #zagdjiogze .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #zagdjiogze .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; }
 #zagdjiogze .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; }
 #zagdjiogze .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; }
 #zagdjiogze .gt_column_spanner_outer:first-child { padding-left: 0; }
 #zagdjiogze .gt_column_spanner_outer:last-child { padding-right: 0; }
 #zagdjiogze .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%; }
 #zagdjiogze .gt_spanner_row { border-bottom-style: hidden; }
 #zagdjiogze .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; }
 #zagdjiogze .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; }
 #zagdjiogze .gt_from_md> :first-child { margin-top: 0; }
 #zagdjiogze .gt_from_md> :last-child { margin-bottom: 0; }
 #zagdjiogze .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; }
 #zagdjiogze .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; }
 #zagdjiogze .gt_indent_1 { text-indent: 5px; }
 #zagdjiogze .gt_indent_2 { text-indent: calc(5px * 2); }
 #zagdjiogze .gt_indent_3 { text-indent: calc(5px * 3); }
 #zagdjiogze .gt_indent_4 { text-indent: calc(5px * 4); }
 #zagdjiogze .gt_indent_5 { text-indent: calc(5px * 5); }
 #zagdjiogze .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; }
 #zagdjiogze .gt_row_group_first td { border-top-width: 2px; }
 #zagdjiogze .gt_row_group_first th { border-top-width: 2px; }
 #zagdjiogze .gt_striped { color: #333333; background-color: #F4F4F4; }
 #zagdjiogze .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; }
 #zagdjiogze .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #zagdjiogze .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #zagdjiogze .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #zagdjiogze .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #zagdjiogze .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #zagdjiogze .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #zagdjiogze .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; }
 #zagdjiogze .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #zagdjiogze .gt_left { text-align: left; }
 #zagdjiogze .gt_center { text-align: center; }
 #zagdjiogze .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #zagdjiogze .gt_font_normal { font-weight: normal; }
 #zagdjiogze .gt_font_bold { font-weight: bold; }
 #zagdjiogze .gt_font_italic { font-style: italic; }
 #zagdjiogze .gt_super { font-size: 65%; }
 #zagdjiogze .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; }
 #zagdjiogze .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #zagdjiogze .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; }
 #zagdjiogze .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #zagdjiogze .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #zagdjiogze .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">Table 8.5: correlation of the region totals</th>
</tr>
<tr class="gt_heading">
<th colspan="4" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Target, achieved and the monograph's sample</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="target" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">target</th>
<th id="achieved" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">achieved</th>
<th id="book" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">North-East</th>
<td class="gt_row gt_right" headers="stub-1 target">0.7</td>
<td class="gt_row gt_right" headers="stub-1 achieved">0.684</td>
<td class="gt_row gt_right" headers="stub-1 book">0.683</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">North-South</th>
<td class="gt_row gt_right" headers="stub-2 target">0.2</td>
<td class="gt_row gt_right" headers="stub-2 achieved">0.199</td>
<td class="gt_row gt_right" headers="stub-2 book">0.167</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">North-West</th>
<td class="gt_row gt_right" headers="stub-3 target">0.0</td>
<td class="gt_row gt_right" headers="stub-3 achieved">0.004</td>
<td class="gt_row gt_right" headers="stub-3 book">−0.002</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">East-South</th>
<td class="gt_row gt_right" headers="stub-4 target">0.4</td>
<td class="gt_row gt_right" headers="stub-4 achieved">0.376</td>
<td class="gt_row gt_right" headers="stub-4 book">0.369</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">East-West</th>
<td class="gt_row gt_right" headers="stub-5 target">0.2</td>
<td class="gt_row gt_right" headers="stub-5 achieved">0.187</td>
<td class="gt_row gt_right" headers="stub-5 book">0.197</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">South-West</th>
<td class="gt_row gt_right" headers="stub-6 target">0.8</td>
<td class="gt_row gt_right" headers="stub-6 achieved">0.786</td>
<td class="gt_row gt_right" headers="stub-6 book">0.799</td>
</tr>
</tbody>
</table>


These are close to the target and to the monograph's values. Within a region the lines keep the first step's correlation, because the reordering moves the three lines together (Table 8.6):


``` python
C12 = np.corrcoef(B.T)
BOOK_86 = {"North": (0.579, 0.180, 0.332), "East": (0.544, 0.191, 0.318),
           "South": (0.571, 0.202, 0.354), "West": (0.580, 0.176, 0.330)}
rows = []
for k, r in enumerate(names):
    block = C12[3 * k:3 * k + 3, 3 * k:3 * k + 3]
    rows.append({"region": r, "al_gl": block[0, 1], "al_pr": block[0, 2], "gl_pr": block[1, 2],
                 "b_al_gl": BOOK_86[r][0], "b_al_pr": BOOK_86[r][1], "b_gl_pr": BOOK_86[r][2]})
(GT(pd.DataFrame(rows), rowname_col="region")
 .tab_header("Table 8.6: correlation between lines within a region", "The target is 0.6, 0.2 and 0.4")
 .cols_label(al_gl="AL-GL", al_pr="AL-Pr", gl_pr="GL-Pr", b_al_gl="AL-GL, book", b_al_pr="AL-Pr, book",
             b_gl_pr="GL-Pr, book")
 .fmt_number(["al_gl", "al_pr", "gl_pr", "b_al_gl", "b_al_pr", "b_gl_pr"], decimals=3))
```


<style>
#pgvsksdlxl 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;
        }

#pgvsksdlxl thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#pgvsksdlxl p { margin: 0; padding: 0; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .gt_column_spanner_outer:first-child { padding-left: 0; }
 #pgvsksdlxl .gt_column_spanner_outer:last-child { padding-right: 0; }
 #pgvsksdlxl .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%; }
 #pgvsksdlxl .gt_spanner_row { border-bottom-style: hidden; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .gt_from_md> :first-child { margin-top: 0; }
 #pgvsksdlxl .gt_from_md> :last-child { margin-bottom: 0; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .gt_indent_1 { text-indent: 5px; }
 #pgvsksdlxl .gt_indent_2 { text-indent: calc(5px * 2); }
 #pgvsksdlxl .gt_indent_3 { text-indent: calc(5px * 3); }
 #pgvsksdlxl .gt_indent_4 { text-indent: calc(5px * 4); }
 #pgvsksdlxl .gt_indent_5 { text-indent: calc(5px * 5); }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .gt_row_group_first td { border-top-width: 2px; }
 #pgvsksdlxl .gt_row_group_first th { border-top-width: 2px; }
 #pgvsksdlxl .gt_striped { color: #333333; background-color: #F4F4F4; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #pgvsksdlxl .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #pgvsksdlxl .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #pgvsksdlxl .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #pgvsksdlxl .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #pgvsksdlxl .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #pgvsksdlxl .gt_left { text-align: left; }
 #pgvsksdlxl .gt_center { text-align: center; }
 #pgvsksdlxl .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #pgvsksdlxl .gt_font_normal { font-weight: normal; }
 #pgvsksdlxl .gt_font_bold { font-weight: bold; }
 #pgvsksdlxl .gt_font_italic { font-style: italic; }
 #pgvsksdlxl .gt_super { font-size: 65%; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #pgvsksdlxl .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; }
 #pgvsksdlxl .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #pgvsksdlxl .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #pgvsksdlxl .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="7" id="title" class="gt_heading gt_title gt_font_normal">Table 8.6: correlation between lines within a region</th>
</tr>
<tr class="gt_heading">
<th colspan="7" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">The target is 0.6, 0.2 and 0.4</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="al_gl" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">AL-GL</th>
<th id="al_pr" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">AL-Pr</th>
<th id="gl_pr" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">GL-Pr</th>
<th id="b_al_gl" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">AL-GL, book</th>
<th id="b_al_pr" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">AL-Pr, book</th>
<th id="b_gl_pr" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">GL-Pr, book</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">North</th>
<td class="gt_row gt_right" headers="stub-1 al_gl">0.567</td>
<td class="gt_row gt_right" headers="stub-1 al_pr">0.165</td>
<td class="gt_row gt_right" headers="stub-1 gl_pr">0.299</td>
<td class="gt_row gt_right" headers="stub-1 b_al_gl">0.579</td>
<td class="gt_row gt_right" headers="stub-1 b_al_pr">0.180</td>
<td class="gt_row gt_right" headers="stub-1 b_gl_pr">0.332</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">East</th>
<td class="gt_row gt_right" headers="stub-2 al_gl">0.512</td>
<td class="gt_row gt_right" headers="stub-2 al_pr">0.192</td>
<td class="gt_row gt_right" headers="stub-2 gl_pr">0.331</td>
<td class="gt_row gt_right" headers="stub-2 b_al_gl">0.544</td>
<td class="gt_row gt_right" headers="stub-2 b_al_pr">0.191</td>
<td class="gt_row gt_right" headers="stub-2 b_gl_pr">0.318</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">South</th>
<td class="gt_row gt_right" headers="stub-3 al_gl">0.576</td>
<td class="gt_row gt_right" headers="stub-3 al_pr">0.213</td>
<td class="gt_row gt_right" headers="stub-3 gl_pr">0.385</td>
<td class="gt_row gt_right" headers="stub-3 b_al_gl">0.571</td>
<td class="gt_row gt_right" headers="stub-3 b_al_pr">0.202</td>
<td class="gt_row gt_right" headers="stub-3 b_gl_pr">0.354</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">West</th>
<td class="gt_row gt_right" headers="stub-4 al_gl">0.557</td>
<td class="gt_row gt_right" headers="stub-4 al_pr">0.173</td>
<td class="gt_row gt_right" headers="stub-4 gl_pr">0.317</td>
<td class="gt_row gt_right" headers="stub-4 b_al_gl">0.580</td>
<td class="gt_row gt_right" headers="stub-4 b_al_pr">0.176</td>
<td class="gt_row gt_right" headers="stub-4 b_gl_pr">0.330</td>
</tr>
</tbody>
</table>


The full 12 x 12 matrix (Table 8.7) has the block structure of Figure 8.4. Here is the North AL row against the lines of the other regions:


``` python
BOOK_87 = [0.32, 0.29, 0.42, 0.07, 0.04, 0.12, -0.01, -0.07, 0.01]
table_87 = pd.DataFrame(
    {"line": [f"{r} {line}" for r in names[1:] for line in LINES], "mine": C12[0, 3:], "book": BOOK_87}
)
(GT(table_87, rowname_col="line")
 .tab_header("Table 8.7: North AL with the lines of the other regions", "Correlation of annual loss")
 .cols_label(mine="prospicio")
 .fmt_number(["mine", "book"], decimals=2))
```


<style>
#myeotqbhes 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;
        }

#myeotqbhes thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#myeotqbhes p { margin: 0; padding: 0; }
 #myeotqbhes .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; }
 #myeotqbhes .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #myeotqbhes .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; }
 #myeotqbhes .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; }
 #myeotqbhes .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; }
 #myeotqbhes .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #myeotqbhes .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; }
 #myeotqbhes .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; }
 #myeotqbhes .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; }
 #myeotqbhes .gt_column_spanner_outer:first-child { padding-left: 0; }
 #myeotqbhes .gt_column_spanner_outer:last-child { padding-right: 0; }
 #myeotqbhes .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%; }
 #myeotqbhes .gt_spanner_row { border-bottom-style: hidden; }
 #myeotqbhes .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; }
 #myeotqbhes .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; }
 #myeotqbhes .gt_from_md> :first-child { margin-top: 0; }
 #myeotqbhes .gt_from_md> :last-child { margin-bottom: 0; }
 #myeotqbhes .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; }
 #myeotqbhes .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; }
 #myeotqbhes .gt_indent_1 { text-indent: 5px; }
 #myeotqbhes .gt_indent_2 { text-indent: calc(5px * 2); }
 #myeotqbhes .gt_indent_3 { text-indent: calc(5px * 3); }
 #myeotqbhes .gt_indent_4 { text-indent: calc(5px * 4); }
 #myeotqbhes .gt_indent_5 { text-indent: calc(5px * 5); }
 #myeotqbhes .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; }
 #myeotqbhes .gt_row_group_first td { border-top-width: 2px; }
 #myeotqbhes .gt_row_group_first th { border-top-width: 2px; }
 #myeotqbhes .gt_striped { color: #333333; background-color: #F4F4F4; }
 #myeotqbhes .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; }
 #myeotqbhes .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #myeotqbhes .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #myeotqbhes .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #myeotqbhes .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #myeotqbhes .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #myeotqbhes .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #myeotqbhes .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; }
 #myeotqbhes .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #myeotqbhes .gt_left { text-align: left; }
 #myeotqbhes .gt_center { text-align: center; }
 #myeotqbhes .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #myeotqbhes .gt_font_normal { font-weight: normal; }
 #myeotqbhes .gt_font_bold { font-weight: bold; }
 #myeotqbhes .gt_font_italic { font-style: italic; }
 #myeotqbhes .gt_super { font-size: 65%; }
 #myeotqbhes .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; }
 #myeotqbhes .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #myeotqbhes .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; }
 #myeotqbhes .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #myeotqbhes .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #myeotqbhes .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="3" id="title" class="gt_heading gt_title gt_font_normal">Table 8.7: North AL with the lines of the other regions</th>
</tr>
<tr class="gt_heading">
<th colspan="3" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Correlation of annual loss</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="mine" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">prospicio</th>
<th id="book" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">East AL</th>
<td class="gt_row gt_right" headers="stub-1 mine">0.40</td>
<td class="gt_row gt_right" headers="stub-1 book">0.32</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">East GL</th>
<td class="gt_row gt_right" headers="stub-2 mine">0.33</td>
<td class="gt_row gt_right" headers="stub-2 book">0.29</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">East Pr</th>
<td class="gt_row gt_right" headers="stub-3 mine">0.40</td>
<td class="gt_row gt_right" headers="stub-3 book">0.42</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">South AL</th>
<td class="gt_row gt_right" headers="stub-4 mine">0.11</td>
<td class="gt_row gt_right" headers="stub-4 book">0.07</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">South GL</th>
<td class="gt_row gt_right" headers="stub-5 mine">0.14</td>
<td class="gt_row gt_right" headers="stub-5 book">0.04</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">South Pr</th>
<td class="gt_row gt_right" headers="stub-6 mine">0.12</td>
<td class="gt_row gt_right" headers="stub-6 book">0.12</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">West AL</th>
<td class="gt_row gt_right" headers="stub-7 mine">−0.04</td>
<td class="gt_row gt_right" headers="stub-7 book">−0.01</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">West GL</th>
<td class="gt_row gt_right" headers="stub-8 mine">0.01</td>
<td class="gt_row gt_right" headers="stub-8 book">−0.07</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">West Pr</th>
<td class="gt_row gt_right" headers="stub-9 mine">0.05</td>
<td class="gt_row gt_right" headers="stub-9 book">0.01</td>
</tr>
</tbody>
</table>


Lines in correlated regions are correlated across regions (North and East at 0.7); lines in uncorrelated regions (North and West) are not. Nine numbers set all 66 correlations.


# 9. Capital by layer, if you must

Section 8.3 returns to InsCo (ten equally likely years, three units) and its Wang distortion calibrated to a 15% return with assets of 100. The assets divide into layers between consecutive distinct totals. In a layer, [alpha](../reference/models.ElasticNet.md#prospicio.models.ElasticNet.alpha) is each unit's expected share of the total in the years that reach the layer, and [beta](../reference/risk.Gpd.md#prospicio.risk.Gpd.beta) shares the premium the same way under the distorted probabilities. The layer's margin is its premium less its loss, and its capital is the part of its width that premium does not fund. The cost of capital in a layer, `iota = (g(S) - S) / (1 - g(S))`, is the same for every unit, so a unit's capital there is its margin divided by `iota` (equation 8.5).


``` python
from prospicio.risk import Distortion

ROWS = [[15, 7, 0], [15, 13, 0], [5, 20, 11], [7, 33, 0], [13, 20, 7],
        [5, 27, 8], [15, 16, 9], [26, 19, 10], [17, 8, 40], [16, 20, 64]]
insco = Portfolio(["A", "B", "C"], ROWS)
wang = insco.calibrate("wang", assets=100, return_on_capital=0.15)

def layers(port, g):
    """Per layer: bottom, width, S, g(S), iota, and per unit alpha S, beta g(S),
    margin and capital, all per unit of width."""
    x, p = [0.0] + port.totals, port.probs
    share = {u: [k / t for k, t in zip(port.kappa(u), port.totals)] for u in port.units}
    S = [1.0] + [max(0.0, 1.0 - sum(p[:k])) for k in range(1, len(p) + 1)]
    G = [g.g(s) for s in S]
    q = [G[j] - G[j + 1] for j in range(len(p))]
    out = []
    for k in range(len(p)):
        aS = [sum(p[j] * share[u][j] for j in range(k, len(p))) for u in port.units]
        bG = [sum(q[j] * share[u][j] for j in range(k, len(p))) for u in port.units]
        margin = [b - a for a, b in zip(aS, bG)]
        iota = (G[k] - S[k]) / (1 - G[k]) if G[k] < 1 else None
        capital = [m / iota if iota else 0.0 for m in margin]
        out.append((x[k], x[k + 1] - x[k], S[k], G[k], iota, aS, bG, margin, capital))
    return out

wang_layers = pd.DataFrame(
    [
        {"layer": f"{x:.0f} to {x + dx:.0f}", "S": s, "gS": g, "iota": iota,
         **{f"margin {u}": m for u, m in zip("ABC", margin)},
         **{f"capital {u}": q for u, q in zip("ABC", capital)}}
        for x, dx, s, g, iota, _, _, margin, capital in layers(insco, wang)
    ]
)
(GT(wang_layers, rowname_col="layer")
 .tab_header("Table 8.10: InsCo's layers under the Wang distortion",
             "Margin and capital per unit of layer width; the bottom layer has no iota")
 .tab_spanner("margin", ["margin A", "margin B", "margin C"])
 .tab_spanner("capital", ["capital A", "capital B", "capital C"])
 .cols_label(gS="g(S)", **{f"{k} {u}": u for k in ("margin", "capital") for u in "ABC"})
 .fmt_number("S", decimals=1)
 .fmt_number(["gS", "iota", "margin A", "margin B", "margin C", "capital A", "capital B", "capital C"],
             decimals=3)
 .sub_missing(missing_text="-"))
```


<style>
#krbruzfpjf 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;
        }

#krbruzfpjf thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#krbruzfpjf p { margin: 0; padding: 0; }
 #krbruzfpjf .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; }
 #krbruzfpjf .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #krbruzfpjf .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; }
 #krbruzfpjf .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; }
 #krbruzfpjf .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; }
 #krbruzfpjf .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #krbruzfpjf .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; }
 #krbruzfpjf .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; }
 #krbruzfpjf .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; }
 #krbruzfpjf .gt_column_spanner_outer:first-child { padding-left: 0; }
 #krbruzfpjf .gt_column_spanner_outer:last-child { padding-right: 0; }
 #krbruzfpjf .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%; }
 #krbruzfpjf .gt_spanner_row { border-bottom-style: hidden; }
 #krbruzfpjf .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; }
 #krbruzfpjf .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; }
 #krbruzfpjf .gt_from_md> :first-child { margin-top: 0; }
 #krbruzfpjf .gt_from_md> :last-child { margin-bottom: 0; }
 #krbruzfpjf .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; }
 #krbruzfpjf .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; }
 #krbruzfpjf .gt_indent_1 { text-indent: 5px; }
 #krbruzfpjf .gt_indent_2 { text-indent: calc(5px * 2); }
 #krbruzfpjf .gt_indent_3 { text-indent: calc(5px * 3); }
 #krbruzfpjf .gt_indent_4 { text-indent: calc(5px * 4); }
 #krbruzfpjf .gt_indent_5 { text-indent: calc(5px * 5); }
 #krbruzfpjf .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; }
 #krbruzfpjf .gt_row_group_first td { border-top-width: 2px; }
 #krbruzfpjf .gt_row_group_first th { border-top-width: 2px; }
 #krbruzfpjf .gt_striped { color: #333333; background-color: #F4F4F4; }
 #krbruzfpjf .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; }
 #krbruzfpjf .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #krbruzfpjf .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #krbruzfpjf .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #krbruzfpjf .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #krbruzfpjf .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #krbruzfpjf .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #krbruzfpjf .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; }
 #krbruzfpjf .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #krbruzfpjf .gt_left { text-align: left; }
 #krbruzfpjf .gt_center { text-align: center; }
 #krbruzfpjf .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #krbruzfpjf .gt_font_normal { font-weight: normal; }
 #krbruzfpjf .gt_font_bold { font-weight: bold; }
 #krbruzfpjf .gt_font_italic { font-style: italic; }
 #krbruzfpjf .gt_super { font-size: 65%; }
 #krbruzfpjf .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; }
 #krbruzfpjf .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #krbruzfpjf .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; }
 #krbruzfpjf .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #krbruzfpjf .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #krbruzfpjf .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="10" id="title" class="gt_heading gt_title gt_font_normal">Table 8.10: InsCo's layers under the Wang distortion</th>
</tr>
<tr class="gt_heading">
<th colspan="10" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Margin and capital per unit of layer width; the bottom layer has no iota</th>
</tr>
<tr class="gt_col_headings gt_spanner_row">
<th rowspan="2" class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th rowspan="2" id="S" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">S</th>
<th rowspan="2" id="gS" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">g(S)</th>
<th rowspan="2" id="iota" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">iota</th>
<th colspan="3" id="margin" class="gt_center gt_columns_top_border gt_column_spanner_outer" scope="colgroup">margin</th>
<th colspan="3" id="capital" class="gt_center gt_columns_top_border gt_column_spanner_outer" scope="colgroup">capital</th>
</tr>
<tr class="gt_col_headings">
<th id="margin-A" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">A</th>
<th id="margin-B" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">B</th>
<th id="margin-C" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">C</th>
<th id="capital-A" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">A</th>
<th id="capital-B" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">B</th>
<th id="capital-C" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">C</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">0 to 22</th>
<td class="gt_row gt_right" headers="stub-1 S">1.0</td>
<td class="gt_row gt_right" headers="stub-1 gS">1.000</td>
<td class="gt_row gt_right" headers="stub-1 iota">-</td>
<td class="gt_row gt_right" headers="stub-1 margin margin-A">−0.030</td>
<td class="gt_row gt_right" headers="stub-1 margin margin-B">−0.032</td>
<td class="gt_row gt_right" headers="stub-1 margin margin-C">0.061</td>
<td class="gt_row gt_right" headers="stub-1 capital capital-A">0.000</td>
<td class="gt_row gt_right" headers="stub-1 capital capital-B">0.000</td>
<td class="gt_row gt_right" headers="stub-1 capital capital-C">0.000</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">22 to 28</th>
<td class="gt_row gt_right" headers="stub-2 S">0.9</td>
<td class="gt_row gt_right" headers="stub-2 gS">0.948</td>
<td class="gt_row gt_right" headers="stub-2 iota">0.917</td>
<td class="gt_row gt_right" headers="stub-2 margin margin-A">0.003</td>
<td class="gt_row gt_right" headers="stub-2 margin margin-B">−0.017</td>
<td class="gt_row gt_right" headers="stub-2 margin margin-C">0.061</td>
<td class="gt_row gt_right" headers="stub-2 capital capital-A">0.003</td>
<td class="gt_row gt_right" headers="stub-2 capital capital-B">−0.018</td>
<td class="gt_row gt_right" headers="stub-2 capital capital-C">0.067</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">28 to 36</th>
<td class="gt_row gt_right" headers="stub-3 S">0.8</td>
<td class="gt_row gt_right" headers="stub-3 gS">0.882</td>
<td class="gt_row gt_right" headers="stub-3 iota">0.693</td>
<td class="gt_row gt_right" headers="stub-3 margin margin-A">0.021</td>
<td class="gt_row gt_right" headers="stub-3 margin margin-B">−0.001</td>
<td class="gt_row gt_right" headers="stub-3 margin margin-C">0.061</td>
<td class="gt_row gt_right" headers="stub-3 capital capital-A">0.031</td>
<td class="gt_row gt_right" headers="stub-3 capital capital-B">−0.001</td>
<td class="gt_row gt_right" headers="stub-3 capital capital-C">0.089</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">36 to 40</th>
<td class="gt_row gt_right" headers="stub-4 S">0.7</td>
<td class="gt_row gt_right" headers="stub-4 gS">0.807</td>
<td class="gt_row gt_right" headers="stub-4 iota">0.555</td>
<td class="gt_row gt_right" headers="stub-4 margin margin-A">0.025</td>
<td class="gt_row gt_right" headers="stub-4 margin margin-B">0.013</td>
<td class="gt_row gt_right" headers="stub-4 margin margin-C">0.069</td>
<td class="gt_row gt_right" headers="stub-4 capital capital-A">0.045</td>
<td class="gt_row gt_right" headers="stub-4 capital capital-B">0.024</td>
<td class="gt_row gt_right" headers="stub-4 capital capital-C">0.125</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">40 to 55</th>
<td class="gt_row gt_right" headers="stub-5 S">0.3</td>
<td class="gt_row gt_right" headers="stub-5 gS">0.428</td>
<td class="gt_row gt_right" headers="stub-5 iota">0.224</td>
<td class="gt_row gt_right" headers="stub-5 margin margin-A">0.030</td>
<td class="gt_row gt_right" headers="stub-5 margin margin-B">0.026</td>
<td class="gt_row gt_right" headers="stub-5 margin margin-C">0.072</td>
<td class="gt_row gt_right" headers="stub-5 capital capital-A">0.134</td>
<td class="gt_row gt_right" headers="stub-5 capital capital-B">0.115</td>
<td class="gt_row gt_right" headers="stub-5 capital capital-C">0.323</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">55 to 65</th>
<td class="gt_row gt_right" headers="stub-6 S">0.2</td>
<td class="gt_row gt_right" headers="stub-6 gS">0.309</td>
<td class="gt_row gt_right" headers="stub-6 iota">0.158</td>
<td class="gt_row gt_right" headers="stub-6 margin margin-A">0.021</td>
<td class="gt_row gt_right" headers="stub-6 margin margin-B">0.019</td>
<td class="gt_row gt_right" headers="stub-6 margin margin-C">0.069</td>
<td class="gt_row gt_right" headers="stub-6 capital capital-A">0.133</td>
<td class="gt_row gt_right" headers="stub-6 capital capital-B">0.121</td>
<td class="gt_row gt_right" headers="stub-6 capital capital-C">0.437</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">65 to 100</th>
<td class="gt_row gt_right" headers="stub-7 S">0.1</td>
<td class="gt_row gt_right" headers="stub-7 gS">0.174</td>
<td class="gt_row gt_right" headers="stub-7 iota">0.089</td>
<td class="gt_row gt_right" headers="stub-7 margin margin-A">0.012</td>
<td class="gt_row gt_right" headers="stub-7 margin margin-B">0.015</td>
<td class="gt_row gt_right" headers="stub-7 margin margin-C">0.047</td>
<td class="gt_row gt_right" headers="stub-7 capital capital-A">0.132</td>
<td class="gt_row gt_right" headers="stub-7 capital capital-B">0.165</td>
<td class="gt_row gt_right" headers="stub-7 capital capital-C">0.529</td>
</tr>
</tbody>
</table>


The first three columns are the margin of A, B and C and the last three their capital. These values agree with Table 8.10 (and `g(S)` with Table 8.9) to the printed digits. The code keeps `alpha S` and `beta g(S)`, the columns of Tables 8.8 and 8.9, for section 10. Every year pays for the bottom layer, so it needs no capital and `iota` is undefined; its unit margins sum to zero (cross-subsidies). Summing each column times the layer width gives each unit's margin and capital:


``` python
def by_unit(port, g):
    rows = layers(port, g)
    margin = [sum(r[1] * r[7][i] for r in rows) for i in range(3)]
    capital = [sum(r[1] * r[8][i] for r in rows) for i in range(3)]
    return margin, capital

margin, capital = by_unit(insco, wang)
lifted = [u.capital for u in insco.price(wang, assets=100, allocation="lifted").allocated]
BOOK_MARGIN, BOOK_CAPITAL, BOOK_RETURN = [0.709, 0.337, 5.919], [8.411, 8.691, 29.333], [0.084, 0.039, 0.202]
by_unit_table = pd.DataFrame(
    [{"unit": u, "margin": m, "book_margin": bm, "capital": q, "book_capital": bq, "lifted": lq,
      "ret": m / q, "book_ret": br}
     for u, m, bm, q, bq, lq, br in zip("ABC", margin, BOOK_MARGIN, capital, BOOK_CAPITAL, lifted, BOOK_RETURN)]
    + [{"unit": "total", "margin": sum(margin), "book_margin": None, "capital": sum(capital),
        "book_capital": None, "lifted": sum(lifted), "ret": sum(margin) / sum(capital), "book_ret": 0.150}]
)
(GT(by_unit_table, rowname_col="unit")
 .tab_header("Margin and capital by unit", "Wang distortion, assets of 100; lifted = Portfolio.price(..., allocation=\"lifted\")")
 .cols_label(book_margin="book margin", book_capital="book capital", lifted="lifted capital",
             ret="return", book_ret="book return")
 .fmt_number(["margin", "book_margin", "capital", "book_capital", "lifted"], decimals=3, use_seps=False)
 .fmt_percent(["ret", "book_ret"], decimals=1)
 .sub_missing(missing_text=""))
```


<style>
#kgoaxwbonc 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;
        }

#kgoaxwbonc thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#kgoaxwbonc p { margin: 0; padding: 0; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .gt_column_spanner_outer:first-child { padding-left: 0; }
 #kgoaxwbonc .gt_column_spanner_outer:last-child { padding-right: 0; }
 #kgoaxwbonc .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%; }
 #kgoaxwbonc .gt_spanner_row { border-bottom-style: hidden; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .gt_from_md> :first-child { margin-top: 0; }
 #kgoaxwbonc .gt_from_md> :last-child { margin-bottom: 0; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .gt_indent_1 { text-indent: 5px; }
 #kgoaxwbonc .gt_indent_2 { text-indent: calc(5px * 2); }
 #kgoaxwbonc .gt_indent_3 { text-indent: calc(5px * 3); }
 #kgoaxwbonc .gt_indent_4 { text-indent: calc(5px * 4); }
 #kgoaxwbonc .gt_indent_5 { text-indent: calc(5px * 5); }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .gt_row_group_first td { border-top-width: 2px; }
 #kgoaxwbonc .gt_row_group_first th { border-top-width: 2px; }
 #kgoaxwbonc .gt_striped { color: #333333; background-color: #F4F4F4; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #kgoaxwbonc .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #kgoaxwbonc .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #kgoaxwbonc .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #kgoaxwbonc .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #kgoaxwbonc .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #kgoaxwbonc .gt_left { text-align: left; }
 #kgoaxwbonc .gt_center { text-align: center; }
 #kgoaxwbonc .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #kgoaxwbonc .gt_font_normal { font-weight: normal; }
 #kgoaxwbonc .gt_font_bold { font-weight: bold; }
 #kgoaxwbonc .gt_font_italic { font-style: italic; }
 #kgoaxwbonc .gt_super { font-size: 65%; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #kgoaxwbonc .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; }
 #kgoaxwbonc .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #kgoaxwbonc .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #kgoaxwbonc .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="8" id="title" class="gt_heading gt_title gt_font_normal">Margin and capital by unit</th>
</tr>
<tr class="gt_heading">
<th colspan="8" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Wang distortion, assets of 100; lifted = Portfolio.price(..., allocation="lifted")</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="margin" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">margin</th>
<th id="book_margin" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book margin</th>
<th id="capital" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">capital</th>
<th id="book_capital" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book capital</th>
<th id="lifted" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">lifted capital</th>
<th id="ret" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">return</th>
<th id="book_ret" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book return</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">A</th>
<td class="gt_row gt_right" headers="stub-1 margin">0.709</td>
<td class="gt_row gt_right" headers="stub-1 book_margin">0.709</td>
<td class="gt_row gt_right" headers="stub-1 capital">8.411</td>
<td class="gt_row gt_right" headers="stub-1 book_capital">8.411</td>
<td class="gt_row gt_right" headers="stub-1 lifted">8.411</td>
<td class="gt_row gt_right" headers="stub-1 ret">8.4%</td>
<td class="gt_row gt_right" headers="stub-1 book_ret">8.4%</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">B</th>
<td class="gt_row gt_right" headers="stub-2 margin">0.337</td>
<td class="gt_row gt_right" headers="stub-2 book_margin">0.337</td>
<td class="gt_row gt_right" headers="stub-2 capital">8.691</td>
<td class="gt_row gt_right" headers="stub-2 book_capital">8.691</td>
<td class="gt_row gt_right" headers="stub-2 lifted">8.691</td>
<td class="gt_row gt_right" headers="stub-2 ret">3.9%</td>
<td class="gt_row gt_right" headers="stub-2 book_ret">3.9%</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">C</th>
<td class="gt_row gt_right" headers="stub-3 margin">5.919</td>
<td class="gt_row gt_right" headers="stub-3 book_margin">5.919</td>
<td class="gt_row gt_right" headers="stub-3 capital">29.333</td>
<td class="gt_row gt_right" headers="stub-3 book_capital">29.333</td>
<td class="gt_row gt_right" headers="stub-3 lifted">29.333</td>
<td class="gt_row gt_right" headers="stub-3 ret">20.2%</td>
<td class="gt_row gt_right" headers="stub-3 book_ret">20.2%</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">total</th>
<td class="gt_row gt_right" headers="stub-4 margin">6.965</td>
<td class="gt_row gt_right" headers="stub-4 book_margin"></td>
<td class="gt_row gt_right" headers="stub-4 capital">46.435</td>
<td class="gt_row gt_right" headers="stub-4 book_capital"></td>
<td class="gt_row gt_right" headers="stub-4 lifted">46.435</td>
<td class="gt_row gt_right" headers="stub-4 ret">15.0%</td>
<td class="gt_row gt_right" headers="stub-4 book_ret">15.0%</td>
</tr>
</tbody>
</table>


The returns differ by unit although every layer pays every unit the same return, because the units use different layers. Low layers are expensive but mostly funded by premium. High layers are cheap but mostly capital.

For the CCoC and the proportional hazard, the numbers (Table 8.11) depend on the treatment of the bottom layer. Equation 8.5 as written gives it no capital. prospicio, like [aggregate](../reference/aggregate.Clash.md#prospicio.aggregate.Clash.aggregate) 1.0.1, converts its margins at the limit of `iota` as `S` rises to 1: `r = 0.15` for the CCoC and `(1 - rho) / rho` for the proportional hazard. For the Wang, dual power and TVaR distortions the limit is infinite and the conventions agree. The monograph's printed capital comes from an earlier [aggregate](../reference/aggregate.Clash.md#prospicio.aggregate.Clash.aggregate) and matches neither convention:


``` python
BOOK_Q = {"ccoc": (4.874, 5.288, 36.273), "ph": (7.074, 6.565, 32.796)}
rows = []
for family in ("ccoc", "ph"):
    d = insco.calibrate(family, assets=100, return_on_capital=0.15)
    _, eq85 = by_unit(insco, d)
    lifted = [u.capital for u in insco.price(d, assets=100, allocation="lifted").allocated]
    for k, u in enumerate("ABC"):
        rows.append({"case": f"{family}, {u}", "eq85": eq85[k], "lifted": lifted[k], "book": BOOK_Q[family][k]})
(GT(pd.DataFrame(rows), rowname_col="case")
 .tab_header("Table 8.11: capital by unit under two conventions", "Assets of 100, 15% return")
 .cols_label(eq85="equation 8.5", lifted="prospicio")
 .fmt_number(["eq85", "lifted", "book"], decimals=3, use_seps=False))
```


<style>
#kjlxspcggy 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;
        }

#kjlxspcggy thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#kjlxspcggy p { margin: 0; padding: 0; }
 #kjlxspcggy .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; }
 #kjlxspcggy .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #kjlxspcggy .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; }
 #kjlxspcggy .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; }
 #kjlxspcggy .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; }
 #kjlxspcggy .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #kjlxspcggy .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; }
 #kjlxspcggy .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; }
 #kjlxspcggy .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; }
 #kjlxspcggy .gt_column_spanner_outer:first-child { padding-left: 0; }
 #kjlxspcggy .gt_column_spanner_outer:last-child { padding-right: 0; }
 #kjlxspcggy .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%; }
 #kjlxspcggy .gt_spanner_row { border-bottom-style: hidden; }
 #kjlxspcggy .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; }
 #kjlxspcggy .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; }
 #kjlxspcggy .gt_from_md> :first-child { margin-top: 0; }
 #kjlxspcggy .gt_from_md> :last-child { margin-bottom: 0; }
 #kjlxspcggy .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; }
 #kjlxspcggy .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; }
 #kjlxspcggy .gt_indent_1 { text-indent: 5px; }
 #kjlxspcggy .gt_indent_2 { text-indent: calc(5px * 2); }
 #kjlxspcggy .gt_indent_3 { text-indent: calc(5px * 3); }
 #kjlxspcggy .gt_indent_4 { text-indent: calc(5px * 4); }
 #kjlxspcggy .gt_indent_5 { text-indent: calc(5px * 5); }
 #kjlxspcggy .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; }
 #kjlxspcggy .gt_row_group_first td { border-top-width: 2px; }
 #kjlxspcggy .gt_row_group_first th { border-top-width: 2px; }
 #kjlxspcggy .gt_striped { color: #333333; background-color: #F4F4F4; }
 #kjlxspcggy .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; }
 #kjlxspcggy .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #kjlxspcggy .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #kjlxspcggy .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #kjlxspcggy .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #kjlxspcggy .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #kjlxspcggy .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #kjlxspcggy .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; }
 #kjlxspcggy .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #kjlxspcggy .gt_left { text-align: left; }
 #kjlxspcggy .gt_center { text-align: center; }
 #kjlxspcggy .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #kjlxspcggy .gt_font_normal { font-weight: normal; }
 #kjlxspcggy .gt_font_bold { font-weight: bold; }
 #kjlxspcggy .gt_font_italic { font-style: italic; }
 #kjlxspcggy .gt_super { font-size: 65%; }
 #kjlxspcggy .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; }
 #kjlxspcggy .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #kjlxspcggy .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; }
 #kjlxspcggy .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #kjlxspcggy .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #kjlxspcggy .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">Table 8.11: capital by unit under two conventions</th>
</tr>
<tr class="gt_heading">
<th colspan="4" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Assets of 100, 15% return</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="eq85" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">equation 8.5</th>
<th id="lifted" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">prospicio</th>
<th id="book" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">ccoc, A</th>
<td class="gt_row gt_right" headers="stub-1 eq85">5.419</td>
<td class="gt_row gt_right" headers="stub-1 lifted">2.261</td>
<td class="gt_row gt_right" headers="stub-1 book">4.874</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">ccoc, B</th>
<td class="gt_row gt_right" headers="stub-2 eq85">6.082</td>
<td class="gt_row gt_right" headers="stub-2 lifted">1.478</td>
<td class="gt_row gt_right" headers="stub-2 book">5.288</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">ccoc, C</th>
<td class="gt_row gt_right" headers="stub-3 eq85">34.934</td>
<td class="gt_row gt_right" headers="stub-3 lifted">42.696</td>
<td class="gt_row gt_right" headers="stub-3 book">36.273</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">ph, A</th>
<td class="gt_row gt_right" headers="stub-4 eq85">7.765</td>
<td class="gt_row gt_right" headers="stub-4 lifted">6.481</td>
<td class="gt_row gt_right" headers="stub-4 book">7.074</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">ph, B</th>
<td class="gt_row gt_right" headers="stub-5 eq85">7.694</td>
<td class="gt_row gt_right" headers="stub-5 lifted">5.597</td>
<td class="gt_row gt_right" headers="stub-5 book">6.565</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">ph, C</th>
<td class="gt_row gt_right" headers="stub-6 eq85">30.975</td>
<td class="gt_row gt_right" headers="stub-6 lifted">34.356</td>
<td class="gt_row gt_right" headers="stub-6 book">32.796</td>
</tr>
</tbody>
</table>


All three conventions sum to the same total capital of 46.435 and differ only in how they spread the bottom layer's cross-subsidies. Under the prospicio convention every unit earns exactly 15% under the CCoC, which is what a constant cost of capital means (see section 5 of the [chapter 9 guide](capital-modeling-monograph-15.md)). The monograph advises against any allocation of capital, and this result is one more reason.


# 10. Bodoff's layer allocation

Section 8.4 compares the natural allocation with the allocation of Bodoff (2007). Bodoff shares every layer of the assets by [alpha](../reference/models.ElasticNet.md#prospicio.models.ElasticNet.alpha), not only its expected loss (Table 8.12):


``` python
bodoff = insco.bodoff(assets=100)
first = layers(insco, wang)[0]
layer_share = [first[1] * a / first[2] for a in first[5]]
BOOK_BODOFF, BOOK_FIRST = [24.159, 29.756, 46.086], [7.152, 9.694, 5.154]
bodoff_table = pd.DataFrame(
    [{"unit": u, "assets": a, "book": ba, "first": f, "book_first": bf}
     for u, a, ba, f, bf in zip("ABC", bodoff, BOOK_BODOFF, layer_share, BOOK_FIRST)]
    + [{"unit": "total", "assets": sum(bodoff), "book": 100.0, "first": None, "book_first": None}]
)
(GT(bodoff_table, rowname_col="unit")
 .tab_header("Table 8.12: Bodoff's allocation of the assets", "Assets of 100; the first layer is 0 to 22")
 .cols_label(assets="Bodoff assets", book="book", first="layer 0 to 22", book_first="layer 0 to 22, book")
 .fmt_number(["assets", "book", "first", "book_first"], decimals=3, use_seps=False)
 .sub_missing(missing_text=""))
```


<style>
#lmxatuyzbd 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;
        }

#lmxatuyzbd thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#lmxatuyzbd p { margin: 0; padding: 0; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .gt_column_spanner_outer:first-child { padding-left: 0; }
 #lmxatuyzbd .gt_column_spanner_outer:last-child { padding-right: 0; }
 #lmxatuyzbd .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%; }
 #lmxatuyzbd .gt_spanner_row { border-bottom-style: hidden; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .gt_from_md> :first-child { margin-top: 0; }
 #lmxatuyzbd .gt_from_md> :last-child { margin-bottom: 0; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .gt_indent_1 { text-indent: 5px; }
 #lmxatuyzbd .gt_indent_2 { text-indent: calc(5px * 2); }
 #lmxatuyzbd .gt_indent_3 { text-indent: calc(5px * 3); }
 #lmxatuyzbd .gt_indent_4 { text-indent: calc(5px * 4); }
 #lmxatuyzbd .gt_indent_5 { text-indent: calc(5px * 5); }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .gt_row_group_first td { border-top-width: 2px; }
 #lmxatuyzbd .gt_row_group_first th { border-top-width: 2px; }
 #lmxatuyzbd .gt_striped { color: #333333; background-color: #F4F4F4; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #lmxatuyzbd .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #lmxatuyzbd .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #lmxatuyzbd .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #lmxatuyzbd .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #lmxatuyzbd .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #lmxatuyzbd .gt_left { text-align: left; }
 #lmxatuyzbd .gt_center { text-align: center; }
 #lmxatuyzbd .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #lmxatuyzbd .gt_font_normal { font-weight: normal; }
 #lmxatuyzbd .gt_font_bold { font-weight: bold; }
 #lmxatuyzbd .gt_font_italic { font-style: italic; }
 #lmxatuyzbd .gt_super { font-size: 65%; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #lmxatuyzbd .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; }
 #lmxatuyzbd .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #lmxatuyzbd .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #lmxatuyzbd .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">Table 8.12: Bodoff's allocation of the assets</th>
</tr>
<tr class="gt_heading">
<th colspan="5" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Assets of 100; the first layer is 0 to 22</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="assets" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Bodoff assets</th>
<th id="book" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book</th>
<th id="first" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">layer 0 to 22</th>
<th id="book_first" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">layer 0 to 22, book</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">A</th>
<td class="gt_row gt_right" headers="stub-1 assets">24.159</td>
<td class="gt_row gt_right" headers="stub-1 book">24.159</td>
<td class="gt_row gt_right" headers="stub-1 first">7.152</td>
<td class="gt_row gt_right" headers="stub-1 book_first">7.152</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">B</th>
<td class="gt_row gt_right" headers="stub-2 assets">29.756</td>
<td class="gt_row gt_right" headers="stub-2 book">29.756</td>
<td class="gt_row gt_right" headers="stub-2 first">9.694</td>
<td class="gt_row gt_right" headers="stub-2 book_first">9.694</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">C</th>
<td class="gt_row gt_right" headers="stub-3 assets">46.086</td>
<td class="gt_row gt_right" headers="stub-3 book">46.086</td>
<td class="gt_row gt_right" headers="stub-3 first">5.154</td>
<td class="gt_row gt_right" headers="stub-3 book_first">5.154</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">total</th>
<td class="gt_row gt_right" headers="stub-4 assets">100.000</td>
<td class="gt_row gt_right" headers="stub-4 book">100.000</td>
<td class="gt_row gt_right" headers="stub-4 first"></td>
<td class="gt_row gt_right" headers="stub-4 book_first"></td>
</tr>
</tbody>
</table>


Bodoff's allocation splits the assets but not the premium. The monograph adds a CCoC: in each layer the premium is the expected loss plus a margin of `d = r / (1 + r)` on the unfunded part, `alpha (S + d (1 - S))`, the CCoC `g(S)` shared by the loss shares:


``` python
ccoc = Distortion.ccoc(0.15)
bodoff_premium = [sum(dx * g * aS[i] / s for _, dx, s, g, _, aS, _, _, _ in layers(insco, ccoc) if s > 0)
                  for i in range(3)]
natural = [u.premium for u in insco.price(ccoc, assets=100).allocated]
premiums = pd.DataFrame(
    {"unit": ["A", "B", "C", "total"], "bodoff": bodoff_premium + [sum(bodoff_premium)],
     "natural": natural + [sum(natural)]}
)
(GT(premiums, rowname_col="unit")
 .tab_header("Premium by unit under the CCoC", "Assets of 100")
 .cols_label(bodoff="Bodoff with CCoC", natural="natural CCoC")
 .fmt_number(["bodoff", "natural"], decimals=3, use_seps=False))
```


<style>
#liqwknwqcl 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;
        }

#liqwknwqcl thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#liqwknwqcl p { margin: 0; padding: 0; }
 #liqwknwqcl .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; }
 #liqwknwqcl .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #liqwknwqcl .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; }
 #liqwknwqcl .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; }
 #liqwknwqcl .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; }
 #liqwknwqcl .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #liqwknwqcl .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; }
 #liqwknwqcl .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; }
 #liqwknwqcl .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; }
 #liqwknwqcl .gt_column_spanner_outer:first-child { padding-left: 0; }
 #liqwknwqcl .gt_column_spanner_outer:last-child { padding-right: 0; }
 #liqwknwqcl .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%; }
 #liqwknwqcl .gt_spanner_row { border-bottom-style: hidden; }
 #liqwknwqcl .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; }
 #liqwknwqcl .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; }
 #liqwknwqcl .gt_from_md> :first-child { margin-top: 0; }
 #liqwknwqcl .gt_from_md> :last-child { margin-bottom: 0; }
 #liqwknwqcl .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; }
 #liqwknwqcl .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; }
 #liqwknwqcl .gt_indent_1 { text-indent: 5px; }
 #liqwknwqcl .gt_indent_2 { text-indent: calc(5px * 2); }
 #liqwknwqcl .gt_indent_3 { text-indent: calc(5px * 3); }
 #liqwknwqcl .gt_indent_4 { text-indent: calc(5px * 4); }
 #liqwknwqcl .gt_indent_5 { text-indent: calc(5px * 5); }
 #liqwknwqcl .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; }
 #liqwknwqcl .gt_row_group_first td { border-top-width: 2px; }
 #liqwknwqcl .gt_row_group_first th { border-top-width: 2px; }
 #liqwknwqcl .gt_striped { color: #333333; background-color: #F4F4F4; }
 #liqwknwqcl .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; }
 #liqwknwqcl .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #liqwknwqcl .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #liqwknwqcl .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #liqwknwqcl .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #liqwknwqcl .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #liqwknwqcl .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #liqwknwqcl .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; }
 #liqwknwqcl .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #liqwknwqcl .gt_left { text-align: left; }
 #liqwknwqcl .gt_center { text-align: center; }
 #liqwknwqcl .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #liqwknwqcl .gt_font_normal { font-weight: normal; }
 #liqwknwqcl .gt_font_bold { font-weight: bold; }
 #liqwknwqcl .gt_font_italic { font-style: italic; }
 #liqwknwqcl .gt_super { font-size: 65%; }
 #liqwknwqcl .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; }
 #liqwknwqcl .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #liqwknwqcl .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; }
 #liqwknwqcl .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #liqwknwqcl .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #liqwknwqcl .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="3" id="title" class="gt_heading gt_title gt_font_normal">Premium by unit under the CCoC</th>
</tr>
<tr class="gt_heading">
<th colspan="3" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Assets of 100</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="bodoff" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Bodoff with CCoC</th>
<th id="natural" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">natural CCoC</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">A</th>
<td class="gt_row gt_right" headers="stub-1 bodoff">14.803</td>
<td class="gt_row gt_right" headers="stub-1 natural">13.739</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">B</th>
<td class="gt_row gt_right" headers="stub-2 bodoff">19.794</td>
<td class="gt_row gt_right" headers="stub-2 natural">18.522</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">C</th>
<td class="gt_row gt_right" headers="stub-3 bodoff">18.968</td>
<td class="gt_row gt_right" headers="stub-3 natural">21.304</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">total</th>
<td class="gt_row gt_right" headers="stub-4 bodoff">53.565</td>
<td class="gt_row gt_right" headers="stub-4 natural">53.565</td>
</tr>
</tbody>
</table>


``` python
fig, ax = plt.subplots()
width = 0.38
at = np.arange(3)
ax.bar(at - width / 2, bodoff_premium, width, label="Bodoff with CCoC")
ax.bar(at + width / 2, natural, width, label="natural CCoC")
ax.set_xticks(at, ["A", "B", "C"])
ax.set_xlabel("unit")
ax.set_ylabel("premium (assets of 100)")
ax.set_title("Premium by unit: the same total of 53.565")
ax.legend()
```


<figure class="p-figure figure">
CAgPHBhdGggZD0iTSA1My42OTMwNDcgMTc3LjI5MTUxMyAKTCA0NDQuMjkzMDQ3IDE3Ny4yOTE1MTMgCiIgY2xpcC1wYXRoPSJ1cmwoI3A4NWY5Yzk2N2MxKSIgc3R5bGU9ImZpbGw6IG5vbmU7IHN0cm9rZTogdmFyKC0tcC1ydWxlKTsgc3Ryb2tlLXdpZHRoOiAwLjg7IHN0cm9rZS1saW5lY2FwOiBzcXVhcmUiIC8+CiAgICAgPC9nPgogICAgIDxnIGlkPSJsaW5lMmRfMTIiPgogICAgICA8Zz4KICAgICAgIDx1c2UgaHJlZj0iI21iOWRiODM2ZDAwIiB4PSI1My42OTMwNDciIHk9IjE3Ny4yOTE1MTMiIHN0eWxlPSJmaWxsOiB2YXIoLS1wLW11dGVkKTsgc3Ryb2tlOiB2YXIoLS1wLW11dGVkKTsgc3Ryb2tlLXdpZHRoOiAwLjgiIC8+CiAgICAgIDwvZz4KICAgICA8L2c+CiAgICAgPGcgaWQ9InRleHRfNyI+CiAgICAgIDx0ZXh0IHN0eWxlPSJmb250LXNpemU6IDExcHg7IGZvbnQtZmFtaWx5OiB2YXIoLS1wLWZvbnQpOyB0ZXh0LWFuY2hvcjogZW5kOyBmaWxsOiB2YXIoLS1wLW11dGVkKSIgeD0iNDYuNjkzMDQ3IiB5PSIxODEuNDcwMjI0IiB0cmFuc2Zvcm09InJvdGF0ZSgtMCA0Ni42OTMwNDcgMTgxLjQ3MDIyNCkiPjUuMDwvdGV4dD4KICAgICA8L2c+CiAgICA8L2c+CiAgICA8ZyBpZD0ieXRpY2tfNCI+CiAgICAgPGcgaWQ9ImxpbmUyZF8xMyI+C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DA2IiB0cmFuc2Zvcm09InJvdGF0ZSgtMCA5NC4zOTMwNDcgNDAuNTc2NDA2KSI+Qm9kb2ZmIHdpdGggQ0NvQzwvdGV4dD4KICAgIDwvZz4KICAgIDxnIGlkPSJwYXRjaF8xMiI+CiAgICAgPHBhdGggZD0iTSA2My41OTMwNDcgNTcuMDc3MjY2IApMIDg1LjU5MzA0NyA1Ny4wNzcyNjYgCkwgODUuNTkzMDQ3IDQ5LjM3NzI2NiAKTCA2My41OTMwNDcgNDkuMzc3MjY2IAp6CiIgc3R5bGU9ImZpbGw6IHZhcigtLXAtc2VyaWVzLTIpIiAvPgogICAgPC9nPgogICAgPGcgaWQ9InRleHRfMTciPgogICAgIDx0ZXh0IHN0eWxlPSJmb250LXNpemU6IDExcHg7IGZvbnQtZmFtaWx5OiB2YXIoLS1wLWZvbnQpOyB0ZXh0LWFuY2hvcjogc3RhcnQ7IGZpbGw6IHZhcigtLXAtaW5rKSIgeD0iOTQuMzkzMDQ3IiB5PSI1Ny4wNzcyNjYiIHRyYW5zZm9ybT0icm90YXRlKC0wIDk0LjM5MzA0NyA1Ny4wNzcyNjYpIj5uYXR1cmFsIENDb0M8L3RleHQ+CiAgICA8L2c+CiAgIDwvZz4KICA8L2c+CiA8L2c+CiA8ZGVmcz4KICA8Y2xpcHBhdGggaWQ9InA4NWY5Yzk2N2MxIj4KICAgPHJlY3QgeD0iNTMuNjkzMDQ3IiB5PSIyMi4zMTgxMjUiIHdpZHRoPSIzOTAuNiIgaGVpZ2h0PSIxOTkuNTg0IiAvPgogIDwvY2xpcHBhdGg+CiA8L2RlZnM+Cjwvc3ZnPg==" />
</figure>


The totals are the same, but the splits differ. Bodoff's shares are the expected loss shares in every layer. The natural allocation uses the distorted shares, which move premium toward unit C, which dominates the years the distortion weights more. Another distortion gives other splits. So Bodoff's method needs one more assumption before it can price anything.
