# Excess-layer loss development: layer factors from the ground-up triangle

The losses above an attachment (a reinsurer's excess layer, or a primary insurer's high deductible) develop much more slowly than the ground-up losses they come from. The layer's own triangle is sparse: most early cells are zero, and the first non-zero link ratios are very large, so the chain ladder is unstable or fails.

The usual method derives the layer's development from the dense ground-up triangle and a claim size distribution, then blends it with the layer's own data. `prospicio.reserving` has the parts (#192, design note `docs/design/reserving-excess.md`):

- [ExcessPattern.from_ground_up](../reference/reserving.ExcessPattern.md#prospicio.reserving.ExcessPattern.from_ground_up) derives a layer pattern under a scale shift or under Pinto and Gogol's Pareto shape drift.
- [credibility_weights](../reference/reserving.ExcessPattern.md#prospicio.reserving.ExcessPattern.credibility_weights) blends the pattern with the layer's own factors.
- [layer_share](../reference/reserving.layer_share.md#prospicio.reserving.layer_share), [layer_exposure](../reference/reserving.layer_exposure.md#prospicio.reserving.layer_exposure) and `LayerSharePrior` give the Bornhuetter-Ferguson prior of a layer.

Sections 2 and 3 run each part on the printed examples of the literature: Bloom and Patrik, *A Methodology for Avoiding the Pitfalls of Excess Loss Development* (CAS E-Forum, Fall 2013), pages 4 to 8; Pinto and Gogol, *An Analysis of Excess Loss Development* (PCAS 74, 1987); and Bear's discussion of it (PCAS 79, 1992). `knowledge/references/excess-development-literature.md` summarises what each source prints. Sections 4 to 6 use a simulated book with a sparse layer.

**How the numbers here are checked.** CI (`python/tests/test_guides.py`) runs each block that has a text block after it and compares its output (a table prints as its formatted cells) with that text.


# 1. Why a layer develops slowly

Suppose every claim grows by the same factor between two ages, as case reserves do. Claims below the attachment give the layer nothing at the earlier age, and some rise above it later, so the layer grows from the claims already in it and from the claims that enter it. The table is the design note's own calculation (not from a source): lognormal severity, log-sd 1.5, mean 65,000 at ultimate, every claim 1.3 times its earlier value, fixed counts.


``` python
import math

import pandas as pd
from great_tables import GT

from prospicio.distributions import Lognormal
from prospicio.reserving import ExcessLayer, ExcessPattern, ScaleShift, Triangle

ultimate = Lognormal(math.log(65_000.0) - 1.5**2 / 2, 1.5)  # mean 65,000
two_ages = Triangle.from_long([2020, 2020], [12, 24], {"incurred": [1.0, 1.3]})
note = {"1m xs 0": 1.275, "750k xs 250k": 1.545, "2m xs 1m": 1.761, "7m xs 3m": 1.982}
factors = []
for name, layer in zip(note, [ExcessLayer(0.0, 1e6), ExcessLayer(250e3, 750e3),
                              ExcessLayer(1e6, 2e6), ExcessLayer(3e6, 7e6)]):
    p = ExcessPattern.from_ground_up(two_ages, "incurred", layer, ScaleShift(ultimate))
    factors.append({"layer": name, "prospicio": p.layer_ldf[0], "design note": note[name]})
(GT(pd.DataFrame(factors), rowname_col="layer")
 .tab_header("Layer factor from 12 to 24 months", "The ground-up factor is 1.3")
 .fmt_number("prospicio", decimals=4)
 .fmt_number("design note", decimals=3))
```


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

#mpijensrcg thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#mpijensrcg p { margin: 0; padding: 0; }
 #mpijensrcg .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; }
 #mpijensrcg .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #mpijensrcg .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; }
 #mpijensrcg .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; }
 #mpijensrcg .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; }
 #mpijensrcg .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #mpijensrcg .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; }
 #mpijensrcg .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; }
 #mpijensrcg .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; }
 #mpijensrcg .gt_column_spanner_outer:first-child { padding-left: 0; }
 #mpijensrcg .gt_column_spanner_outer:last-child { padding-right: 0; }
 #mpijensrcg .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%; }
 #mpijensrcg .gt_spanner_row { border-bottom-style: hidden; }
 #mpijensrcg .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; }
 #mpijensrcg .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; }
 #mpijensrcg .gt_from_md> :first-child { margin-top: 0; }
 #mpijensrcg .gt_from_md> :last-child { margin-bottom: 0; }
 #mpijensrcg .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; }
 #mpijensrcg .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; }
 #mpijensrcg .gt_indent_1 { text-indent: 5px; }
 #mpijensrcg .gt_indent_2 { text-indent: calc(5px * 2); }
 #mpijensrcg .gt_indent_3 { text-indent: calc(5px * 3); }
 #mpijensrcg .gt_indent_4 { text-indent: calc(5px * 4); }
 #mpijensrcg .gt_indent_5 { text-indent: calc(5px * 5); }
 #mpijensrcg .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; }
 #mpijensrcg .gt_row_group_first td { border-top-width: 2px; }
 #mpijensrcg .gt_row_group_first th { border-top-width: 2px; }
 #mpijensrcg .gt_striped { color: #333333; background-color: #F4F4F4; }
 #mpijensrcg .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; }
 #mpijensrcg .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #mpijensrcg .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #mpijensrcg .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #mpijensrcg .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #mpijensrcg .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #mpijensrcg .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #mpijensrcg .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; }
 #mpijensrcg .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #mpijensrcg .gt_left { text-align: left; }
 #mpijensrcg .gt_center { text-align: center; }
 #mpijensrcg .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #mpijensrcg .gt_font_normal { font-weight: normal; }
 #mpijensrcg .gt_font_bold { font-weight: bold; }
 #mpijensrcg .gt_font_italic { font-style: italic; }
 #mpijensrcg .gt_super { font-size: 65%; }
 #mpijensrcg .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; }
 #mpijensrcg .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #mpijensrcg .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; }
 #mpijensrcg .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #mpijensrcg .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #mpijensrcg .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">Layer factor from 12 to 24 months</th>
</tr>
<tr class="gt_heading">
<th colspan="3" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">The ground-up factor is 1.3</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="prospicio" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">prospicio</th>
<th id="design-note" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">design note</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">1m xs 0</th>
<td class="gt_row gt_right" headers="stub-1 prospicio">1.2754</td>
<td class="gt_row gt_right" headers="stub-1 design-note">1.275</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">750k xs 250k</th>
<td class="gt_row gt_right" headers="stub-2 prospicio">1.5449</td>
<td class="gt_row gt_right" headers="stub-2 design-note">1.545</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">2m xs 1m</th>
<td class="gt_row gt_right" headers="stub-3 prospicio">1.7612</td>
<td class="gt_row gt_right" headers="stub-3 design-note">1.761</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">7m xs 3m</th>
<td class="gt_row gt_right" headers="stub-4 prospicio">1.9819</td>
<td class="gt_row gt_right" headers="stub-4 design-note">1.982</td>
</tr>
</tbody>
</table>


The higher the layer, the larger its factor (near 2 on the highest). The layer's own triangle shows this only late, so the rest of this guide takes the factors from the dense ground-up triangle.


# 2. Bloom and Patrik's example: the pitfall and the cure

Year One has four claims, reported at 100, 375, 250 and 500 at 12 months. Ground-up losses develop by 3.60 from 12 to 24 months and by 1.25 from 24 to 36 months (the end of development), so every claim reaches 4.5 times its 12-month value. Years Two and Three have the same claims with 5% inflation a year. The layer is all loss above a deductible of 350.

Every claim has the same factor, so this is exactly a **scale shift**: the claims at age `j` are the ultimate claims divided by a shift `c_j`, the ground-up factor to ultimate (4.5, 1.25 and 1 at 12, 24 and 36 months). The block builds the paper's triangle at the end of Year Three and sets its excess column beside the paper's:


``` python
from prospicio.reserving import ChainLadder

CLAIMS = [100.0, 375.0, 250.0, 500.0]   # Year One at 12 months
TO_ULTIMATE = {12: 4.5, 24: 1.25, 36: 1.0}
PRICE = {1: 1.0, 2: 1.05, 3: 1.05**2}  # 5% inflation a year
DEDUCTIBLE = 350.0

rows = []
for year, price in PRICE.items():
    for age, c in TO_ULTIMATE.items():
        if year + age // 12 <= 4:  # the cells known at the end of Year Three
            sizes = [x * price * 4.5 / c for x in CLAIMS]
            rows.append((year, age, sum(sizes), sum(max(s - DEDUCTIBLE, 0.0) for s in sizes),
                         sum(min(s, DEDUCTIBLE) for s in sizes)))
bp = Triangle.from_long([r[0] for r in rows], [r[1] for r in rows],
                        {"ground_up": [r[2] for r in rows], "excess": [r[3] for r in rows],
                         "limited": [r[4] for r in rows]})
printed = {(1, 12): 175, (1, 24): 3010, (1, 36): 4113, (2, 12): 219, (2, 24): 3231, (3, 12): 265}
excess_cells = [{"cell": f"Year {year}, {age} months", "prospicio": excess,
                 "paper": printed[(year, age)]} for year, age, _, excess, _ in rows]
(GT(pd.DataFrame(excess_cells), rowname_col="cell")
 .tab_header("Excess of 350 at the end of Year Three", "Currency units")
 .fmt_number("prospicio", decimals=2, use_seps=False)
 .fmt_integer("paper"))
```


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

#biyznwjhyq thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#biyznwjhyq p { margin: 0; padding: 0; }
 #biyznwjhyq .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; }
 #biyznwjhyq .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #biyznwjhyq .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; }
 #biyznwjhyq .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; }
 #biyznwjhyq .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; }
 #biyznwjhyq .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #biyznwjhyq .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; }
 #biyznwjhyq .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; }
 #biyznwjhyq .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; }
 #biyznwjhyq .gt_column_spanner_outer:first-child { padding-left: 0; }
 #biyznwjhyq .gt_column_spanner_outer:last-child { padding-right: 0; }
 #biyznwjhyq .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%; }
 #biyznwjhyq .gt_spanner_row { border-bottom-style: hidden; }
 #biyznwjhyq .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; }
 #biyznwjhyq .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; }
 #biyznwjhyq .gt_from_md> :first-child { margin-top: 0; }
 #biyznwjhyq .gt_from_md> :last-child { margin-bottom: 0; }
 #biyznwjhyq .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; }
 #biyznwjhyq .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; }
 #biyznwjhyq .gt_indent_1 { text-indent: 5px; }
 #biyznwjhyq .gt_indent_2 { text-indent: calc(5px * 2); }
 #biyznwjhyq .gt_indent_3 { text-indent: calc(5px * 3); }
 #biyznwjhyq .gt_indent_4 { text-indent: calc(5px * 4); }
 #biyznwjhyq .gt_indent_5 { text-indent: calc(5px * 5); }
 #biyznwjhyq .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; }
 #biyznwjhyq .gt_row_group_first td { border-top-width: 2px; }
 #biyznwjhyq .gt_row_group_first th { border-top-width: 2px; }
 #biyznwjhyq .gt_striped { color: #333333; background-color: #F4F4F4; }
 #biyznwjhyq .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; }
 #biyznwjhyq .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #biyznwjhyq .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #biyznwjhyq .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #biyznwjhyq .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #biyznwjhyq .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #biyznwjhyq .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #biyznwjhyq .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; }
 #biyznwjhyq .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #biyznwjhyq .gt_left { text-align: left; }
 #biyznwjhyq .gt_center { text-align: center; }
 #biyznwjhyq .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #biyznwjhyq .gt_font_normal { font-weight: normal; }
 #biyznwjhyq .gt_font_bold { font-weight: bold; }
 #biyznwjhyq .gt_font_italic { font-style: italic; }
 #biyznwjhyq .gt_super { font-size: 65%; }
 #biyznwjhyq .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; }
 #biyznwjhyq .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #biyznwjhyq .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; }
 #biyznwjhyq .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #biyznwjhyq .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #biyznwjhyq .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">Excess of 350 at the end of Year Three</th>
</tr>
<tr class="gt_heading">
<th colspan="3" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Currency units</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="prospicio" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">prospicio</th>
<th id="paper" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">paper</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">Year 1, 12 months</th>
<td class="gt_row gt_right" headers="stub-1 prospicio">175.00</td>
<td class="gt_row gt_right" headers="stub-1 paper">175</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">Year 1, 24 months</th>
<td class="gt_row gt_right" headers="stub-2 prospicio">3010.00</td>
<td class="gt_row gt_right" headers="stub-2 paper">3,010</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">Year 1, 36 months</th>
<td class="gt_row gt_right" headers="stub-3 prospicio">4112.50</td>
<td class="gt_row gt_right" headers="stub-3 paper">4,113</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">Year 2, 12 months</th>
<td class="gt_row gt_right" headers="stub-4 prospicio">218.75</td>
<td class="gt_row gt_right" headers="stub-4 paper">219</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">Year 2, 24 months</th>
<td class="gt_row gt_right" headers="stub-5 prospicio">3230.50</td>
<td class="gt_row gt_right" headers="stub-5 paper">3,231</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">Year 3, 12 months</th>
<td class="gt_row gt_right" headers="stub-6 prospicio">264.69</td>
<td class="gt_row gt_right" headers="stub-6 paper">265</td>
</tr>
</tbody>
</table>


The trap is to develop this excess triangle alone. Inflation moved more of Year Two's claims above the deductible early, so the 12 to 24 month factor, from Years One and Two, overstates the development of Year Three:


``` python
own = ChainLadder().fit(bp, "excess")
truth = sum(max(x * PRICE[3] * 4.5 - DEDUCTIBLE, 0.0) for x in CLAIMS)
print(f"own factors {own.ldf[0]:.4f} {own.ldf[1]:.4f}")
```


    own factors 15.8489 1.3663


``` python
overstated = pd.DataFrame({
    "measure": ["Year Three ultimate", "True ultimate", "Overstatement (%)"],
    "prospicio": [own.ultimate[2], truth, 100 * (own.ultimate[2] / truth - 1)],
    "paper": [5732, 4678, 22.5]})
(GT(overstated, rowname_col="measure")
 .tab_header("Developing the excess triangle alone", "Year Three, currency units")
 .fmt_number("prospicio", rows=[0, 1], decimals=1)
 .fmt_number("paper", rows=[0, 1], decimals=0)
 .fmt_number(["prospicio", "paper"], rows=[2], decimals=1))
```


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

#ipepxqkbvz thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#ipepxqkbvz p { margin: 0; padding: 0; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .gt_column_spanner_outer:first-child { padding-left: 0; }
 #ipepxqkbvz .gt_column_spanner_outer:last-child { padding-right: 0; }
 #ipepxqkbvz .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%; }
 #ipepxqkbvz .gt_spanner_row { border-bottom-style: hidden; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .gt_from_md> :first-child { margin-top: 0; }
 #ipepxqkbvz .gt_from_md> :last-child { margin-bottom: 0; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .gt_indent_1 { text-indent: 5px; }
 #ipepxqkbvz .gt_indent_2 { text-indent: calc(5px * 2); }
 #ipepxqkbvz .gt_indent_3 { text-indent: calc(5px * 3); }
 #ipepxqkbvz .gt_indent_4 { text-indent: calc(5px * 4); }
 #ipepxqkbvz .gt_indent_5 { text-indent: calc(5px * 5); }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .gt_row_group_first td { border-top-width: 2px; }
 #ipepxqkbvz .gt_row_group_first th { border-top-width: 2px; }
 #ipepxqkbvz .gt_striped { color: #333333; background-color: #F4F4F4; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #ipepxqkbvz .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #ipepxqkbvz .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #ipepxqkbvz .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #ipepxqkbvz .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #ipepxqkbvz .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #ipepxqkbvz .gt_left { text-align: left; }
 #ipepxqkbvz .gt_center { text-align: center; }
 #ipepxqkbvz .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #ipepxqkbvz .gt_font_normal { font-weight: normal; }
 #ipepxqkbvz .gt_font_bold { font-weight: bold; }
 #ipepxqkbvz .gt_font_italic { font-style: italic; }
 #ipepxqkbvz .gt_super { font-size: 65%; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #ipepxqkbvz .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; }
 #ipepxqkbvz .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #ipepxqkbvz .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #ipepxqkbvz .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">Developing the excess triangle alone</th>
</tr>
<tr class="gt_heading">
<th colspan="3" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Year Three, currency units</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="prospicio" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">prospicio</th>
<th id="paper" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">paper</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">Year Three ultimate</th>
<td class="gt_row gt_right" headers="stub-1 prospicio">5,731.5</td>
<td class="gt_row gt_right" headers="stub-1 paper">5,732</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">True ultimate</th>
<td class="gt_row gt_right" headers="stub-2 prospicio">4,677.5</td>
<td class="gt_row gt_right" headers="stub-2 paper">4,678</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">Overstatement (%)</th>
<td class="gt_row gt_right" headers="stub-3 prospicio">22.5</td>
<td class="gt_row gt_right" headers="stub-3 paper">22.5</td>
</tr>
</tbody>
</table>


The cure is to trend the severity, not the pattern: cut the layer from each year's claim sizes at that year's price level. The severity is each year's ultimate claims (450, 1,687.5, 1,125 and 2,250 at Year One's prices), a [Grid](../reference/distributions.Grid.md#prospicio.distributions.Grid) of four equal point masses. A step of 112.5 hits all four exactly, so the layer expectations are exact. [ExcessPattern.from_ground_up](../reference/reserving.ExcessPattern.md#prospicio.reserving.ExcessPattern.from_ground_up) solves the shifts from the ground-up triangle and returns the layer's factors:


``` python
from prospicio.distributions import Grid

def ultimate_claims(price):
    probs = [0.0] * 21
    for k in (4, 15, 10, 20):  # 450, 1,687.5, 1,125 and 2,250 at Year One's prices
        probs[k] = 0.25
    return Grid(112.5 * price, probs)

paper = {1: (17.20, 1.37, 23.50), 2: (14.77, 1.36, 20.06), 3: (13.08, 1.35, 17.67)}
patterns, by_year = {}, []
for year, price in PRICE.items():
    one_year = Triangle.from_long(
        [year] * 3, [12, 24, 36],
        {"ground_up": [sum(CLAIMS) * price * 4.5 / c for c in TO_ULTIMATE.values()]})
    p = ExcessPattern.from_ground_up(one_year, "ground_up", ExcessLayer(DEDUCTIBLE),
                                     ScaleShift(ultimate_claims(price)))
    patterns[year] = p
    by_year.append({"year": f"Year {year}", "12 to 24": p.layer_ldf[0],
                    "24 to 36": p.layer_ldf[1], "12 to ultimate": p.layer_cdf[0]})
    by_year.append({"year": f"Year {year}, paper", "12 to 24": paper[year][0],
                    "24 to 36": paper[year][1], "12 to ultimate": paper[year][2]})
columns = ["12 to 24", "24 to 36", "12 to ultimate"]
(GT(pd.DataFrame(by_year), rowname_col="year")
 .tab_header("Layer factors of each year", "Excess of 350")
 .fmt_number(columns, rows=[0, 2, 4], decimals=4)
 .fmt_number(columns, rows=[1, 3, 5], decimals=2))
```


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

#syxvolqjao thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#syxvolqjao p { margin: 0; padding: 0; }
 #syxvolqjao .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; }
 #syxvolqjao .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #syxvolqjao .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; }
 #syxvolqjao .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; }
 #syxvolqjao .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; }
 #syxvolqjao .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #syxvolqjao .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; }
 #syxvolqjao .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; }
 #syxvolqjao .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; }
 #syxvolqjao .gt_column_spanner_outer:first-child { padding-left: 0; }
 #syxvolqjao .gt_column_spanner_outer:last-child { padding-right: 0; }
 #syxvolqjao .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%; }
 #syxvolqjao .gt_spanner_row { border-bottom-style: hidden; }
 #syxvolqjao .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; }
 #syxvolqjao .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; }
 #syxvolqjao .gt_from_md> :first-child { margin-top: 0; }
 #syxvolqjao .gt_from_md> :last-child { margin-bottom: 0; }
 #syxvolqjao .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; }
 #syxvolqjao .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; }
 #syxvolqjao .gt_indent_1 { text-indent: 5px; }
 #syxvolqjao .gt_indent_2 { text-indent: calc(5px * 2); }
 #syxvolqjao .gt_indent_3 { text-indent: calc(5px * 3); }
 #syxvolqjao .gt_indent_4 { text-indent: calc(5px * 4); }
 #syxvolqjao .gt_indent_5 { text-indent: calc(5px * 5); }
 #syxvolqjao .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; }
 #syxvolqjao .gt_row_group_first td { border-top-width: 2px; }
 #syxvolqjao .gt_row_group_first th { border-top-width: 2px; }
 #syxvolqjao .gt_striped { color: #333333; background-color: #F4F4F4; }
 #syxvolqjao .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; }
 #syxvolqjao .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #syxvolqjao .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #syxvolqjao .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #syxvolqjao .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #syxvolqjao .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #syxvolqjao .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #syxvolqjao .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; }
 #syxvolqjao .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #syxvolqjao .gt_left { text-align: left; }
 #syxvolqjao .gt_center { text-align: center; }
 #syxvolqjao .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #syxvolqjao .gt_font_normal { font-weight: normal; }
 #syxvolqjao .gt_font_bold { font-weight: bold; }
 #syxvolqjao .gt_font_italic { font-style: italic; }
 #syxvolqjao .gt_super { font-size: 65%; }
 #syxvolqjao .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; }
 #syxvolqjao .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #syxvolqjao .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; }
 #syxvolqjao .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #syxvolqjao .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #syxvolqjao .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">Layer factors of each year</th>
</tr>
<tr class="gt_heading">
<th colspan="4" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Excess of 350</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="12-to-24" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">12 to 24</th>
<th id="24-to-36" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">24 to 36</th>
<th id="12-to-ultimate" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">12 to ultimate</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">Year 1</th>
<td class="gt_row gt_right" headers="stub-1 12-to-24">17.2000</td>
<td class="gt_row gt_right" headers="stub-1 24-to-36">1.3663</td>
<td class="gt_row gt_right" headers="stub-1 12-to-ultimate">23.5000</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">Year 1, paper</th>
<td class="gt_row gt_right" headers="stub-2 12-to-24">17.20</td>
<td class="gt_row gt_right" headers="stub-2 24-to-36">1.37</td>
<td class="gt_row gt_right" headers="stub-2 12-to-ultimate">23.50</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">Year 2</th>
<td class="gt_row gt_right" headers="stub-3 12-to-24">14.7680</td>
<td class="gt_row gt_right" headers="stub-3 24-to-36">1.3583</td>
<td class="gt_row gt_right" headers="stub-3 12-to-ultimate">20.0600</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">Year 2, paper</th>
<td class="gt_row gt_right" headers="stub-4 12-to-24">14.77</td>
<td class="gt_row gt_right" headers="stub-4 24-to-36">1.36</td>
<td class="gt_row gt_right" headers="stub-4 12-to-ultimate">20.06</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">Year 3</th>
<td class="gt_row gt_right" headers="stub-5 12-to-24">13.0797</td>
<td class="gt_row gt_right" headers="stub-5 24-to-36">1.3511</td>
<td class="gt_row gt_right" headers="stub-5 12-to-ultimate">17.6719</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">Year 3, paper</th>
<td class="gt_row gt_right" headers="stub-6 12-to-24">13.08</td>
<td class="gt_row gt_right" headers="stub-6 24-to-36">1.35</td>
<td class="gt_row gt_right" headers="stub-6 12-to-ultimate">17.67</td>
</tr>
</tbody>
</table>


The factors agree to the paper's two decimals, and the unrounded values are exact (17.2 = 3,010 / 175). [shifts](../reference/reserving.ExcessPattern.md#prospicio.reserving.ExcessPattern.shifts) holds the `c_j`, the ground-up factors to ultimate, with the tail last (1 here). With a `counts=` column the count development is divided out first; without one the counts are taken as complete.


``` python
print("shifts", " ".join(f"{c:g}" for c in patterns[1].shifts), "  ground-up factors",
      " ".join(f"{f:g}" for f in patterns[1].ground_up_ldf))
```


    shifts 4.5 1.25 1   ground-up factors 3.6 1.25


The pattern goes into any development method through [ldf](../reference/reserving.Mack.md#prospicio.reserving.Mack.ldf), [ldf_kind](../reference/reserving.Mack.md#prospicio.reserving.Mack.ldf_kind) and [ldf_weight](../reference/reserving.Mack.md#prospicio.reserving.Mack.ldf_weight): `p.selected()` gives them as a dictionary to unpack with `**`, and `p.tail` is the layer's tail. One pattern serves every origin at the severity's price level, so trend the severity to the origins' level first. Year Three's pattern on the full triangle is exact for Year Three and a little low for Year Two, whose claims are at the previous year's prices:


``` python
p3 = patterns[3]
fit = ChainLadder(tail=p3.tail, **p3.selected()).fit(bp, "excess")
refit = []
for year, ult in zip(PRICE, fit.ultimate):
    true = sum(max(x * PRICE[year] * 4.5 - DEDUCTIBLE, 0.0) for x in CLAIMS)
    refit.append({"year": f"Year {year}", "ultimate": ult, "true": true,
                  "error (%)": 100 * (ult / true - 1)})
(GT(pd.DataFrame(refit), rowname_col="year")
 .tab_header("Year Three's pattern on the full triangle", "Excess of 350")
 .fmt_number(["ultimate", "true"], decimals=1, use_seps=False)
 .fmt_number("error (%)", decimals=2, force_sign=True))
```


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

#nsoyqpiccu thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#nsoyqpiccu p { margin: 0; padding: 0; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .gt_column_spanner_outer:first-child { padding-left: 0; }
 #nsoyqpiccu .gt_column_spanner_outer:last-child { padding-right: 0; }
 #nsoyqpiccu .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%; }
 #nsoyqpiccu .gt_spanner_row { border-bottom-style: hidden; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .gt_from_md> :first-child { margin-top: 0; }
 #nsoyqpiccu .gt_from_md> :last-child { margin-bottom: 0; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .gt_indent_1 { text-indent: 5px; }
 #nsoyqpiccu .gt_indent_2 { text-indent: calc(5px * 2); }
 #nsoyqpiccu .gt_indent_3 { text-indent: calc(5px * 3); }
 #nsoyqpiccu .gt_indent_4 { text-indent: calc(5px * 4); }
 #nsoyqpiccu .gt_indent_5 { text-indent: calc(5px * 5); }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .gt_row_group_first td { border-top-width: 2px; }
 #nsoyqpiccu .gt_row_group_first th { border-top-width: 2px; }
 #nsoyqpiccu .gt_striped { color: #333333; background-color: #F4F4F4; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #nsoyqpiccu .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #nsoyqpiccu .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #nsoyqpiccu .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #nsoyqpiccu .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #nsoyqpiccu .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #nsoyqpiccu .gt_left { text-align: left; }
 #nsoyqpiccu .gt_center { text-align: center; }
 #nsoyqpiccu .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #nsoyqpiccu .gt_font_normal { font-weight: normal; }
 #nsoyqpiccu .gt_font_bold { font-weight: bold; }
 #nsoyqpiccu .gt_font_italic { font-style: italic; }
 #nsoyqpiccu .gt_super { font-size: 65%; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #nsoyqpiccu .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; }
 #nsoyqpiccu .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #nsoyqpiccu .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #nsoyqpiccu .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">Year Three's pattern on the full triangle</th>
</tr>
<tr class="gt_heading">
<th colspan="4" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Excess of 350</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="ultimate" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">ultimate</th>
<th id="true" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">true</th>
<th id="error" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">error (%)</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">Year 1</th>
<td class="gt_row gt_right" headers="stub-1 ultimate">4112.5</td>
<td class="gt_row gt_right" headers="stub-1 true">4112.5</td>
<td class="gt_row gt_right" headers="stub-1 error">0.00</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">Year 2</th>
<td class="gt_row gt_right" headers="stub-2 ultimate">4364.7</td>
<td class="gt_row gt_right" headers="stub-2 true">4388.1</td>
<td class="gt_row gt_right" headers="stub-2 error">−0.53</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">Year 3</th>
<td class="gt_row gt_right" headers="stub-3 ultimate">4677.5</td>
<td class="gt_row gt_right" headers="stub-3 true">4677.5</td>
<td class="gt_row gt_right" headers="stub-3 error">0.00</td>
</tr>
</tbody>
</table>


Fit origins at different price levels or retentions in separate groups, each with its own pattern.

**The excess loss factor route.** Bloom and Patrik's section 4 reaches the same answer without a severity curve, from the dense triangle limited to 350. The excess loss factor (ELF) is the share of ultimate ground-up loss above 350, and `excess CDF = ELF / (1 / CDF_unlimited - (1 - ELF) / CDF_limited)` (Pinto and Gogol's layer identity). For Year Three, with the limited factor from the chain ladder:


``` python
limited = ChainLadder().fit(bp, "limited")
cdf_limited = limited.ldf[0] * limited.ldf[1]
limited_ult = rows[-1][4] * cdf_limited   # Year Three at 12 months
ground_up_ult = rows[-1][2] * 4.5
elf = 1.0 - limited_ult / ground_up_ult
route = pd.DataFrame({
    "measure": ["Limited factor, 12 to 24", "ELF", "Excess factor to ultimate",
                "From the paper's rounded inputs", "Scale shift, exact"],
    "prospicio": [limited.ldf[0], elf, elf / (1 / 4.5 - (1 - elf) / cdf_limited),
                  0.764 / (1 / 4.5 - (1 - 0.764) / 1.32), p3.layer_cdf[0]],
    "paper": [1.32, 0.764, 17.54, None, None]})
(GT(route, rowname_col="measure")
 .tab_header("Year Three by the excess loss factor route", "Excess of 350")
 .fmt_number("prospicio", decimals=4)
 .fmt_number("paper", rows=[0, 2], decimals=2)
 .fmt_number("paper", rows=[1], decimals=3)
 .sub_missing(missing_text=""))
```


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

#jeeeqdgggw thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#jeeeqdgggw p { margin: 0; padding: 0; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .gt_column_spanner_outer:first-child { padding-left: 0; }
 #jeeeqdgggw .gt_column_spanner_outer:last-child { padding-right: 0; }
 #jeeeqdgggw .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%; }
 #jeeeqdgggw .gt_spanner_row { border-bottom-style: hidden; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .gt_from_md> :first-child { margin-top: 0; }
 #jeeeqdgggw .gt_from_md> :last-child { margin-bottom: 0; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .gt_indent_1 { text-indent: 5px; }
 #jeeeqdgggw .gt_indent_2 { text-indent: calc(5px * 2); }
 #jeeeqdgggw .gt_indent_3 { text-indent: calc(5px * 3); }
 #jeeeqdgggw .gt_indent_4 { text-indent: calc(5px * 4); }
 #jeeeqdgggw .gt_indent_5 { text-indent: calc(5px * 5); }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .gt_row_group_first td { border-top-width: 2px; }
 #jeeeqdgggw .gt_row_group_first th { border-top-width: 2px; }
 #jeeeqdgggw .gt_striped { color: #333333; background-color: #F4F4F4; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #jeeeqdgggw .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #jeeeqdgggw .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #jeeeqdgggw .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #jeeeqdgggw .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #jeeeqdgggw .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #jeeeqdgggw .gt_left { text-align: left; }
 #jeeeqdgggw .gt_center { text-align: center; }
 #jeeeqdgggw .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #jeeeqdgggw .gt_font_normal { font-weight: normal; }
 #jeeeqdgggw .gt_font_bold { font-weight: bold; }
 #jeeeqdgggw .gt_font_italic { font-style: italic; }
 #jeeeqdgggw .gt_super { font-size: 65%; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #jeeeqdgggw .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; }
 #jeeeqdgggw .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #jeeeqdgggw .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #jeeeqdgggw .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">Year Three by the excess loss factor route</th>
</tr>
<tr class="gt_heading">
<th colspan="3" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Excess of 350</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="prospicio" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">prospicio</th>
<th id="paper" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">paper</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">Limited factor, 12 to 24</th>
<td class="gt_row gt_right" headers="stub-1 prospicio">1.3223</td>
<td class="gt_row gt_right" headers="stub-1 paper">1.32</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">ELF</th>
<td class="gt_row gt_right" headers="stub-2 prospicio">0.7637</td>
<td class="gt_row gt_right" headers="stub-2 paper">0.764</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">Excess factor to ultimate</th>
<td class="gt_row gt_right" headers="stub-3 prospicio">17.5364</td>
<td class="gt_row gt_right" headers="stub-3 paper">17.54</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">From the paper's rounded inputs</th>
<td class="gt_row gt_right" headers="stub-4 prospicio">17.5898</td>
<td class="gt_row gt_right" headers="stub-4 paper"></td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">Scale shift, exact</th>
<td class="gt_row gt_right" headers="stub-5 prospicio">17.6719</td>
<td class="gt_row gt_right" headers="stub-5 paper"></td>
</tr>
</tbody>
</table>


The paper's 17.54 (from unrounded inputs) is 0.77% below the exact 17.67, because the limited factor, like the excess factor above, is estimated on older years.


# 3. Shape drift: Pinto and Gogol, and Bear

Pinto and Gogol found in ISO data that the tail of the size distribution also becomes heavier as claims mature: a Pareto fitted above a threshold [k](../reference/models.TargetEncoding.md#prospicio.models.TargetEncoding.k) has a shape [q](../reference/reserving.MunichFit.md#prospicio.reserving.MunichFit.q) that falls with maturity. Their factor for the losses excess of `c k` is the development of the losses excess of [k](../reference/models.TargetEncoding.md#prospicio.models.TargetEncoding.k) times `c^(q_i - q_j)`; with the counts above [k](../reference/models.TargetEncoding.md#prospicio.models.TargetEncoding.k) as the base it also has a ratio of `(q - 1)` terms. [ParetoShape](../reference/reserving.ParetoShape.md#prospicio.reserving.ParetoShape) takes the threshold, a shape at every age and at ultimate, and the base that the column holds (`base="counts"`, or an [ExcessLayer](../reference/reserving.ExcessLayer.md#prospicio.reserving.ExcessLayer)). The column then holds the base development, not the ground-up losses.


``` python
from prospicio.reserving import ParetoShape

def shape_factor(base_development, threshold, shapes, layer, base):
    tri = Triangle.from_long([2020, 2020], [12, 24], {"base": [1.0, base_development]})
    model = ParetoShape(threshold, {12: shapes[0], 24: shapes[1]}, shapes[1], base=base)
    return ExcessPattern.from_ground_up(tri, "base", layer, model).layer_ldf[0]

# Pinto and Gogol p. 247: losses excess of 25,000 develop by 2.5, q from 1.75 to 1.25.
pg = shape_factor(2.5, 25_000.0, (1.75, 1.25), ExcessLayer(100_000.0), ExcessLayer(25_000.0))
# The same from the counts above 25,000: they develop by 2.5 (0.25 / 0.75).
pgc = shape_factor(2.5 * 0.25 / 0.75, 25_000.0, (1.75, 1.25), ExcessLayer(100_000.0), "counts")
# Bear p. 138: the layer 100,000 to 300,000 develops by 3.5, q from 1.25 to 1.10.
bear = shape_factor(3.5, 100_000.0, (1.25, 1.10), ExcessLayer(200_000.0, 400_000.0),
                    ExcessLayer(100_000.0, 200_000.0))
examples = pd.DataFrame({
    "example": ["Pinto and Gogol p. 247, excess of 100,000",
                "The same from the counts above 25,000",
                "Bear p. 138, layer 200,000 to 600,000"],
    "prospicio": [pg, pgc, bear], "paper": [5.0, None, 3.88]})  # 2.5 (4)^0.5 = 5.0
(GT(examples, rowname_col="example")
 .tab_header("Layer factors under shape drift", "Pinto and Gogol print 2.5 x 4^0.5 = 5.0")
 .fmt_number("prospicio", decimals=4)
 .fmt_number("paper", decimals=2)
 .sub_missing(missing_text=""))
```


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

#sfamlwmqdw thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#sfamlwmqdw p { margin: 0; padding: 0; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .gt_column_spanner_outer:first-child { padding-left: 0; }
 #sfamlwmqdw .gt_column_spanner_outer:last-child { padding-right: 0; }
 #sfamlwmqdw .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%; }
 #sfamlwmqdw .gt_spanner_row { border-bottom-style: hidden; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .gt_from_md> :first-child { margin-top: 0; }
 #sfamlwmqdw .gt_from_md> :last-child { margin-bottom: 0; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .gt_indent_1 { text-indent: 5px; }
 #sfamlwmqdw .gt_indent_2 { text-indent: calc(5px * 2); }
 #sfamlwmqdw .gt_indent_3 { text-indent: calc(5px * 3); }
 #sfamlwmqdw .gt_indent_4 { text-indent: calc(5px * 4); }
 #sfamlwmqdw .gt_indent_5 { text-indent: calc(5px * 5); }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .gt_row_group_first td { border-top-width: 2px; }
 #sfamlwmqdw .gt_row_group_first th { border-top-width: 2px; }
 #sfamlwmqdw .gt_striped { color: #333333; background-color: #F4F4F4; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #sfamlwmqdw .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #sfamlwmqdw .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #sfamlwmqdw .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #sfamlwmqdw .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #sfamlwmqdw .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #sfamlwmqdw .gt_left { text-align: left; }
 #sfamlwmqdw .gt_center { text-align: center; }
 #sfamlwmqdw .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #sfamlwmqdw .gt_font_normal { font-weight: normal; }
 #sfamlwmqdw .gt_font_bold { font-weight: bold; }
 #sfamlwmqdw .gt_font_italic { font-style: italic; }
 #sfamlwmqdw .gt_super { font-size: 65%; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #sfamlwmqdw .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; }
 #sfamlwmqdw .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #sfamlwmqdw .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #sfamlwmqdw .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">Layer factors under shape drift</th>
</tr>
<tr class="gt_heading">
<th colspan="3" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Pinto and Gogol print 2.5 x 4^0.5 = 5.0</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="prospicio" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">prospicio</th>
<th id="paper" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">paper</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">Pinto and Gogol p. 247, excess of 100,000</th>
<td class="gt_row gt_right" headers="stub-1 prospicio">5.0000</td>
<td class="gt_row gt_right" headers="stub-1 paper">5.00</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">The same from the counts above 25,000</th>
<td class="gt_row gt_right" headers="stub-2 prospicio">5.0000</td>
<td class="gt_row gt_right" headers="stub-2 paper"></td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">Bear p. 138, layer 200,000 to 600,000</th>
<td class="gt_row gt_right" headers="stub-3 prospicio">3.8835</td>
<td class="gt_row gt_right" headers="stub-3 paper">3.88</td>
</tr>
</tbody>
</table>


Pinto and Gogol's Appendix B works the shape drift from 27 months to ultimate above 10,000 ([q](../reference/reserving.MunichFit.md#prospicio.reserving.MunichFit.q) from 1.6 to 1.3). It prints the losses of several retentions and layers as multiples of the losses excess of 10,000, to three decimals. The ratio of the two ages is the layer's factor relative to the base development [a](../reference/distributions.Beta.md#prospicio.distributions.Beta.a):


``` python
appendix_b = {  # (from, to) in thousands: (at 27 months, at ultimate), as printed
    (100, None): (0.251, 0.501), (300, None): (0.130, 0.360), (500, None): (0.096, 0.309),
    (1000, None): (0.063, 0.251), (100, 300): (0.121, 0.141), (300, 500): (0.034, 0.051),
    (500, 1000): (0.033, 0.058),
}
appendix = []
for (lo, hi), (at27, ult) in appendix_b.items():
    layer = ExcessLayer(lo * 1e3) if hi is None else ExcessLayer(lo * 1e3, (hi - lo) * 1e3)
    f = shape_factor(1.0, 10_000.0, (1.6, 1.3), layer, ExcessLayer(10_000.0))
    name = f"excess of {lo:,}k" if hi is None else f"{lo:,}k to {hi:,}k"
    appendix.append({"layer": name, "prospicio": f, "ultimate": ult, "27 months": at27,
                     "paper ratio": ult / at27})
(GT(pd.DataFrame(appendix), rowname_col="layer")
 .tab_header("Pinto and Gogol's Appendix B", "Layer factor as a multiple of a")
 .fmt_number("prospicio", decimals=4)
 .fmt_number(["ultimate", "27 months", "paper ratio"], decimals=3))
```


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

#opdftmeica thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#opdftmeica p { margin: 0; padding: 0; }
 #opdftmeica .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; }
 #opdftmeica .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #opdftmeica .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; }
 #opdftmeica .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; }
 #opdftmeica .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; }
 #opdftmeica .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #opdftmeica .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; }
 #opdftmeica .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; }
 #opdftmeica .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; }
 #opdftmeica .gt_column_spanner_outer:first-child { padding-left: 0; }
 #opdftmeica .gt_column_spanner_outer:last-child { padding-right: 0; }
 #opdftmeica .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%; }
 #opdftmeica .gt_spanner_row { border-bottom-style: hidden; }
 #opdftmeica .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; }
 #opdftmeica .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; }
 #opdftmeica .gt_from_md> :first-child { margin-top: 0; }
 #opdftmeica .gt_from_md> :last-child { margin-bottom: 0; }
 #opdftmeica .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; }
 #opdftmeica .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; }
 #opdftmeica .gt_indent_1 { text-indent: 5px; }
 #opdftmeica .gt_indent_2 { text-indent: calc(5px * 2); }
 #opdftmeica .gt_indent_3 { text-indent: calc(5px * 3); }
 #opdftmeica .gt_indent_4 { text-indent: calc(5px * 4); }
 #opdftmeica .gt_indent_5 { text-indent: calc(5px * 5); }
 #opdftmeica .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; }
 #opdftmeica .gt_row_group_first td { border-top-width: 2px; }
 #opdftmeica .gt_row_group_first th { border-top-width: 2px; }
 #opdftmeica .gt_striped { color: #333333; background-color: #F4F4F4; }
 #opdftmeica .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; }
 #opdftmeica .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #opdftmeica .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #opdftmeica .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #opdftmeica .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #opdftmeica .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #opdftmeica .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #opdftmeica .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; }
 #opdftmeica .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #opdftmeica .gt_left { text-align: left; }
 #opdftmeica .gt_center { text-align: center; }
 #opdftmeica .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #opdftmeica .gt_font_normal { font-weight: normal; }
 #opdftmeica .gt_font_bold { font-weight: bold; }
 #opdftmeica .gt_font_italic { font-style: italic; }
 #opdftmeica .gt_super { font-size: 65%; }
 #opdftmeica .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; }
 #opdftmeica .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #opdftmeica .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; }
 #opdftmeica .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #opdftmeica .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #opdftmeica .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">Pinto and Gogol's Appendix B</th>
</tr>
<tr class="gt_heading">
<th colspan="5" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Layer factor as a multiple of a</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="prospicio" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">prospicio</th>
<th id="ultimate" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">ultimate</th>
<th id="27-months" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">27 months</th>
<th id="paper-ratio" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">paper ratio</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">excess of 100k</th>
<td class="gt_row gt_right" headers="stub-1 prospicio">1.9953</td>
<td class="gt_row gt_right" headers="stub-1 ultimate">0.501</td>
<td class="gt_row gt_right" headers="stub-1 27-months">0.251</td>
<td class="gt_row gt_right" headers="stub-1 paper-ratio">1.996</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">excess of 300k</th>
<td class="gt_row gt_right" headers="stub-2 prospicio">2.7742</td>
<td class="gt_row gt_right" headers="stub-2 ultimate">0.360</td>
<td class="gt_row gt_right" headers="stub-2 27-months">0.130</td>
<td class="gt_row gt_right" headers="stub-2 paper-ratio">2.769</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">excess of 500k</th>
<td class="gt_row gt_right" headers="stub-3 prospicio">3.2336</td>
<td class="gt_row gt_right" headers="stub-3 ultimate">0.309</td>
<td class="gt_row gt_right" headers="stub-3 27-months">0.096</td>
<td class="gt_row gt_right" headers="stub-3 paper-ratio">3.219</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">excess of 1,000k</th>
<td class="gt_row gt_right" headers="stub-4 prospicio">3.9811</td>
<td class="gt_row gt_right" headers="stub-4 ultimate">0.251</td>
<td class="gt_row gt_right" headers="stub-4 27-months">0.063</td>
<td class="gt_row gt_right" headers="stub-4 paper-ratio">3.984</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">100k to 300k</th>
<td class="gt_row gt_right" headers="stub-5 prospicio">1.1606</td>
<td class="gt_row gt_right" headers="stub-5 ultimate">0.141</td>
<td class="gt_row gt_right" headers="stub-5 27-months">0.121</td>
<td class="gt_row gt_right" headers="stub-5 paper-ratio">1.165</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">300k to 500k</th>
<td class="gt_row gt_right" headers="stub-6 prospicio">1.4932</td>
<td class="gt_row gt_right" headers="stub-6 ultimate">0.051</td>
<td class="gt_row gt_right" headers="stub-6 27-months">0.034</td>
<td class="gt_row gt_right" headers="stub-6 paper-ratio">1.500</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">500k to 1,000k</th>
<td class="gt_row gt_right" headers="stub-7 prospicio">1.7843</td>
<td class="gt_row gt_right" headers="stub-7 ultimate">0.058</td>
<td class="gt_row gt_right" headers="stub-7 27-months">0.033</td>
<td class="gt_row gt_right" headers="stub-7 paper-ratio">1.758</td>
</tr>
</tbody>
</table>


Excess of 100,000 is exactly `10^0.3 = 1.99526` times [a](../reference/distributions.Beta.md#prospicio.distributions.Beta.a); the paper's 1.996 is the ratio of rounded amounts. The other rows agree within that rounding (0.033 can be anything from 0.0325 to 0.0335).

Shape drift needs a shape at every age, so claim-level data or layered losses by maturity; a scale shift needs only the ground-up triangle. The two differ on high layers when the tail becomes heavier. In a simulation study (`knowledge/findings/excess-simulation-study.md`, 500 books per arm) with drifting shapes, the scale shift understates the ultimate of the sparse layer by about 26% and of the thin layer by 14%; [ParetoShape](../reference/reserving.ParetoShape.md#prospicio.reserving.ParetoShape) with the true shapes is unbiased.


# 4. A sparse layer on a simulated book

We simulate a book with a known truth: ten accident years, 2015 to 2024, of 120 claims each, valued at the end of 2024. Ultimate claim sizes are lognormal (mean about 30,000, log-sd 1.8). The reported value at each age is the ultimate divided by a shift that falls from 3.0 at 12 months to 1.01 at 120 months (the last 1% is the tail). The book follows the scale shift by construction, so it shows the mechanics and does not test the model; the simulation study above is the test.

A small linear congruential generator, written out in the block, draws the uniforms (the R twin draws the same claims). The block tracks a high layer (750,000 xs 250,000) and a working layer (400,000 xs 100,000), and counts the claims in each:


``` python
SEV = Lognormal(8.7, 1.8)
YEARS = list(range(2015, 2025))
AGES = [12 * k for k in range(1, 11)]
SHIFT = [3.0, 1.8, 1.4, 1.2, 1.1, 1.05, 1.03, 1.02, 1.015, 1.01]  # ultimate / reported
N, PREMIUM, TAIL = 120, 5_500_000.0, 1.01
HIGH, WORKING = ExcessLayer(250_000.0, 750_000.0), ExcessLayer(100_000.0, 400_000.0)

def in_layer(x, layer):
    return min(max(x - layer.attachment, 0.0), layer.limit)

def simulate(seed):
    """One book: its triangle and each layer's true ultimate by origin."""
    state, claims = seed, {}
    for y in YEARS:
        u = []
        for _ in range(N):  # Park and Miller's minimal standard generator
            state = state * 16807 % 2147483647
            u.append(state / 2147483647)
        claims[y] = [SEV.quantile(v) for v in u]
    cells = {"origin": [], "age": [], "incurred": [], "premium": [], "high": [], "high_n": [],
             "working": [], "working_n": []}
    for y in YEARS:
        for j, age in enumerate(AGES):
            if (y - 2015) + j <= 9:  # the cells known at the end of 2024
                reported = [x / SHIFT[j] for x in claims[y]]
                cells["origin"].append(y)
                cells["age"].append(age)
                cells["incurred"].append(sum(reported))
                cells["premium"].append(PREMIUM)
                for name, layer in (("high", HIGH), ("working", WORKING)):
                    cells[name].append(sum(in_layer(v, layer) for v in reported))
                    cells[name + "_n"].append(float(sum(v > layer.attachment for v in reported)))
    book = Triangle.from_long(cells.pop("origin"), cells.pop("age"), cells)
    truth = {name: [sum(in_layer(x, layer) for x in claims[y]) for y in YEARS]
             for name, layer in (("high", HIGH), ("working", WORKING))}
    return book, truth

book, truth = simulate(20241231)
latest = dict(zip(book.columns, book.latest_diagonal()[0]))
latest_high = pd.DataFrame({
    "origin": [str(y) for y in YEARS], "ground-up": latest["incurred"],
    "high layer": latest["high"], "claims": latest["high_n"], "true high ultimate": truth["high"]})
latest_high.loc[len(latest_high)] = ["total", *latest_high.iloc[:, 1:].sum()]
(GT(latest_high, rowname_col="origin")
 .tab_header("The simulated book at the end of 2024", "Currency units; claims in the high layer")
 .fmt_integer(["ground-up", "high layer", "claims", "true high ultimate"]))
```


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

#iwdpxhzxbz thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#iwdpxhzxbz p { margin: 0; padding: 0; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .gt_column_spanner_outer:first-child { padding-left: 0; }
 #iwdpxhzxbz .gt_column_spanner_outer:last-child { padding-right: 0; }
 #iwdpxhzxbz .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%; }
 #iwdpxhzxbz .gt_spanner_row { border-bottom-style: hidden; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .gt_from_md> :first-child { margin-top: 0; }
 #iwdpxhzxbz .gt_from_md> :last-child { margin-bottom: 0; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .gt_indent_1 { text-indent: 5px; }
 #iwdpxhzxbz .gt_indent_2 { text-indent: calc(5px * 2); }
 #iwdpxhzxbz .gt_indent_3 { text-indent: calc(5px * 3); }
 #iwdpxhzxbz .gt_indent_4 { text-indent: calc(5px * 4); }
 #iwdpxhzxbz .gt_indent_5 { text-indent: calc(5px * 5); }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .gt_row_group_first td { border-top-width: 2px; }
 #iwdpxhzxbz .gt_row_group_first th { border-top-width: 2px; }
 #iwdpxhzxbz .gt_striped { color: #333333; background-color: #F4F4F4; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #iwdpxhzxbz .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #iwdpxhzxbz .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #iwdpxhzxbz .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #iwdpxhzxbz .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #iwdpxhzxbz .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #iwdpxhzxbz .gt_left { text-align: left; }
 #iwdpxhzxbz .gt_center { text-align: center; }
 #iwdpxhzxbz .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #iwdpxhzxbz .gt_font_normal { font-weight: normal; }
 #iwdpxhzxbz .gt_font_bold { font-weight: bold; }
 #iwdpxhzxbz .gt_font_italic { font-style: italic; }
 #iwdpxhzxbz .gt_super { font-size: 65%; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #iwdpxhzxbz .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; }
 #iwdpxhzxbz .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #iwdpxhzxbz .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #iwdpxhzxbz .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">The simulated book at the end of 2024</th>
</tr>
<tr class="gt_heading">
<th colspan="5" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Currency units; claims in the high layer</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="ground-up" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">ground-up</th>
<th id="high-layer" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">high layer</th>
<th id="claims" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">claims</th>
<th id="true-high-ultimate" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">true high ultimate</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">2015</th>
<td class="gt_row gt_right" headers="stub-1 ground-up">2,297,915</td>
<td class="gt_row gt_right" headers="stub-1 high-layer">0</td>
<td class="gt_row gt_right" headers="stub-1 claims">0</td>
<td class="gt_row gt_right" headers="stub-1 true-high-ultimate">0</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">2016</th>
<td class="gt_row gt_right" headers="stub-2 ground-up">3,338,009</td>
<td class="gt_row gt_right" headers="stub-2 high-layer">534,042</td>
<td class="gt_row gt_right" headers="stub-2 claims">3</td>
<td class="gt_row gt_right" headers="stub-2 true-high-ultimate">553,303</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">2017</th>
<td class="gt_row gt_right" headers="stub-3 ground-up">2,509,633</td>
<td class="gt_row gt_right" headers="stub-3 high-layer">255,071</td>
<td class="gt_row gt_right" headers="stub-3 claims">2</td>
<td class="gt_row gt_right" headers="stub-3 true-high-ultimate">270,172</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">2018</th>
<td class="gt_row gt_right" headers="stub-4 ground-up">2,473,626</td>
<td class="gt_row gt_right" headers="stub-4 high-layer">210,437</td>
<td class="gt_row gt_right" headers="stub-4 claims">1</td>
<td class="gt_row gt_right" headers="stub-4 true-high-ultimate">224,250</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">2019</th>
<td class="gt_row gt_right" headers="stub-5 ground-up">3,066,471</td>
<td class="gt_row gt_right" headers="stub-5 high-layer">565,998</td>
<td class="gt_row gt_right" headers="stub-5 claims">2</td>
<td class="gt_row gt_right" headers="stub-5 true-high-ultimate">619,298</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">2020</th>
<td class="gt_row gt_right" headers="stub-6 ground-up">2,652,024</td>
<td class="gt_row gt_right" headers="stub-6 high-layer">173,574</td>
<td class="gt_row gt_right" headers="stub-6 claims">1</td>
<td class="gt_row gt_right" headers="stub-6 true-high-ultimate">215,931</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">2021</th>
<td class="gt_row gt_right" headers="stub-7 ground-up">2,499,806</td>
<td class="gt_row gt_right" headers="stub-7 high-layer">101,581</td>
<td class="gt_row gt_right" headers="stub-7 claims">1</td>
<td class="gt_row gt_right" headers="stub-7 true-high-ultimate">206,309</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">2022</th>
<td class="gt_row gt_right" headers="stub-8 ground-up">3,187,793</td>
<td class="gt_row gt_right" headers="stub-8 high-layer">614,715</td>
<td class="gt_row gt_right" headers="stub-8 claims">4</td>
<td class="gt_row gt_right" headers="stub-8 true-high-ultimate">1,260,601</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">2023</th>
<td class="gt_row gt_right" headers="stub-9 ground-up">2,103,713</td>
<td class="gt_row gt_right" headers="stub-9 high-layer">17,007</td>
<td class="gt_row gt_right" headers="stub-9 claims">1</td>
<td class="gt_row gt_right" headers="stub-9 true-high-ultimate">494,749</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">2024</th>
<td class="gt_row gt_right" headers="stub-10 ground-up">965,657</td>
<td class="gt_row gt_right" headers="stub-10 high-layer">0</td>
<td class="gt_row gt_right" headers="stub-10 claims">0</td>
<td class="gt_row gt_right" headers="stub-10 true-high-ultimate">161,796</td>
</tr>
<tr>
<th id="stub-11" class="gt_row gt_left gt_stub" scope="row">total</th>
<td class="gt_row gt_right" headers="stub-11 ground-up">25,094,646</td>
<td class="gt_row gt_right" headers="stub-11 high-layer">2,472,425</td>
<td class="gt_row gt_right" headers="stub-11 claims">15</td>
<td class="gt_row gt_right" headers="stub-11 true-high-ultimate">4,006,410</td>
</tr>
</tbody>
</table>


The high layer's own chain ladder fails: 2015, the only origin at the oldest link, is zero, so that factor has no estimate. The working layer's runs, on factors from a few claims:


``` python
try:
    ChainLadder(tail=TAIL).fit(book, "high")
except ValueError as e:
    print("high layer, own chain ladder:", e)
own_working = ChainLadder(tail=TAIL).fit(book, "working")
print("working layer, own factors", " ".join(f"{f:.3f}" for f in own_working.ldf))
```


    high layer, own chain ladder: factor from development index 8: earlier values sum to zero
    working layer, own factors 3.055 1.521 1.321 1.159 1.079 1.036 1.018 1.009 1.016


The derived patterns need only the ground-up column and the ultimate severity (here the true one; in practice fit it to trended ultimate claims, for example with `prospicio.distributions`). They are incurred patterns from volume-weighted ground-up factors, and the ground-up tail of 1.01 gives each layer its own, larger tail. The table's shift is the one at the start of each link; the last row is the tail:


``` python
derived = {}
for name, layer in (("high", HIGH), ("working", WORKING)):
    derived[name] = ExcessPattern.from_ground_up(book, "incurred", layer, ScaleShift(SEV),
                                                 tail=TAIL)
p = derived["high"]
dev = pd.DataFrame({
    "link": [f"{a} to {a + 12}" for a in AGES[:-1]] + ["tail"], "shift": p.shifts,
    "ground-up": [*p.ground_up_ldf, p.ground_up_tail],
    "high layer": [*derived["high"].layer_ldf, derived["high"].tail],
    "working layer": [*derived["working"].layer_ldf, derived["working"].tail]})
factor_columns = ["ground-up", "high layer", "working layer"]
(GT(dev, rowname_col="link")
 .tab_header("Age-to-age factors, in months", "Derived from the ground-up triangle")
 .fmt_number("shift", decimals=3)
 .fmt_number(factor_columns, rows=list(range(9)), decimals=3)
 .fmt_number(factor_columns, rows=[9], decimals=4))
```


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

#uvolhurmqw thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#uvolhurmqw p { margin: 0; padding: 0; }
 #uvolhurmqw .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; }
 #uvolhurmqw .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #uvolhurmqw .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; }
 #uvolhurmqw .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; }
 #uvolhurmqw .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; }
 #uvolhurmqw .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #uvolhurmqw .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; }
 #uvolhurmqw .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; }
 #uvolhurmqw .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; }
 #uvolhurmqw .gt_column_spanner_outer:first-child { padding-left: 0; }
 #uvolhurmqw .gt_column_spanner_outer:last-child { padding-right: 0; }
 #uvolhurmqw .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%; }
 #uvolhurmqw .gt_spanner_row { border-bottom-style: hidden; }
 #uvolhurmqw .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; }
 #uvolhurmqw .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; }
 #uvolhurmqw .gt_from_md> :first-child { margin-top: 0; }
 #uvolhurmqw .gt_from_md> :last-child { margin-bottom: 0; }
 #uvolhurmqw .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; }
 #uvolhurmqw .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; }
 #uvolhurmqw .gt_indent_1 { text-indent: 5px; }
 #uvolhurmqw .gt_indent_2 { text-indent: calc(5px * 2); }
 #uvolhurmqw .gt_indent_3 { text-indent: calc(5px * 3); }
 #uvolhurmqw .gt_indent_4 { text-indent: calc(5px * 4); }
 #uvolhurmqw .gt_indent_5 { text-indent: calc(5px * 5); }
 #uvolhurmqw .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; }
 #uvolhurmqw .gt_row_group_first td { border-top-width: 2px; }
 #uvolhurmqw .gt_row_group_first th { border-top-width: 2px; }
 #uvolhurmqw .gt_striped { color: #333333; background-color: #F4F4F4; }
 #uvolhurmqw .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; }
 #uvolhurmqw .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #uvolhurmqw .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #uvolhurmqw .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #uvolhurmqw .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #uvolhurmqw .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #uvolhurmqw .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #uvolhurmqw .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; }
 #uvolhurmqw .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #uvolhurmqw .gt_left { text-align: left; }
 #uvolhurmqw .gt_center { text-align: center; }
 #uvolhurmqw .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #uvolhurmqw .gt_font_normal { font-weight: normal; }
 #uvolhurmqw .gt_font_bold { font-weight: bold; }
 #uvolhurmqw .gt_font_italic { font-style: italic; }
 #uvolhurmqw .gt_super { font-size: 65%; }
 #uvolhurmqw .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; }
 #uvolhurmqw .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #uvolhurmqw .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; }
 #uvolhurmqw .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #uvolhurmqw .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #uvolhurmqw .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">Age-to-age factors, in months</th>
</tr>
<tr class="gt_heading">
<th colspan="5" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Derived from the ground-up triangle</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="shift" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">shift</th>
<th id="ground-up" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">ground-up</th>
<th id="high-layer" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">high layer</th>
<th id="working-layer" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">working layer</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">12 to 24</th>
<td class="gt_row gt_right" headers="stub-1 shift">3.000</td>
<td class="gt_row gt_right" headers="stub-1 ground-up">1.667</td>
<td class="gt_row gt_right" headers="stub-1 high-layer">2.446</td>
<td class="gt_row gt_right" headers="stub-1 working-layer">2.180</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">24 to 36</th>
<td class="gt_row gt_right" headers="stub-2 shift">1.800</td>
<td class="gt_row gt_right" headers="stub-2 ground-up">1.286</td>
<td class="gt_row gt_right" headers="stub-2 high-layer">1.513</td>
<td class="gt_row gt_right" headers="stub-2 working-layer">1.431</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">36 to 48</th>
<td class="gt_row gt_right" headers="stub-3 shift">1.400</td>
<td class="gt_row gt_right" headers="stub-3 ground-up">1.167</td>
<td class="gt_row gt_right" headers="stub-3 high-layer">1.278</td>
<td class="gt_row gt_right" headers="stub-3 working-layer">1.236</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">48 to 60</th>
<td class="gt_row gt_right" headers="stub-4 shift">1.200</td>
<td class="gt_row gt_right" headers="stub-4 ground-up">1.091</td>
<td class="gt_row gt_right" headers="stub-4 high-layer">1.145</td>
<td class="gt_row gt_right" headers="stub-4 working-layer">1.124</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">60 to 72</th>
<td class="gt_row gt_right" headers="stub-5 shift">1.100</td>
<td class="gt_row gt_right" headers="stub-5 ground-up">1.048</td>
<td class="gt_row gt_right" headers="stub-5 high-layer">1.074</td>
<td class="gt_row gt_right" headers="stub-5 working-layer">1.064</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">72 to 84</th>
<td class="gt_row gt_right" headers="stub-6 shift">1.050</td>
<td class="gt_row gt_right" headers="stub-6 ground-up">1.019</td>
<td class="gt_row gt_right" headers="stub-6 high-layer">1.030</td>
<td class="gt_row gt_right" headers="stub-6 working-layer">1.026</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">84 to 96</th>
<td class="gt_row gt_right" headers="stub-7 shift">1.030</td>
<td class="gt_row gt_right" headers="stub-7 ground-up">1.010</td>
<td class="gt_row gt_right" headers="stub-7 high-layer">1.015</td>
<td class="gt_row gt_right" headers="stub-7 working-layer">1.013</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">96 to 108</th>
<td class="gt_row gt_right" headers="stub-8 shift">1.020</td>
<td class="gt_row gt_right" headers="stub-8 ground-up">1.005</td>
<td class="gt_row gt_right" headers="stub-8 high-layer">1.008</td>
<td class="gt_row gt_right" headers="stub-8 working-layer">1.006</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">108 to 120</th>
<td class="gt_row gt_right" headers="stub-9 shift">1.015</td>
<td class="gt_row gt_right" headers="stub-9 ground-up">1.005</td>
<td class="gt_row gt_right" headers="stub-9 high-layer">1.008</td>
<td class="gt_row gt_right" headers="stub-9 working-layer">1.006</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">tail</th>
<td class="gt_row gt_right" headers="stub-10 shift">1.010</td>
<td class="gt_row gt_right" headers="stub-10 ground-up">1.0100</td>
<td class="gt_row gt_right" headers="stub-10 high-layer">1.0153</td>
<td class="gt_row gt_right" headers="stub-10 working-layer">1.0131</td>
</tr>
</tbody>
</table>


``` python
print("to ultimate at 12 months: ground-up", f"{SHIFT[0]:.2f},",
      ", ".join(f"{name} {q.layer_cdf[0]:.2f}" for name, q in derived.items()))
```


    to ultimate at 12 months: ground-up 3.00, high 6.27, working 4.91


``` python
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
link_ages = AGES[:-1]
ax.plot(link_ages, p.ground_up_ldf, marker="o", label="ground-up")
ax.plot(link_ages, derived["working"].layer_ldf, marker="o", label="working layer")
ax.plot(link_ages, derived["high"].layer_ldf, marker="o", label="high layer")
ax.set_yscale("log")
ax.set_yticks([1.0, 1.5, 2.0, 2.5], ["1.0", "1.5", "2.0", "2.5"])
ax.set_xticks(link_ages)
ax.set_xlabel("age at the start of the link (months)")
ax.set_ylabel("age-to-age factor (log scale)")
ax.set_title("The higher the layer, the slower it develops")
ax.legend()
```


<figure class="p-figure figure">
<img src="data:image/svg+xml;base64,PHN2ZyB4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjQ0NC40OTQyOTdwdCIgaGVpZ2h0PSIyNjIuMTAyOTg0cHQiIHZpZXdib3g9IjAgMCA0NDQuNDk0Mjk3IDI2Mi4xMDI5ODQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmVyc2lvbj0iMS4xIj4KIDxtZXRhZGF0YT4KICA8cmRmIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIgeG1sbnM6cmRmPSJodHRwOi8vd3d3Lncz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8ZyBpZD0idGV4dF8xOSI+CiAgICAgPHRleHQgc3R5bGU9ImZvbnQtc2l6ZTogMTFweDsgZm9udC1mYW1pbHk6IHZhcigtLXAtZm9udCk7IHRleHQtYW5jaG9yOiBzdGFydDsgZmlsbDogdmFyKC0tcC1pbmspIiB4PSIzNTIuNjcxNjQxIiB5PSI3My41NzgxMjUiIHRyYW5zZm9ybT0icm90YXRlKC0wIDM1Mi42NzE2NDEgNzMuNTc4MTI1KSI+aGlnaCBsYXllcjwvdGV4dD4KICAgIDwvZz4KICAgPC9nPgogIDwvZz4KIDwvZz4KIDxkZWZzPgogIDxjbGlwcGF0aCBpZD0icGQwYTI3MTk5NDkiPgogICA8cmVjdCB4PSI0Ni42OTQyOTciIHk9IjIyLjMxODEyNSIgd2lkdGg9IjM5MC42IiBoZWlnaHQ9IjE5OS41ODQiIC8+CiAgPC9jbGlwcGF0aD4KIDwvZGVmcz4KPC9zdmc+" />
</figure>


The next blocks fit the chain ladder, Mack and the Bornhuetter-Ferguson (BF) on the high layer with `**p.selected()` and `tail=p.tail`. The BF prior is the ground-up expected loss ratio times the premium times the layer share (section 6):


``` python
from prospicio.reserving import BornhuetterFerguson, Mack, layer_exposure, layer_share

elr = N * SEV.mean() / PREMIUM
share = layer_share(SEV, HIGH)
layered = layer_exposure(book, "premium", share, "high_premium")
cl = ChainLadder(tail=p.tail, **p.selected()).fit(book, "high")
mack = Mack(tail=p.tail, **p.selected()).fit(book, "high")
bf = BornhuetterFerguson(apriori=elr, tail=p.tail, **p.selected()).fit(
    layered, "high", "high_premium")
print(f"ground-up ELR {elr:.4f}, layer share {share:.4f}, "
      f"expected layer ultimate a year {elr * share * PREMIUM:,.0f}")
```


    ground-up ELR 0.6618, layer share 0.1603, expected layer ultimate a year 583,548


``` python
ultimates = pd.DataFrame({
    "origin": [str(y) for y in YEARS], "chain ladder": cl.ultimate, "BF": bf.ultimate,
    "true": truth["high"]})
ultimates.loc[len(ultimates)] = ["total", *ultimates.iloc[:, 1:].sum()]
(GT(ultimates, rowname_col="origin")
 .tab_header("Ultimate loss in the high layer", "Currency units")
 .fmt_integer(["chain ladder", "BF", "true"]))
```


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

#yccunafjea thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#yccunafjea p { margin: 0; padding: 0; }
 #yccunafjea .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; }
 #yccunafjea .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #yccunafjea .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; }
 #yccunafjea .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; }
 #yccunafjea .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; }
 #yccunafjea .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #yccunafjea .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; }
 #yccunafjea .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; }
 #yccunafjea .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; }
 #yccunafjea .gt_column_spanner_outer:first-child { padding-left: 0; }
 #yccunafjea .gt_column_spanner_outer:last-child { padding-right: 0; }
 #yccunafjea .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%; }
 #yccunafjea .gt_spanner_row { border-bottom-style: hidden; }
 #yccunafjea .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; }
 #yccunafjea .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; }
 #yccunafjea .gt_from_md> :first-child { margin-top: 0; }
 #yccunafjea .gt_from_md> :last-child { margin-bottom: 0; }
 #yccunafjea .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; }
 #yccunafjea .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; }
 #yccunafjea .gt_indent_1 { text-indent: 5px; }
 #yccunafjea .gt_indent_2 { text-indent: calc(5px * 2); }
 #yccunafjea .gt_indent_3 { text-indent: calc(5px * 3); }
 #yccunafjea .gt_indent_4 { text-indent: calc(5px * 4); }
 #yccunafjea .gt_indent_5 { text-indent: calc(5px * 5); }
 #yccunafjea .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; }
 #yccunafjea .gt_row_group_first td { border-top-width: 2px; }
 #yccunafjea .gt_row_group_first th { border-top-width: 2px; }
 #yccunafjea .gt_striped { color: #333333; background-color: #F4F4F4; }
 #yccunafjea .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; }
 #yccunafjea .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #yccunafjea .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #yccunafjea .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #yccunafjea .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #yccunafjea .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #yccunafjea .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #yccunafjea .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; }
 #yccunafjea .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #yccunafjea .gt_left { text-align: left; }
 #yccunafjea .gt_center { text-align: center; }
 #yccunafjea .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #yccunafjea .gt_font_normal { font-weight: normal; }
 #yccunafjea .gt_font_bold { font-weight: bold; }
 #yccunafjea .gt_font_italic { font-style: italic; }
 #yccunafjea .gt_super { font-size: 65%; }
 #yccunafjea .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; }
 #yccunafjea .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #yccunafjea .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; }
 #yccunafjea .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #yccunafjea .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #yccunafjea .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">Ultimate loss in the high layer</th>
</tr>
<tr class="gt_heading">
<th colspan="4" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Currency units</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="chain-ladder" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">chain ladder</th>
<th id="BF" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">BF</th>
<th id="true" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">true</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">2015</th>
<td class="gt_row gt_right" headers="stub-1 chain-ladder">0</td>
<td class="gt_row gt_right" headers="stub-1 BF">8,785</td>
<td class="gt_row gt_right" headers="stub-1 true">0</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">2016</th>
<td class="gt_row gt_right" headers="stub-2 chain-ladder">546,307</td>
<td class="gt_row gt_right" headers="stub-2 BF">547,143</td>
<td class="gt_row gt_right" headers="stub-2 true">553,303</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">2017</th>
<td class="gt_row gt_right" headers="stub-3 chain-ladder">262,895</td>
<td class="gt_row gt_right" headers="stub-3 BF">272,438</td>
<td class="gt_row gt_right" headers="stub-3 true">270,172</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">2018</th>
<td class="gt_row gt_right" headers="stub-4 chain-ladder">220,153</td>
<td class="gt_row gt_right" headers="stub-4 BF">236,191</td>
<td class="gt_row gt_right" headers="stub-4 true">224,250</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">2019</th>
<td class="gt_row gt_right" headers="stub-5 chain-ladder">609,855</td>
<td class="gt_row gt_right" headers="stub-5 BF">607,963</td>
<td class="gt_row gt_right" headers="stub-5 true">619,298</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">2020</th>
<td class="gt_row gt_right" headers="stub-6 chain-ladder">200,936</td>
<td class="gt_row gt_right" headers="stub-6 BF">253,038</td>
<td class="gt_row gt_right" headers="stub-6 true">215,931</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">2021</th>
<td class="gt_row gt_right" headers="stub-7 chain-ladder">134,694</td>
<td class="gt_row gt_right" headers="stub-7 BF">245,040</td>
<td class="gt_row gt_right" headers="stub-7 true">206,309</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">2022</th>
<td class="gt_row gt_right" headers="stub-8 chain-ladder">1,041,936</td>
<td class="gt_row gt_right" headers="stub-8 BF">853,985</td>
<td class="gt_row gt_right" headers="stub-8 true">1,260,601</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">2023</th>
<td class="gt_row gt_right" headers="stub-9 chain-ladder">43,614</td>
<td class="gt_row gt_right" headers="stub-9 BF">373,000</td>
<td class="gt_row gt_right" headers="stub-9 true">494,749</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">2024</th>
<td class="gt_row gt_right" headers="stub-10 chain-ladder">0</td>
<td class="gt_row gt_right" headers="stub-10 BF">490,530</td>
<td class="gt_row gt_right" headers="stub-10 true">161,796</td>
</tr>
<tr>
<th id="stub-11" class="gt_row gt_left gt_stub" scope="row">total</th>
<td class="gt_row gt_right" headers="stub-11 chain-ladder">3,060,390</td>
<td class="gt_row gt_right" headers="stub-11 BF">3,888,113</td>
<td class="gt_row gt_right" headers="stub-11 true">4,006,410</td>
</tr>
</tbody>
</table>


``` python
print(f"Mack reserve {mack.total_reserve:,.0f}, standard error {mack.total_standard_error:,.0f}")
```


    Mack reserve 587,966, standard error 210,007


``` python
fig, ax = plt.subplots()
ax.bar(YEARS, [t / 1e3 for t in truth["high"]], color="0.75", label="true ultimate")
ax.plot(YEARS, [u / 1e3 for u in cl.ultimate], marker="o", label="chain ladder")
ax.plot(YEARS, [u / 1e3 for u in bf.ultimate], marker="o", label="Bornhuetter-Ferguson")
ax.set_xticks(YEARS)
ax.set_xlabel("accident year")
ax.set_ylabel("ultimate loss in the high layer (thousands)")
ax.set_title("The BF fills the immature years that the chain ladder leaves empty")
ax.legend(loc="upper left")
```


<figure class="p-figure figure">
AgICAgPGcgaWQ9ImxpbmUyZF8yOSI+CiAgICAgIDxwYXRoIGQ9Ik0gNTcuMTk1ODU5IDEwMy4xMzMwODYgCkwgNDQ3Ljc5NTg1OSAxMDMuMTMzMDg2IAoiIGNsaXAtcGF0aD0idXJsKCNwMThmZmJlYTg3ZikiIHN0eWxlPSJmaWxsOiBub25lOyBzdHJva2U6IHZhcigtLXAtcnVsZSk7IHN0cm9rZS13aWR0aDogMC44OyBzdHJva2UtbGluZWNhcDogc3F1YXJlIiAvPgogICAgIDwvZz4KICAgICA8ZyBpZD0ibGluZTJkXzMwIj4KICAgICAgPGc+CiAgICAgICA8dXNlIGhyZWY9IiNtODVmNDE5ZWJmYiIgeD0iNTcuMTk1ODU5IiB5PSIxMDMuMTMzMDg2IiBzdHlsZT0iZmlsbDogdmFyKC0tcC1tdXRlZCk7IHN0cm9rZTogdmFyKC0tcC1tdXRlZCk7IHN0cm9rZS13aWR0aDogMC44IiAvPgogICAgICA8L2c+CiAgICAgPC9nPgogICAgIDxnIGlkPSJ0ZXh0XzE2Ij4KICAgICAgPHRleHQgc3R5bGU9ImZvbnQtc2l6ZTogMTFweDsgZm9udC1mYW1pbHk6IHZhcigtLXAtZm9udCk7IHRleHQtYW5jaG9yOiBlbmQ7IGZpbGw6IHZhcigtLXAtbXV0ZWQ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ODU5IDY3LjczNzI5NyAKegoiIHN0eWxlPSJmaWxsOiBjb2xvci1taXgoaW4gc3JnYiwgdmFyKC0tcC1pbmspIDI1JSwgdHJhbnNwYXJlbnQpIiAvPgogICAgPC9nPgogICAgPGcgaWQ9InRleHRfMjMiPgogICAgIDx0ZXh0IHN0eWxlPSJmb250LXNpemU6IDExcHg7IGZvbnQtZmFtaWx5OiB2YXIoLS1wLWZvbnQpOyB0ZXh0LWFuY2hvcjogc3RhcnQ7IGZpbGw6IHZhcigtLXAtaW5rKSIgeD0iOTcuODk1ODU5IiB5PSI3NS40MzcyOTciIHRyYW5zZm9ybT0icm90YXRlKC0wIDk3Ljg5NTg1OSA3NS40MzcyOTcpIj50cnVlIHVsdGltYXRlPC90ZXh0PgogICAgPC9nPgogICA8L2c+CiAgPC9nPgogPC9nPgogPGRlZnM+CiAgPGNsaXBwYXRoIGlkPSJwMThmZmJlYTg3ZiI+CiAgIDxyZWN0IHg9IjU3LjE5NTg1OSIgeT0iMjQuMTc3Mjk3IiB3aWR0aD0iMzkwLjYiIGhlaWdodD0iMTk5LjU4NCIgLz4KICA8L2NsaXBwYXRoPgogPC9kZWZzPgo8L3N2Zz4=" />
</figure>


The chain ladder does not see unreported losses: 2024's layer is empty at 12 months, so its ultimate is zero, and the single small claim of 2023 develops to only 43,614. The BF puts the expected layer loss on the unreported part, so it is the usual method for an immature layer, and its total is nearer the truth. Where the layer losses are nearly all reported (2016 to 2019), the methods agree. This is one book; section 5 compares them over a hundred.

Mack's standard error is large against its reserve: the selected pattern has no parameter error, and the process error of a few claims is large.


# 5. Blending with the layer's own development

When a layer has data of its own, blend the derived pattern with its own factors: `f = w f_derived + (1 - w) f_own`, with `w = 1 - n / (n + k)` at each age. [n](../reference/pricing.TrendFit.md#prospicio.pricing.TrendFit.n) is the number of layer claims at the earlier age (with a `counts=` column), or else the number of origins with a positive earlier value. [k](../reference/models.TargetEncoding.md#prospicio.models.TargetEncoding.k) is a required credibility constant; the simulation study's candidate, `k = 20`, is used here. A cap limits the credibility further: removing any one origin moves the blended factor by at most `max_influence` of it (0.1 here), so one very large link ratio cannot dominate. Where the layer's own factor cannot be estimated, the weight is exactly 1:


``` python
weights = {}
for name in ("high", "working"):
    w = derived[name].credibility_weights(book, name, 20.0, 0.1, counts=name + "_n")
    weights[name + " layer"] = [w[a] for a in AGES[:-1]]
weights = pd.DataFrame({"link": [f"{a} to {a + 12}" for a in AGES[:-1]], **weights})
(GT(weights, rowname_col="link")
 .tab_header("Weight on the derived pattern", "Months; k = 20, max_influence = 0.1")
 .fmt_number(["high layer", "working layer"], decimals=3))
```


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

#nuxnkkhqzy thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#nuxnkkhqzy p { margin: 0; padding: 0; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .gt_column_spanner_outer:first-child { padding-left: 0; }
 #nuxnkkhqzy .gt_column_spanner_outer:last-child { padding-right: 0; }
 #nuxnkkhqzy .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%; }
 #nuxnkkhqzy .gt_spanner_row { border-bottom-style: hidden; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .gt_from_md> :first-child { margin-top: 0; }
 #nuxnkkhqzy .gt_from_md> :last-child { margin-bottom: 0; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .gt_indent_1 { text-indent: 5px; }
 #nuxnkkhqzy .gt_indent_2 { text-indent: calc(5px * 2); }
 #nuxnkkhqzy .gt_indent_3 { text-indent: calc(5px * 3); }
 #nuxnkkhqzy .gt_indent_4 { text-indent: calc(5px * 4); }
 #nuxnkkhqzy .gt_indent_5 { text-indent: calc(5px * 5); }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .gt_row_group_first td { border-top-width: 2px; }
 #nuxnkkhqzy .gt_row_group_first th { border-top-width: 2px; }
 #nuxnkkhqzy .gt_striped { color: #333333; background-color: #F4F4F4; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #nuxnkkhqzy .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #nuxnkkhqzy .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #nuxnkkhqzy .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #nuxnkkhqzy .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #nuxnkkhqzy .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #nuxnkkhqzy .gt_left { text-align: left; }
 #nuxnkkhqzy .gt_center { text-align: center; }
 #nuxnkkhqzy .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #nuxnkkhqzy .gt_font_normal { font-weight: normal; }
 #nuxnkkhqzy .gt_font_bold { font-weight: bold; }
 #nuxnkkhqzy .gt_font_italic { font-style: italic; }
 #nuxnkkhqzy .gt_super { font-size: 65%; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #nuxnkkhqzy .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; }
 #nuxnkkhqzy .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #nuxnkkhqzy .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #nuxnkkhqzy .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">Weight on the derived pattern</th>
</tr>
<tr class="gt_heading">
<th colspan="3" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Months; k = 20, max_influence = 0.1</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="high-layer" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">high layer</th>
<th id="working-layer" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">working layer</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">12 to 24</th>
<td class="gt_row gt_right" headers="stub-1 high-layer">0.909</td>
<td class="gt_row gt_right" headers="stub-1 working-layer">0.556</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">24 to 36</th>
<td class="gt_row gt_right" headers="stub-2 high-layer">0.741</td>
<td class="gt_row gt_right" headers="stub-2 working-layer">0.455</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">36 to 48</th>
<td class="gt_row gt_right" headers="stub-3 high-layer">0.714</td>
<td class="gt_row gt_right" headers="stub-3 working-layer">0.426</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">48 to 60</th>
<td class="gt_row gt_right" headers="stub-4 high-layer">0.714</td>
<td class="gt_row gt_right" headers="stub-4 working-layer">0.426</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">60 to 72</th>
<td class="gt_row gt_right" headers="stub-5 high-layer">0.714</td>
<td class="gt_row gt_right" headers="stub-5 working-layer">0.444</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">72 to 84</th>
<td class="gt_row gt_right" headers="stub-6 high-layer">0.769</td>
<td class="gt_row gt_right" headers="stub-6 working-layer">0.476</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">84 to 96</th>
<td class="gt_row gt_right" headers="stub-7 high-layer">0.800</td>
<td class="gt_row gt_right" headers="stub-7 working-layer">0.513</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">96 to 108</th>
<td class="gt_row gt_right" headers="stub-8 high-layer">0.870</td>
<td class="gt_row gt_right" headers="stub-8 working-layer">0.606</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">108 to 120</th>
<td class="gt_row gt_right" headers="stub-9 high-layer">1.000</td>
<td class="gt_row gt_right" headers="stub-9 working-layer">0.741</td>
</tr>
</tbody>
</table>


The high layer's few claims leave most of the weight on the derived pattern, and exactly 1 at the oldest age, where the zero of 2015 gives no own factor. Pass the weights to [selected](../reference/aggregate.GridAudit.md#prospicio.aggregate.GridAudit.selected): `ChainLadder(tail=p.tail, **p.selected(w))`.

One book cannot rank the methods, because a few large claims decide the result. So we simulate a hundred books (seeds 1 to 100, the same model) and compare the error of each layer's total ultimate under four methods: the layer's own chain ladder, the derived pattern, the blend with `k = 20`, and the BF with the derived pattern. Mean error and root mean square error (RMSE) are relative to the mean true ultimate:


``` python
errors = {}
for seed in range(1, 101):
    b, t = simulate(seed)
    for name, layer in (("high", HIGH), ("working", WORKING)):
        q = ExcessPattern.from_ground_up(b, "incurred", layer, ScaleShift(SEV), tail=TAIL)
        w = q.credibility_weights(b, name, 20.0, 0.1, counts=name + "_n")
        lb = layer_exposure(b, "premium", layer_share(SEV, layer), "layer_premium")
        methods = {
            "own chain ladder": lambda: ChainLadder(tail=TAIL).fit(b, name),
            "derived pattern": lambda: ChainLadder(tail=q.tail, **q.selected()).fit(b, name),
            "blend, k = 20": lambda: ChainLadder(tail=q.tail, **q.selected(w)).fit(b, name),
            "BF, derived": lambda: BornhuetterFerguson(apriori=elr, tail=q.tail, **q.selected())
            .fit(lb, name, "layer_premium"),
        }
        for label, fit in methods.items():
            try:
                error = sum(fit().ultimate) - sum(t[name])
            except ValueError:  # the own factors cannot be estimated
                error = None
            errors.setdefault((name, label), []).append((error, sum(t[name])))

study = []
for (name, label), v in errors.items():
    ok = [e for e, _ in v if e is not None]
    mean_truth = sum(t for _, t in v) / len(v)
    study.append({"method": f"{name}, {label}", "runs": len(ok),
                  "mean error (%)": 100 * sum(ok) / len(ok) / mean_truth,
                  "RMSE (%)": 100 * math.sqrt(sum(e * e for e in ok) / len(ok)) / mean_truth})
(GT(pd.DataFrame(study), rowname_col="method")
 .tab_header("Error of the total ultimate over 100 simulated books")
 .fmt_number("mean error (%)", decimals=1, force_sign=True)
 .fmt_number("RMSE (%)", decimals=1)
 .fmt_integer("runs"))
```


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

#exbrcdewrb thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#exbrcdewrb p { margin: 0; padding: 0; }
 #exbrcdewrb .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; }
 #exbrcdewrb .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #exbrcdewrb .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; }
 #exbrcdewrb .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; }
 #exbrcdewrb .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; }
 #exbrcdewrb .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #exbrcdewrb .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; }
 #exbrcdewrb .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; }
 #exbrcdewrb .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; }
 #exbrcdewrb .gt_column_spanner_outer:first-child { padding-left: 0; }
 #exbrcdewrb .gt_column_spanner_outer:last-child { padding-right: 0; }
 #exbrcdewrb .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%; }
 #exbrcdewrb .gt_spanner_row { border-bottom-style: hidden; }
 #exbrcdewrb .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; }
 #exbrcdewrb .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; }
 #exbrcdewrb .gt_from_md> :first-child { margin-top: 0; }
 #exbrcdewrb .gt_from_md> :last-child { margin-bottom: 0; }
 #exbrcdewrb .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; }
 #exbrcdewrb .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; }
 #exbrcdewrb .gt_indent_1 { text-indent: 5px; }
 #exbrcdewrb .gt_indent_2 { text-indent: calc(5px * 2); }
 #exbrcdewrb .gt_indent_3 { text-indent: calc(5px * 3); }
 #exbrcdewrb .gt_indent_4 { text-indent: calc(5px * 4); }
 #exbrcdewrb .gt_indent_5 { text-indent: calc(5px * 5); }
 #exbrcdewrb .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; }
 #exbrcdewrb .gt_row_group_first td { border-top-width: 2px; }
 #exbrcdewrb .gt_row_group_first th { border-top-width: 2px; }
 #exbrcdewrb .gt_striped { color: #333333; background-color: #F4F4F4; }
 #exbrcdewrb .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; }
 #exbrcdewrb .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #exbrcdewrb .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #exbrcdewrb .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #exbrcdewrb .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #exbrcdewrb .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #exbrcdewrb .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #exbrcdewrb .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; }
 #exbrcdewrb .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #exbrcdewrb .gt_left { text-align: left; }
 #exbrcdewrb .gt_center { text-align: center; }
 #exbrcdewrb .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #exbrcdewrb .gt_font_normal { font-weight: normal; }
 #exbrcdewrb .gt_font_bold { font-weight: bold; }
 #exbrcdewrb .gt_font_italic { font-style: italic; }
 #exbrcdewrb .gt_super { font-size: 65%; }
 #exbrcdewrb .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; }
 #exbrcdewrb .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #exbrcdewrb .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; }
 #exbrcdewrb .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #exbrcdewrb .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #exbrcdewrb .gt_asterisk { font-size: 100%; vertical-align: 0; }
 
</style>

<table class="gt_table" aria-labelledby="title" 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">Error of the total ultimate over 100 simulated books</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="runs" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">runs</th>
<th id="mean-error" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">mean error (%)</th>
<th id="RMSE" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">RMSE (%)</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">high, own chain ladder</th>
<td class="gt_row gt_right" headers="stub-1 runs">93</td>
<td class="gt_row gt_right" headers="stub-1 mean-error">+19.2</td>
<td class="gt_row gt_right" headers="stub-1 RMSE">95.1</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">high, derived pattern</th>
<td class="gt_row gt_right" headers="stub-2 runs">100</td>
<td class="gt_row gt_right" headers="stub-2 mean-error">−3.9</td>
<td class="gt_row gt_right" headers="stub-2 RMSE">15.5</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">high, blend, k = 20</th>
<td class="gt_row gt_right" headers="stub-3 runs">100</td>
<td class="gt_row gt_right" headers="stub-3 mean-error">−1.9</td>
<td class="gt_row gt_right" headers="stub-3 RMSE">19.4</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">high, BF, derived</th>
<td class="gt_row gt_right" headers="stub-4 runs">100</td>
<td class="gt_row gt_right" headers="stub-4 mean-error">+0.5</td>
<td class="gt_row gt_right" headers="stub-4 RMSE">9.5</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">working, own chain ladder</th>
<td class="gt_row gt_right" headers="stub-5 runs">100</td>
<td class="gt_row gt_right" headers="stub-5 mean-error">−0.3</td>
<td class="gt_row gt_right" headers="stub-5 RMSE">13.1</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">working, derived pattern</th>
<td class="gt_row gt_right" headers="stub-6 runs">100</td>
<td class="gt_row gt_right" headers="stub-6 mean-error">−2.0</td>
<td class="gt_row gt_right" headers="stub-6 RMSE">8.1</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">working, blend, k = 20</th>
<td class="gt_row gt_right" headers="stub-7 runs">100</td>
<td class="gt_row gt_right" headers="stub-7 mean-error">−1.2</td>
<td class="gt_row gt_right" headers="stub-7 RMSE">9.9</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">working, BF, derived</th>
<td class="gt_row gt_right" headers="stub-8 runs">100</td>
<td class="gt_row gt_right" headers="stub-8 mean-error">−0.6</td>
<td class="gt_row gt_right" headers="stub-8 RMSE">4.4</td>
</tr>
</tbody>
</table>


The own chain ladder fails on seven high-layer books. Where it runs, it overstates the high layer by a fifth, with an RMSE near the full ultimate, because the early link ratios of a few claims are very large. The derived pattern cuts the RMSE to a fraction of that on both layers; it is a little low because an origin with no loss yet in the layer stays at zero. The BF is best, because it does not multiply the chance results of the immature years, but the test favours it: it uses the true loss ratio and severity, and a real prior only approximates them.

Here the model holds exactly, so the derived pattern needs no help. The reason to blend is that the severity assumption may be wrong: in the simulation study, under shape drift, a blend near `k = 20` beat both the derived pattern and the own factors on the thin layer, and without the `max_influence` cap a small [k](../reference/models.TargetEncoding.md#prospicio.models.TargetEncoding.k) gave very large errors on the sparse layer.


# 6. A Bornhuetter-Ferguson prior from the layer share

The a-priori layer ultimate of origin `i` is its exposure times a ground-up expected loss ratio times the layer share `s`, the expected share of ground-up loss in the layer. For a severity, `s = (LEV(b) - LEV(a)) / mean` on the ultimate basis ([layer_share](../reference/reserving.layer_share.md#prospicio.reserving.layer_share)); for an exposure curve, use the curve's own `layer_share(limit, attachment, mpl)` ([Mbbefd](../reference/pricing.Mbbefd.md#prospicio.pricing.Mbbefd), [TabulatedCurve](../reference/pricing.TabulatedCurve.md#prospicio.pricing.TabulatedCurve)). [layer_exposure](../reference/reserving.layer_exposure.md#prospicio.reserving.layer_exposure) copies the triangle with the exposure column times the share (one share, or one per origin), and each expected-loss method accepts the copy as its exposure. Cape Cod, unlike the BF of section 4, estimates the layer's loss ratio from the layer's own used-up exposure, through the same derived pattern:


``` python
from prospicio.reserving import CapeCod

cc = CapeCod(tail=p.tail, **p.selected()).fit(layered, "high", "high_premium")
true_ratio = sum(truth["high"]) / (len(YEARS) * PREMIUM * share)
methods = pd.DataFrame({
    "method": ["BF (the ground-up ELR)", "Cape Cod", "True"],
    "loss ratio": [elr, cc.apriori[0], true_ratio],
    "total ultimate": [sum(bf.ultimate), sum(cc.ultimate), sum(truth["high"])]})
(GT(methods, rowname_col="method")
 .tab_header("Loss ratio and total ultimate of the high layer",
             "Loss ratio to the layer premium; currency units")
 .fmt_number("loss ratio", decimals=4)
 .fmt_integer("total ultimate"))
```


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

#lrowrdrwsc thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#lrowrdrwsc p { margin: 0; padding: 0; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .gt_column_spanner_outer:first-child { padding-left: 0; }
 #lrowrdrwsc .gt_column_spanner_outer:last-child { padding-right: 0; }
 #lrowrdrwsc .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%; }
 #lrowrdrwsc .gt_spanner_row { border-bottom-style: hidden; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .gt_from_md> :first-child { margin-top: 0; }
 #lrowrdrwsc .gt_from_md> :last-child { margin-bottom: 0; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .gt_indent_1 { text-indent: 5px; }
 #lrowrdrwsc .gt_indent_2 { text-indent: calc(5px * 2); }
 #lrowrdrwsc .gt_indent_3 { text-indent: calc(5px * 3); }
 #lrowrdrwsc .gt_indent_4 { text-indent: calc(5px * 4); }
 #lrowrdrwsc .gt_indent_5 { text-indent: calc(5px * 5); }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .gt_row_group_first td { border-top-width: 2px; }
 #lrowrdrwsc .gt_row_group_first th { border-top-width: 2px; }
 #lrowrdrwsc .gt_striped { color: #333333; background-color: #F4F4F4; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #lrowrdrwsc .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #lrowrdrwsc .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #lrowrdrwsc .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #lrowrdrwsc .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #lrowrdrwsc .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #lrowrdrwsc .gt_left { text-align: left; }
 #lrowrdrwsc .gt_center { text-align: center; }
 #lrowrdrwsc .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #lrowrdrwsc .gt_font_normal { font-weight: normal; }
 #lrowrdrwsc .gt_font_bold { font-weight: bold; }
 #lrowrdrwsc .gt_font_italic { font-style: italic; }
 #lrowrdrwsc .gt_super { font-size: 65%; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #lrowrdrwsc .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; }
 #lrowrdrwsc .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #lrowrdrwsc .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #lrowrdrwsc .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">Loss ratio and total ultimate of the high layer</th>
</tr>
<tr class="gt_heading">
<th colspan="3" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Loss ratio to the layer premium; currency units</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="loss-ratio" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">loss ratio</th>
<th id="total-ultimate" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">total ultimate</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">BF (the ground-up ELR)</th>
<td class="gt_row gt_right" headers="stub-1 loss-ratio">0.6618</td>
<td class="gt_row gt_right" headers="stub-1 total-ultimate">3,888,113</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">Cape Cod</th>
<td class="gt_row gt_right" headers="stub-2 loss-ratio">0.3702</td>
<td class="gt_row gt_right" headers="stub-2 total-ultimate">3,264,359</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">True</th>
<td class="gt_row gt_right" headers="stub-3 loss-ratio">0.4544</td>
<td class="gt_row gt_right" headers="stub-3 total-ultimate">4,006,410</td>
</tr>
</tbody>
</table>


This book is light: its layer losses are about two thirds of what the prior expects. Cape Cod follows the experience down, below the true ratio; the BF keeps the prior's weight on the immature years.

The share is an estimate, and its error belongs in the distribution of the reserve. `LayerSharePrior` puts it there through the normalised Bayesian BF (`BayesBfNormalised`): the layer's expected ultimate gets a gamma prior with mean `ELR x share x exposure` and, for a product of independent variables, `cv^2 = (1 + cv_elr^2)(1 + cv_share^2) - 1`. The model estimates its pattern from the layer's own triangle under a vague prior, so the derived excess pattern does not enter and an own factor is needed at every age. The high layer has none at its oldest age, so this part uses the working layer:


``` python
from prospicio.reserving import BayesBfNormalised, LayerSharePrior

working_share = layer_share(SEV, WORKING)
prior = LayerSharePrior(elr, working_share, apriori_cv=0.1, share_cv=0.3)
print(f"working layer share {working_share:.4f}; prior cv {prior.cv:.4f} "
      f"= sqrt(1.01 x 1.09 - 1) = {math.sqrt(1.01 * 1.09 - 1):.4f}")
fit = prior.fit(book, "working", "premium", model=BayesBfNormalised(seed=1, n_sims=2000))
print(f"prior ultimate a year {fit.prior_ultimate[0]:,.0f} "
      f"= {elr:.4f} x {working_share:.4f} x {PREMIUM:,.0f}")
```


    working layer share 0.2590; prior cv 0.3176 = sqrt(1.01 x 1.09 - 1) = 0.3176
    prior ultimate a year 942,605 = 0.6618 x 0.2590 x 5,500,000


The posterior is a Monte Carlo result whose last digits differ between platforms (see [`reserving-meyers.md`](reserving-meyers.md)), so the guide prints only the exact prior. `fit.reserves` is the predictive distribution of the reserve.

The layer has one share, so its error is common to every origin. `LayerSharePrior` models it so by default (`share_dependence="common"`, \#518): one gamma multiplier with mean 1 and cv `share_cv` applies to every origin's prior and is drawn with the other parameters, so all origins update the share together. `"per_origin"` draws an independent error at each origin. Each origin's prior is the same under both, the prior of the total is not; `prior_total` gives it in closed form:


``` python
exposure = [PREMIUM] * len(YEARS)
for dependence in ("common", "per_origin"):
    p = LayerSharePrior(elr, working_share, apriori_cv=0.1, share_cv=0.3,
                        share_dependence=dependence)
    mean, sd = p.prior_total(exposure)
    print(f"{dependence:10}  prior total mean {mean:,.0f}  sd {sd:,.0f}")
```


    common      prior total mean 9,426,049  sd 2,844,887
    per_origin  prior total mean 9,426,049  sd 946,837


Independent errors understate the prior sd of the total by a factor of three. The posterior moves the other way: when the ten origins identify the share, each origin stays near its prior with the loss ratio's own cv, so the common share gives the narrower fitted interval.

On a validation layer (a quarter of GenIns's paid triangle, in `knowledge/findings/excess-bayes-prior.md`), the mean total-reserve sd over seeds 1 to 20 (common share) or 10 (independent errors) was about 497,000 at a share cv of 0.3 under the common share, and rose only about 2% as the cv went to 1.5. Under independent errors it rose from 514,000 to 730,000 (about 42%). One fit's sd moves by about 1.5% between seeds, so compare runs over several seeds. Where the data cannot identify the share (few origins, or all origins immature), the common model's total stays wider.


# See also

- [`reserving-methods.md`](reserving-methods.md): which reserving method to use when.
- [`choosing-a-method.md`](choosing-a-method.md): the library's methods by question.
- [`experience-and-exposure-rating.md`](experience-and-exposure-rating.md): claim-level development (IBNER) with [DevelopmentPattern](../reference/pricing.DevelopmentPattern.md#prospicio.pricing.DevelopmentPattern).
- `docs/design/reserving-excess.md`: the method, the API and the validation targets as designed, with the simulation study's results.
- `python/tests/test_reserving_excess.py` and `python/tests/test_reserving_bayes_excess_prior.py`: the bindings' tests.
