# Stochastic loss reserving with GLMs: Taylor and McGuire reproduced

CAS Monograph 3 is *Stochastic Loss Reserving Using Generalized Linear Models* (Greg Taylor and Gráinne McGuire, 2016). It shows that the chain ladder is a generalized linear model (GLM), puts a prediction error on the reserve, checks the model with residuals and improves it with fewer parameters and some interactions, all on one triangle. This guide runs the examples in prospicio and shows the monograph's numbers beside prospicio's.

Table and figure numbers are the monograph's. The explanations are new and the numbers are recomputed. Money is in thousands of dollars. To choose a reserving method in general, read [`reserving-methods.md`](reserving-methods.md).

`prospicio.reserving` has the chain ladder, Mack, the ODP bootstrap and the ODP GLM (`OdpGlm`) on a [Triangle](../reference/reserving.Triangle.md#prospicio.reserving.Triangle). `OdpGlm` fits the cross-classified model by default and gives the analytic prediction error, simulated reserves and residual diagnostics. `OdpGlm.cells` lists the triangle's cells: write any other design on them and pass it to `fit(..., design=)`. Each model of chapter 7 is the same call with another design. `prospicio.models` has the general GLM ([Glm](../reference/models.Glm.md#prospicio.models.Glm), [Design](../reference/models.Design.md#prospicio.models.Design)), which fits the ODP Mack model of section 2.


# 1. The data and the chain ladder

The monograph's example (Table 1-1) is the incremental paid triangle of a New Jersey workers compensation insurer, accident years 1988 to 1997, from the database of Meyers and Shi (2011). Its age-to-age factors are almost constant down each column, so the chain ladder fits it well.


``` python
import math

import numpy as np

from prospicio.models import Design, Glm
from prospicio.reserving import ChainLadder, Mack, OdpBootstrap, OdpGlm, Triangle

INCREMENTS = [  # Table 1-1, accident years 1988 to 1997, development years 1 to 10
    [41821, 34729, 20147, 15965, 11285, 5924, 4775, 3742, 3435, 2958],
    [48167, 39495, 24444, 18178, 10840, 7379, 5683, 4758, 3959],
    [52058, 47459, 27359, 17916, 11448, 8846, 5869, 5391],
    [57251, 49510, 27036, 20871, 14304, 10552, 7742],
    [59213, 54129, 29566, 22484, 14114, 10000],
    [59475, 52076, 26836, 22332, 14756],
    [65607, 44648, 27062, 22655],
    [56748, 39315, 26748],
    [52212, 40030],
    [43962],
]
K = len(INCREMENTS)
YEARS = list(range(1988, 1988 + K))
cumulative = [np.cumsum(row) for row in INCREMENTS]
tri = Triangle.from_long(
    [YEARS[k] for k, row in enumerate(cumulative) for _ in row],
    [12 * (j + 1) for row in cumulative for j in range(len(row))],
    {"paid": [float(v) for row in cumulative for v in row]},
)
cl = ChainLadder().fit(tri, "paid")
print("factors ", " ".join(f"{f:.3f}" for f in cl.ldf))
print("reserves", [round(r) for r in cl.reserve[1:]])
print("total   ", round(cl.total_reserve))
```


    factors  1.815 1.261 1.158 1.088 1.055 1.039 1.030 1.025 1.021
    reserves [3398, 8155, 14579, 22645, 31865, 45753, 60093, 80983, 105874]
    total    373346


The volume-weighted factors are Table 3-1 and the reserves the last column of Table 3-2, to the unit.


# 2. The chain ladder as a GLM

Chapter 3 gives two models that reproduce the chain ladder's forecasts. The monograph uses the *cross-classified* ODP model from then on. Each incremental payment `Y[k, j]` is over-dispersed Poisson (ODP) with mean `a[k] * b[j]`, a row effect times a column effect, and variance [phi](../reference/reserving.PaidIncurredFit.md#prospicio.reserving.PaidIncurredFit.phi) times the mean.

On the log scale this is a GLM with a log link and an indicator column for each accident year and development year. The design drops one column effect for full rank: the monograph sets `ln b[1] = 0`, so the accident-year terms carry the level.

`OdpGlm().fit(tri, "paid")` uses an intercept and factors from the first level; the monograph uses one `ln a[k]` per accident year and no intercept. To print that coding, give [fit](../reference/risk.Gpd.md#prospicio.risk.Gpd.fit) that design on `OdpGlm.cells`: the 100 cells (55 observed, 45 to forecast), in the order a design's rows must follow, with 0-based accident and development indices:


``` python
import pandas as pd
from great_tables import GT

cells = OdpGlm.cells(tri, "paid")
k = np.array(cells["origin_index"]) + 1  # accident year, 1 to 10
j = np.array(cells["development_index"]) + 1  # development year, 1 to 10


def fit(columns, names):
    """The ODP GLM of the triangle, one design column per array (or constant) over the cells."""
    x = [np.broadcast_to(np.asarray(c, float), k.shape).tolist() for c in columns]
    return OdpGlm().fit(tri, "paid", design=Design(x, names))


cc = fit([k == a for a in range(1, K + 1)] + [j == b for b in range(2, K + 1)],
         [f"ln a{a}" for a in range(1, K + 1)] + [f"ln b{b}" for b in range(2, K + 1)])

est, se = cc.glm.coefficients, cc.glm.std_errors
table_5_1 = pd.DataFrame({
    "index": [str(i) for i in range(1, K + 1)],
    "ln_a": est[:K],
    "se_a": se[:K],
    "ln_b": [0.0, *est[K:]],
    "se_b": [np.nan, *se[K:]],
})
(GT(table_5_1, rowname_col="index")
 .tab_header("Table 5-1: the cross-classified model",
             "Accident year k for ln a, development year j for ln b; ln b[1] = 0")
 .cols_label(ln_a="ln a", se_a="s.e.", ln_b="ln b", se_b="s.e.")
 .fmt_number(["ln_a", "ln_b"], decimals=3)
 .fmt_number(["se_a", "se_b"], decimals=4)
 .sub_missing(missing_text=""))
```


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

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

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="5" id="title" class="gt_heading gt_title gt_font_normal">Table 5-1: the cross-classified model</th>
</tr>
<tr class="gt_heading">
<th colspan="5" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Accident year k for ln a, development year j for ln b; ln b[1] = 0</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="ln_a" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">ln a</th>
<th id="se_a" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">s.e.</th>
<th id="ln_b" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">ln b</th>
<th id="se_b" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">s.e.</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">1</th>
<td class="gt_row gt_right" headers="stub-1 ln_a">10.657</td>
<td class="gt_row gt_right" headers="stub-1 se_a">0.0316</td>
<td class="gt_row gt_right" headers="stub-1 ln_b">0.000</td>
<td class="gt_row gt_right" headers="stub-1 se_b"></td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">2</th>
<td class="gt_row gt_right" headers="stub-2 ln_a">10.795</td>
<td class="gt_row gt_right" headers="stub-2 se_a">0.0299</td>
<td class="gt_row gt_right" headers="stub-2 ln_b">−0.205</td>
<td class="gt_row gt_right" headers="stub-2 se_b">0.0228</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">3</th>
<td class="gt_row gt_right" headers="stub-3 ln_a">10.899</td>
<td class="gt_row gt_right" headers="stub-3 se_a">0.0289</td>
<td class="gt_row gt_right" headers="stub-3 ln_b">−0.747</td>
<td class="gt_row gt_right" headers="stub-3 se_b">0.0282</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">4</th>
<td class="gt_row gt_right" headers="stub-4 ln_a">10.989</td>
<td class="gt_row gt_right" headers="stub-4 se_a">0.0281</td>
<td class="gt_row gt_right" headers="stub-4 ln_b">−1.017</td>
<td class="gt_row gt_right" headers="stub-4 se_b">0.0328</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">5</th>
<td class="gt_row gt_right" headers="stub-5 ln_a">11.039</td>
<td class="gt_row gt_right" headers="stub-5 se_a">0.0278</td>
<td class="gt_row gt_right" headers="stub-5 ln_b">−1.452</td>
<td class="gt_row gt_right" headers="stub-5 se_b">0.0421</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">6</th>
<td class="gt_row gt_right" headers="stub-6 ln_a">11.016</td>
<td class="gt_row gt_right" headers="stub-6 se_a">0.0285</td>
<td class="gt_row gt_right" headers="stub-6 ln_b">−1.833</td>
<td class="gt_row gt_right" headers="stub-6 se_b">0.0547</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">7</th>
<td class="gt_row gt_right" headers="stub-7 ln_a">11.008</td>
<td class="gt_row gt_right" headers="stub-7 se_a">0.0295</td>
<td class="gt_row gt_right" headers="stub-7 ln_b">−2.140</td>
<td class="gt_row gt_right" headers="stub-7 se_b">0.0715</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">8</th>
<td class="gt_row gt_right" headers="stub-8 ln_a">10.891</td>
<td class="gt_row gt_right" headers="stub-8 se_a">0.0327</td>
<td class="gt_row gt_right" headers="stub-8 ln_b">−2.348</td>
<td class="gt_row gt_right" headers="stub-8 se_b">0.0931</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">9</th>
<td class="gt_row gt_right" headers="stub-9 ln_a">10.836</td>
<td class="gt_row gt_right" headers="stub-9 se_a">0.0367</td>
<td class="gt_row gt_right" headers="stub-9 ln_b">−2.513</td>
<td class="gt_row gt_right" headers="stub-9 se_b">0.1267</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">10</th>
<td class="gt_row gt_right" headers="stub-10 ln_a">10.691</td>
<td class="gt_row gt_right" headers="stub-10 se_a">0.0510</td>
<td class="gt_row gt_right" headers="stub-10 ln_b">−2.664</td>
<td class="gt_row gt_right" headers="stub-10 se_b">0.1993</td>
</tr>
</tbody>
</table>


This is Table 5-1 and the first two columns of Table 3-5, digit for digit. [phi](../reference/reserving.PaidIncurredFit.md#prospicio.reserving.PaidIncurredFit.phi) is the Pearson chi-square over the 55 - 19 = 36 residual degrees of freedom, as SAS GENMOD gives with `PSCALE`: the monograph's 114.5 (section 5.4.2). `cc.glm` is the underlying GLM fit, coefficients in design order.


``` python
print(f"phi {cc.dispersion:.1f} on {cc.glm.df_resid:.0f} degrees of freedom")
```


    phi 114.5 on 36 degrees of freedom


Rescale the effects so that the `b[j]` add to 1 (Table 3-3): `b[j]` is the share of the ultimate paid in development year `j`, and `a[k]` the ultimate of accident year [k](../reference/models.TargetEncoding.md#prospicio.models.TargetEncoding.k). The reserve is the forecast of the future cells by accident year:


``` python
a = np.exp(est[:K])
b = np.exp([0.0, *est[K:]])
gap = max(abs(g - c) for g, c in zip(cc.reserves[1:], cl.reserve[1:]))
table_3_3 = pd.DataFrame({
    "index": [str(i) for i in range(1, K + 1)],
    "ultimate": a * b.sum(),
    "pattern": b / b.sum(),
    "reserve": cc.reserves,
})
(GT(table_3_3, rowname_col="index")
 .tab_header("Table 3-3: ultimates and payment pattern",
             "Ultimate and reserve by accident year k, pattern by development year j")
 .fmt_integer(["ultimate", "reserve"])
 .fmt_number("pattern", decimals=3))
```


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

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

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="4" id="title" class="gt_heading gt_title gt_font_normal">Table 3-3: ultimates and payment pattern</th>
</tr>
<tr class="gt_heading">
<th colspan="4" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Ultimate and reserve by accident year k, pattern by development year j</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="pattern" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">pattern</th>
<th id="reserve" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">reserve</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">1</th>
<td class="gt_row gt_right" headers="stub-1 ultimate">144,781</td>
<td class="gt_row gt_right" headers="stub-1 pattern">0.293</td>
<td class="gt_row gt_right" headers="stub-1 reserve">0</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">2</th>
<td class="gt_row gt_right" headers="stub-2 ultimate">166,301</td>
<td class="gt_row gt_right" headers="stub-2 pattern">0.239</td>
<td class="gt_row gt_right" headers="stub-2 reserve">3,398</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">3</th>
<td class="gt_row gt_right" headers="stub-3 ultimate">184,501</td>
<td class="gt_row gt_right" headers="stub-3 pattern">0.139</td>
<td class="gt_row gt_right" headers="stub-3 reserve">8,155</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">4</th>
<td class="gt_row gt_right" headers="stub-4 ultimate">201,845</td>
<td class="gt_row gt_right" headers="stub-4 pattern">0.106</td>
<td class="gt_row gt_right" headers="stub-4 reserve">14,579</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">5</th>
<td class="gt_row gt_right" headers="stub-5 ultimate">212,151</td>
<td class="gt_row gt_right" headers="stub-5 pattern">0.069</td>
<td class="gt_row gt_right" headers="stub-5 reserve">22,645</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">6</th>
<td class="gt_row gt_right" headers="stub-6 ultimate">207,340</td>
<td class="gt_row gt_right" headers="stub-6 pattern">0.047</td>
<td class="gt_row gt_right" headers="stub-6 reserve">31,865</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">7</th>
<td class="gt_row gt_right" headers="stub-7 ultimate">205,725</td>
<td class="gt_row gt_right" headers="stub-7 pattern">0.035</td>
<td class="gt_row gt_right" headers="stub-7 reserve">45,753</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">8</th>
<td class="gt_row gt_right" headers="stub-8 ultimate">182,904</td>
<td class="gt_row gt_right" headers="stub-8 pattern">0.028</td>
<td class="gt_row gt_right" headers="stub-8 reserve">60,093</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">9</th>
<td class="gt_row gt_right" headers="stub-9 ultimate">173,225</td>
<td class="gt_row gt_right" headers="stub-9 pattern">0.024</td>
<td class="gt_row gt_right" headers="stub-9 reserve">80,983</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">10</th>
<td class="gt_row gt_right" headers="stub-10 ultimate">149,836</td>
<td class="gt_row gt_right" headers="stub-10 pattern">0.020</td>
<td class="gt_row gt_right" headers="stub-10 reserve">105,874</td>
</tr>
</tbody>
</table>


``` python
print(f"GLM total reserve {cc.total_reserve:,.0f}")
print("largest gap to the chain ladder below 1e-6:", gap < 1e-6)
```


    GLM total reserve 373,346
    largest gap to the chain ladder below 1e-6: True


The table is Table 3-3. The last column of Table 3-5 differs by one unit in four places, because the monograph rounds. The GLM reserves equal the chain ladder's because maximum likelihood under the ODP makes the fitted total equal the actual total in each row and column, as the chain ladder does (chapter 3).

The other model of chapter 3, *ODP Mack*, works on the age-to-age factors. Each observed `f[k, j] - 1` is ODP with mean `f[j] - 1` and weight the cumulative paid `X[k, j]` at the start of the link. It is a GLM on the links, not the increments, with one column per development year, a log link and prior weights, so the general [Glm](../reference/models.Glm.md#prospicio.models.Glm) fits it (`dispersion="pearson"`):


``` python
links = [(k, j) for k in range(K - 1) for j in range(K - 1 - k)]
growth = [cumulative[k][j + 1] / cumulative[k][j] - 1.0 for k, j in links]
weight = [float(cumulative[k][j]) for k, j in links]
mack_design = Design(
    [[1.0 if j == d else 0.0 for _, j in links] for d in range(K - 1)],
    [f"f{d + 1}" for d in range(K - 1)],
    weights=weight,
)
odp_mack = Glm("poisson", "log", dispersion="pearson").fit(mack_design, growth)
print("f - 1", " ".join(f"{math.exp(c):.3f}" for c in odp_mack.coefficients))
```


    f - 1 0.815 0.261 0.158 0.088 0.055 0.039 0.030 0.025 0.021


These are Table 3-4: the chain-ladder factors minus one. The two models give the same forecast but not the same prediction error, because their variance assumptions differ (section 4).


# 3. Prediction error by the delta method

Chapter 5 puts a prediction error on the reserve. The mean square error of prediction (MSEP) of future cells has two parts:

- Process error is the variance of the cells: [phi](../reference/reserving.PaidIncurredFit.md#prospicio.reserving.PaidIncurredFit.phi) times their mean under the ODP.
- Parameter error comes from the estimated coefficients. To first order (the delta method), a reserve `R = sum of exp(x' beta)` moves by `g' (beta_hat - beta)`, with gradient `g = sum of mu * x` over its cells. Its variance is `g' Sigma g`, where `Sigma` is the covariance of the coefficients from the GLM.

`OdpGlmFit.prediction_error()` does this (equations 5-11 to 5-13) for each accident year and the total, for any design. The table splits the RMSEP into its two parts beside Table 5-4:


``` python
pe = cc.prediction_error()  # a row per accident year, then "Total"
TABLE_5_4 = {  # forecast, RMSEP, CVP %
    "1989": (3398, 924, 27.2), "1990": (8155, 1363, 16.7), "1991": (14579, 1775, 12.2),
    "1992": (22645, 2169, 9.6), "1993": (31865, 2523, 7.9), "1994": (45753, 3036, 6.6),
    "1995": (60093, 3577, 6.0), "1996": (80983, 4538, 5.6), "1997": (105874, 6786, 6.4),
    "Total": (373346, 14076, 3.8),
}
rows = []
for i, year in enumerate(pe["origin"][1:], start=1):
    forecast, rmsep, cvp = TABLE_5_4[year]
    rows += [(year, pe["reserve"][i], pe["process_se"][i], pe["parameter_se"][i], pe["rmsep"][i], 100 * pe["cv"][i]),
             (f"{year}, book", forecast, np.nan, np.nan, rmsep, cvp)]
table_5_4 = pd.DataFrame(rows, columns=["year", "forecast", "process_se", "parameter_se", "rmsep", "cvp"])
(GT(table_5_4, rowname_col="year")
 .tab_header("Table 5-4: reserve and prediction error by accident year",
             "Money in the units of the triangle; CVP in percent")
 .cols_label(process_se="process SE", parameter_se="parameter SE", rmsep="RMSEP", cvp="CVP %")
 .fmt_integer(["forecast", "process_se", "parameter_se", "rmsep"])
 .fmt_number("cvp", decimals=1)
 .sub_missing(missing_text=""))
```


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

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

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="6" id="title" class="gt_heading gt_title gt_font_normal">Table 5-4: reserve and prediction error by accident year</th>
</tr>
<tr class="gt_heading">
<th colspan="6" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Money in the units of the triangle; CVP in percent</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="forecast" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">forecast</th>
<th id="process_se" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">process SE</th>
<th id="parameter_se" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">parameter SE</th>
<th id="rmsep" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">RMSEP</th>
<th id="cvp" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">CVP %</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">1989</th>
<td class="gt_row gt_right" headers="stub-1 forecast">3,398</td>
<td class="gt_row gt_right" headers="stub-1 process_se">624</td>
<td class="gt_row gt_right" headers="stub-1 parameter_se">681</td>
<td class="gt_row gt_right" headers="stub-1 rmsep">924</td>
<td class="gt_row gt_right" headers="stub-1 cvp">27.2</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">1989, book</th>
<td class="gt_row gt_right" headers="stub-2 forecast">3,398</td>
<td class="gt_row gt_right" headers="stub-2 process_se"></td>
<td class="gt_row gt_right" headers="stub-2 parameter_se"></td>
<td class="gt_row gt_right" headers="stub-2 rmsep">924</td>
<td class="gt_row gt_right" headers="stub-2 cvp">27.2</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">1990</th>
<td class="gt_row gt_right" headers="stub-3 forecast">8,155</td>
<td class="gt_row gt_right" headers="stub-3 process_se">966</td>
<td class="gt_row gt_right" headers="stub-3 parameter_se">961</td>
<td class="gt_row gt_right" headers="stub-3 rmsep">1,363</td>
<td class="gt_row gt_right" headers="stub-3 cvp">16.7</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">1990, book</th>
<td class="gt_row gt_right" headers="stub-4 forecast">8,155</td>
<td class="gt_row gt_right" headers="stub-4 process_se"></td>
<td class="gt_row gt_right" headers="stub-4 parameter_se"></td>
<td class="gt_row gt_right" headers="stub-4 rmsep">1,363</td>
<td class="gt_row gt_right" headers="stub-4 cvp">16.7</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">1991</th>
<td class="gt_row gt_right" headers="stub-5 forecast">14,579</td>
<td class="gt_row gt_right" headers="stub-5 process_se">1,292</td>
<td class="gt_row gt_right" headers="stub-5 parameter_se">1,217</td>
<td class="gt_row gt_right" headers="stub-5 rmsep">1,775</td>
<td class="gt_row gt_right" headers="stub-5 cvp">12.2</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">1991, book</th>
<td class="gt_row gt_right" headers="stub-6 forecast">14,579</td>
<td class="gt_row gt_right" headers="stub-6 process_se"></td>
<td class="gt_row gt_right" headers="stub-6 parameter_se"></td>
<td class="gt_row gt_right" headers="stub-6 rmsep">1,775</td>
<td class="gt_row gt_right" headers="stub-6 cvp">12.2</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">1992</th>
<td class="gt_row gt_right" headers="stub-7 forecast">22,645</td>
<td class="gt_row gt_right" headers="stub-7 process_se">1,610</td>
<td class="gt_row gt_right" headers="stub-7 parameter_se">1,453</td>
<td class="gt_row gt_right" headers="stub-7 rmsep">2,169</td>
<td class="gt_row gt_right" headers="stub-7 cvp">9.6</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">1992, book</th>
<td class="gt_row gt_right" headers="stub-8 forecast">22,645</td>
<td class="gt_row gt_right" headers="stub-8 process_se"></td>
<td class="gt_row gt_right" headers="stub-8 parameter_se"></td>
<td class="gt_row gt_right" headers="stub-8 rmsep">2,169</td>
<td class="gt_row gt_right" headers="stub-8 cvp">9.6</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">1993</th>
<td class="gt_row gt_right" headers="stub-9 forecast">31,865</td>
<td class="gt_row gt_right" headers="stub-9 process_se">1,910</td>
<td class="gt_row gt_right" headers="stub-9 parameter_se">1,649</td>
<td class="gt_row gt_right" headers="stub-9 rmsep">2,523</td>
<td class="gt_row gt_right" headers="stub-9 cvp">7.9</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">1993, book</th>
<td class="gt_row gt_right" headers="stub-10 forecast">31,865</td>
<td class="gt_row gt_right" headers="stub-10 process_se"></td>
<td class="gt_row gt_right" headers="stub-10 parameter_se"></td>
<td class="gt_row gt_right" headers="stub-10 rmsep">2,523</td>
<td class="gt_row gt_right" headers="stub-10 cvp">7.9</td>
</tr>
<tr>
<th id="stub-11" class="gt_row gt_left gt_stub" scope="row">1994</th>
<td class="gt_row gt_right" headers="stub-11 forecast">45,753</td>
<td class="gt_row gt_right" headers="stub-11 process_se">2,289</td>
<td class="gt_row gt_right" headers="stub-11 parameter_se">1,994</td>
<td class="gt_row gt_right" headers="stub-11 rmsep">3,036</td>
<td class="gt_row gt_right" headers="stub-11 cvp">6.6</td>
</tr>
<tr>
<th id="stub-12" class="gt_row gt_left gt_stub" scope="row">1994, book</th>
<td class="gt_row gt_right" headers="stub-12 forecast">45,753</td>
<td class="gt_row gt_right" headers="stub-12 process_se"></td>
<td class="gt_row gt_right" headers="stub-12 parameter_se"></td>
<td class="gt_row gt_right" headers="stub-12 rmsep">3,036</td>
<td class="gt_row gt_right" headers="stub-12 cvp">6.6</td>
</tr>
<tr>
<th id="stub-13" class="gt_row gt_left gt_stub" scope="row">1995</th>
<td class="gt_row gt_right" headers="stub-13 forecast">60,093</td>
<td class="gt_row gt_right" headers="stub-13 process_se">2,624</td>
<td class="gt_row gt_right" headers="stub-13 parameter_se">2,432</td>
<td class="gt_row gt_right" headers="stub-13 rmsep">3,577</td>
<td class="gt_row gt_right" headers="stub-13 cvp">6.0</td>
</tr>
<tr>
<th id="stub-14" class="gt_row gt_left gt_stub" scope="row">1995, book</th>
<td class="gt_row gt_right" headers="stub-14 forecast">60,093</td>
<td class="gt_row gt_right" headers="stub-14 process_se"></td>
<td class="gt_row gt_right" headers="stub-14 parameter_se"></td>
<td class="gt_row gt_right" headers="stub-14 rmsep">3,577</td>
<td class="gt_row gt_right" headers="stub-14 cvp">6.0</td>
</tr>
<tr>
<th id="stub-15" class="gt_row gt_left gt_stub" scope="row">1996</th>
<td class="gt_row gt_right" headers="stub-15 forecast">80,983</td>
<td class="gt_row gt_right" headers="stub-15 process_se">3,046</td>
<td class="gt_row gt_right" headers="stub-15 parameter_se">3,364</td>
<td class="gt_row gt_right" headers="stub-15 rmsep">4,538</td>
<td class="gt_row gt_right" headers="stub-15 cvp">5.6</td>
</tr>
<tr>
<th id="stub-16" class="gt_row gt_left gt_stub" scope="row">1996, book</th>
<td class="gt_row gt_right" headers="stub-16 forecast">80,983</td>
<td class="gt_row gt_right" headers="stub-16 process_se"></td>
<td class="gt_row gt_right" headers="stub-16 parameter_se"></td>
<td class="gt_row gt_right" headers="stub-16 rmsep">4,538</td>
<td class="gt_row gt_right" headers="stub-16 cvp">5.6</td>
</tr>
<tr>
<th id="stub-17" class="gt_row gt_left gt_stub" scope="row">1997</th>
<td class="gt_row gt_right" headers="stub-17 forecast">105,874</td>
<td class="gt_row gt_right" headers="stub-17 process_se">3,482</td>
<td class="gt_row gt_right" headers="stub-17 parameter_se">5,824</td>
<td class="gt_row gt_right" headers="stub-17 rmsep">6,786</td>
<td class="gt_row gt_right" headers="stub-17 cvp">6.4</td>
</tr>
<tr>
<th id="stub-18" class="gt_row gt_left gt_stub" scope="row">1997, book</th>
<td class="gt_row gt_right" headers="stub-18 forecast">105,874</td>
<td class="gt_row gt_right" headers="stub-18 process_se"></td>
<td class="gt_row gt_right" headers="stub-18 parameter_se"></td>
<td class="gt_row gt_right" headers="stub-18 rmsep">6,786</td>
<td class="gt_row gt_right" headers="stub-18 cvp">6.4</td>
</tr>
<tr>
<th id="stub-19" class="gt_row gt_left gt_stub" scope="row">Total</th>
<td class="gt_row gt_right" headers="stub-19 forecast">373,346</td>
<td class="gt_row gt_right" headers="stub-19 process_se">6,539</td>
<td class="gt_row gt_right" headers="stub-19 parameter_se">12,465</td>
<td class="gt_row gt_right" headers="stub-19 rmsep">14,076</td>
<td class="gt_row gt_right" headers="stub-19 cvp">3.8</td>
</tr>
<tr>
<th id="stub-20" class="gt_row gt_left gt_stub" scope="row">Total, book</th>
<td class="gt_row gt_right" headers="stub-20 forecast">373,346</td>
<td class="gt_row gt_right" headers="stub-20 process_se"></td>
<td class="gt_row gt_right" headers="stub-20 parameter_se"></td>
<td class="gt_row gt_right" headers="stub-20 rmsep">14,076</td>
<td class="gt_row gt_right" headers="stub-20 cvp">3.8</td>
</tr>
</tbody>
</table>


Table 5-4 agrees in every number. Parameter error is the larger part of the total's RMSEP. Adding the years' MSEPs as if they were independent gives:


``` python
by_year_msep = [e**2 for e in pe["rmsep"][1:-1]]
print(f"total if the years were independent {math.sqrt(sum(by_year_msep)):,.0f}  (book 10,275)")
```


    total if the years were independent 10,275  (book 10,275)


This is lower than the total because the years are positively correlated: they share the `b[j]`, so an error in one moves all years the same way.


# 4. Prediction error by simulation

Section 5.4.2 checks the delta method with a parametric bootstrap: draw the coefficients from their estimated normal distribution, forecast the future cells, add process error, and repeat 10,000 times.

`OdpGlmFit.predict_distribution` does this. Its process error on each cell is `phi * Poisson(mu / phi)`; the monograph does not state its process distribution. `"normal"` draws the coefficients from a plain normal, as the monograph does, and `aggregate(["origin"])` adds the cells by accident year.


``` python
def by_year_draws(fit, seed, n_sims=10_000):
    """Simulated reserves: one row per accident year 1989 to 1997, one column per draw."""
    draws = fit.predict_distribution(n_sims, seed, "normal").aggregate(["origin"])
    return np.array(draws.draw_matrix()).T


def sim_table(sims, book, title):
    """Mean, RMSEP and CVP of simulated reserves by year and in total, beside the book's."""
    keys = [*YEARS[1:], "Total"]
    rows = []
    for key, s in zip(keys, [*sims, sims.sum(axis=0)]):
        rows += [(str(key), s.mean(), s.std(ddof=1), 100 * s.std(ddof=1) / s.mean()),
                 (f"{key}, book", *book[key])]
    return (GT(pd.DataFrame(rows, columns=["year", "mean", "rmsep", "cvp"]), rowname_col="year")
            .tab_header(title, "Money in the units of the triangle; CVP in percent")
            .cols_label(rmsep="RMSEP", cvp="CVP %")
            .fmt_integer(["mean", "rmsep"])
            .fmt_number("cvp", decimals=1))


TABLE_5_5 = {
    1989: (3476, 937, 27.0), 1990: (8269, 1366, 16.5), 1991: (14738, 1794, 12.2),
    1992: (22776, 2186, 9.6), 1993: (32043, 2525, 7.9), 1994: (45963, 3057, 6.7),
    1995: (60273, 3608, 6.0), 1996: (81249, 4589, 5.6), 1997: (106204, 6831, 6.4),
    "Total": (374992, 14286, 3.8),
}
sim_table(by_year_draws(cc, seed=1), TABLE_5_5, "Table 5-5: the parametric bootstrap, 10,000 draws")
```


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

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

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="4" id="title" class="gt_heading gt_title gt_font_normal">Table 5-5: the parametric bootstrap, 10,000 draws</th>
</tr>
<tr class="gt_heading">
<th colspan="4" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Money in the units of the triangle; CVP in percent</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="mean" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">mean</th>
<th id="rmsep" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">RMSEP</th>
<th id="cvp" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">CVP %</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">1989</th>
<td class="gt_row gt_right" headers="stub-1 mean">3,467</td>
<td class="gt_row gt_right" headers="stub-1 rmsep">943</td>
<td class="gt_row gt_right" headers="stub-1 cvp">27.2</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">1989, book</th>
<td class="gt_row gt_right" headers="stub-2 mean">3,476</td>
<td class="gt_row gt_right" headers="stub-2 rmsep">937</td>
<td class="gt_row gt_right" headers="stub-2 cvp">27.0</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">1990</th>
<td class="gt_row gt_right" headers="stub-3 mean">8,290</td>
<td class="gt_row gt_right" headers="stub-3 rmsep">1,397</td>
<td class="gt_row gt_right" headers="stub-3 cvp">16.8</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">1990, book</th>
<td class="gt_row gt_right" headers="stub-4 mean">8,269</td>
<td class="gt_row gt_right" headers="stub-4 rmsep">1,366</td>
<td class="gt_row gt_right" headers="stub-4 cvp">16.5</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">1991</th>
<td class="gt_row gt_right" headers="stub-5 mean">14,725</td>
<td class="gt_row gt_right" headers="stub-5 rmsep">1,792</td>
<td class="gt_row gt_right" headers="stub-5 cvp">12.2</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">1991, book</th>
<td class="gt_row gt_right" headers="stub-6 mean">14,738</td>
<td class="gt_row gt_right" headers="stub-6 rmsep">1,794</td>
<td class="gt_row gt_right" headers="stub-6 cvp">12.2</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">1992</th>
<td class="gt_row gt_right" headers="stub-7 mean">22,792</td>
<td class="gt_row gt_right" headers="stub-7 rmsep">2,177</td>
<td class="gt_row gt_right" headers="stub-7 cvp">9.6</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">1992, book</th>
<td class="gt_row gt_right" headers="stub-8 mean">22,776</td>
<td class="gt_row gt_right" headers="stub-8 rmsep">2,186</td>
<td class="gt_row gt_right" headers="stub-8 cvp">9.6</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">1993</th>
<td class="gt_row gt_right" headers="stub-9 mean">32,037</td>
<td class="gt_row gt_right" headers="stub-9 rmsep">2,528</td>
<td class="gt_row gt_right" headers="stub-9 cvp">7.9</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">1993, book</th>
<td class="gt_row gt_right" headers="stub-10 mean">32,043</td>
<td class="gt_row gt_right" headers="stub-10 rmsep">2,525</td>
<td class="gt_row gt_right" headers="stub-10 cvp">7.9</td>
</tr>
<tr>
<th id="stub-11" class="gt_row gt_left gt_stub" scope="row">1994</th>
<td class="gt_row gt_right" headers="stub-11 mean">45,950</td>
<td class="gt_row gt_right" headers="stub-11 rmsep">3,101</td>
<td class="gt_row gt_right" headers="stub-11 cvp">6.7</td>
</tr>
<tr>
<th id="stub-12" class="gt_row gt_left gt_stub" scope="row">1994, book</th>
<td class="gt_row gt_right" headers="stub-12 mean">45,963</td>
<td class="gt_row gt_right" headers="stub-12 rmsep">3,057</td>
<td class="gt_row gt_right" headers="stub-12 cvp">6.7</td>
</tr>
<tr>
<th id="stub-13" class="gt_row gt_left gt_stub" scope="row">1995</th>
<td class="gt_row gt_right" headers="stub-13 mean">60,313</td>
<td class="gt_row gt_right" headers="stub-13 rmsep">3,593</td>
<td class="gt_row gt_right" headers="stub-13 cvp">6.0</td>
</tr>
<tr>
<th id="stub-14" class="gt_row gt_left gt_stub" scope="row">1995, book</th>
<td class="gt_row gt_right" headers="stub-14 mean">60,273</td>
<td class="gt_row gt_right" headers="stub-14 rmsep">3,608</td>
<td class="gt_row gt_right" headers="stub-14 cvp">6.0</td>
</tr>
<tr>
<th id="stub-15" class="gt_row gt_left gt_stub" scope="row">1996</th>
<td class="gt_row gt_right" headers="stub-15 mean">81,254</td>
<td class="gt_row gt_right" headers="stub-15 rmsep">4,582</td>
<td class="gt_row gt_right" headers="stub-15 cvp">5.6</td>
</tr>
<tr>
<th id="stub-16" class="gt_row gt_left gt_stub" scope="row">1996, book</th>
<td class="gt_row gt_right" headers="stub-16 mean">81,249</td>
<td class="gt_row gt_right" headers="stub-16 rmsep">4,589</td>
<td class="gt_row gt_right" headers="stub-16 cvp">5.6</td>
</tr>
<tr>
<th id="stub-17" class="gt_row gt_left gt_stub" scope="row">1997</th>
<td class="gt_row gt_right" headers="stub-17 mean">106,056</td>
<td class="gt_row gt_right" headers="stub-17 rmsep">6,849</td>
<td class="gt_row gt_right" headers="stub-17 cvp">6.5</td>
</tr>
<tr>
<th id="stub-18" class="gt_row gt_left gt_stub" scope="row">1997, book</th>
<td class="gt_row gt_right" headers="stub-18 mean">106,204</td>
<td class="gt_row gt_right" headers="stub-18 rmsep">6,831</td>
<td class="gt_row gt_right" headers="stub-18 cvp">6.4</td>
</tr>
<tr>
<th id="stub-19" class="gt_row gt_left gt_stub" scope="row">Total</th>
<td class="gt_row gt_right" headers="stub-19 mean">374,883</td>
<td class="gt_row gt_right" headers="stub-19 rmsep">14,432</td>
<td class="gt_row gt_right" headers="stub-19 cvp">3.8</td>
</tr>
<tr>
<th id="stub-20" class="gt_row gt_left gt_stub" scope="row">Total, book</th>
<td class="gt_row gt_right" headers="stub-20 mean">374,992</td>
<td class="gt_row gt_right" headers="stub-20 rmsep">14,286</td>
<td class="gt_row gt_right" headers="stub-20 cvp">3.8</td>
</tr>
</tbody>
</table>


Means and RMSEPs agree with Table 5-5 within simulation noise: with 10,000 draws a standard deviation has a relative error of about 0.7%. The total RMSEPs are 1.0% apart, which two seeds can also give. Both are slightly above the delta method.

Both sets of means are *above* the chain ladder's forecasts (374,992 in the monograph against 373,346). This is not noise: a cell `exp(x' beta)` with [beta](../reference/risk.Gpd.md#prospicio.risk.Gpd.beta) drawn from a normal has the mean `mu * exp(v / 2)`, where `v = x' Sigma x` is the variance of the linear predictor (the lognormal bias). `predictive_means()` gives the simulation's exact expectation for each cell:


``` python
print(f"chain ladder {cc.total_reserve:9,.0f}")
print(f"E[simulated] {sum(cc.predictive_means()):9,.0f}   (book's bootstrap mean 374,992)")
```


    chain ladder   373,346
    E[simulated]   374,994   (book's bootstrap mean 374,992)


The monograph puts the higher means down to sampling error, but the bias explains all of the 1,646 difference, to two units. To simulate around the chain ladder's forecast, use `"mean_preserving"`: it moves each cell's linear predictor by `-v / 2`, so the draws average to the fitted mean.

**Other methods for the same question.** The ODP bootstrap of England and Verrall ([OdpBootstrap](../reference/reserving.OdpBootstrap.md#prospicio.reserving.OdpBootstrap)) resamples the model's adjusted Pearson residuals, draws no parameters from a normal and adds gamma process error. Mack's model is the distribution-free counterpart of ODP Mack (section 2). The bootstrap's scale is the same Pearson [phi](../reference/reserving.PaidIncurredFit.md#prospicio.reserving.PaidIncurredFit.phi):


``` python
ob = OdpBootstrap(n_sims=10_000, seed=1).fit(tri, "paid")
boot = np.array(ob.reserves.draw_matrix()).T
mack = Mack().fit(tri, "paid")
print(f"ODP bootstrap scale {ob.scale:.1f}")
```


    ODP bootstrap scale 114.5


``` python
boot_years = [*boot[1:], boot.sum(axis=0)]
vs_mack = pd.DataFrame({
    "year": [str(y) for y in YEARS[1:]] + ["Total"],
    "boot_mean": [s.mean() for s in boot_years],
    "boot_sd": [s.std(ddof=1) for s in boot_years],
    "mack_reserve": [*mack.reserve[1:], mack.total_reserve],
    "mack_se": [*mack.standard_error[1:], mack.total_standard_error],
})
(GT(vs_mack, rowname_col="year")
 .tab_header("ODP bootstrap against Mack", "Money in the units of the triangle; 10,000 draws")
 .cols_label(boot_mean="bootstrap mean", boot_sd="bootstrap SD",
             mack_reserve="Mack reserve", mack_se="Mack SE")
 .fmt_integer(["boot_mean", "boot_sd", "mack_reserve", "mack_se"]))
```


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

#zyohsunetu thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#zyohsunetu p { margin: 0; padding: 0; }
 #zyohsunetu .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; }
 #zyohsunetu .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #zyohsunetu .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; }
 #zyohsunetu .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; }
 #zyohsunetu .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; }
 #zyohsunetu .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #zyohsunetu .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; }
 #zyohsunetu .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; }
 #zyohsunetu .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; }
 #zyohsunetu .gt_column_spanner_outer:first-child { padding-left: 0; }
 #zyohsunetu .gt_column_spanner_outer:last-child { padding-right: 0; }
 #zyohsunetu .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%; }
 #zyohsunetu .gt_spanner_row { border-bottom-style: hidden; }
 #zyohsunetu .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; }
 #zyohsunetu .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; }
 #zyohsunetu .gt_from_md> :first-child { margin-top: 0; }
 #zyohsunetu .gt_from_md> :last-child { margin-bottom: 0; }
 #zyohsunetu .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; }
 #zyohsunetu .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; }
 #zyohsunetu .gt_indent_1 { text-indent: 5px; }
 #zyohsunetu .gt_indent_2 { text-indent: calc(5px * 2); }
 #zyohsunetu .gt_indent_3 { text-indent: calc(5px * 3); }
 #zyohsunetu .gt_indent_4 { text-indent: calc(5px * 4); }
 #zyohsunetu .gt_indent_5 { text-indent: calc(5px * 5); }
 #zyohsunetu .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; }
 #zyohsunetu .gt_row_group_first td { border-top-width: 2px; }
 #zyohsunetu .gt_row_group_first th { border-top-width: 2px; }
 #zyohsunetu .gt_striped { color: #333333; background-color: #F4F4F4; }
 #zyohsunetu .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; }
 #zyohsunetu .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #zyohsunetu .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #zyohsunetu .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #zyohsunetu .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #zyohsunetu .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #zyohsunetu .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #zyohsunetu .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; }
 #zyohsunetu .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #zyohsunetu .gt_left { text-align: left; }
 #zyohsunetu .gt_center { text-align: center; }
 #zyohsunetu .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #zyohsunetu .gt_font_normal { font-weight: normal; }
 #zyohsunetu .gt_font_bold { font-weight: bold; }
 #zyohsunetu .gt_font_italic { font-style: italic; }
 #zyohsunetu .gt_super { font-size: 65%; }
 #zyohsunetu .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; }
 #zyohsunetu .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #zyohsunetu .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; }
 #zyohsunetu .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #zyohsunetu .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #zyohsunetu .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">ODP bootstrap against Mack</th>
</tr>
<tr class="gt_heading">
<th colspan="5" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Money in the units of the triangle; 10,000 draws</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="boot_mean" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">bootstrap mean</th>
<th id="boot_sd" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">bootstrap SD</th>
<th id="mack_reserve" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Mack reserve</th>
<th id="mack_se" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Mack SE</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">1989</th>
<td class="gt_row gt_right" headers="stub-1 boot_mean">3,383</td>
<td class="gt_row gt_right" headers="stub-1 boot_sd">926</td>
<td class="gt_row gt_right" headers="stub-1 mack_reserve">3,398</td>
<td class="gt_row gt_right" headers="stub-1 mack_se">39</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">1990</th>
<td class="gt_row gt_right" headers="stub-2 boot_mean">8,140</td>
<td class="gt_row gt_right" headers="stub-2 boot_sd">1,372</td>
<td class="gt_row gt_right" headers="stub-2 mack_reserve">8,155</td>
<td class="gt_row gt_right" headers="stub-2 mack_se">44</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">1991</th>
<td class="gt_row gt_right" headers="stub-3 boot_mean">14,545</td>
<td class="gt_row gt_right" headers="stub-3 boot_sd">1,769</td>
<td class="gt_row gt_right" headers="stub-3 mack_reserve">14,579</td>
<td class="gt_row gt_right" headers="stub-3 mack_se">410</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">1992</th>
<td class="gt_row gt_right" headers="stub-4 boot_mean">22,600</td>
<td class="gt_row gt_right" headers="stub-4 boot_sd">2,184</td>
<td class="gt_row gt_right" headers="stub-4 mack_reserve">22,645</td>
<td class="gt_row gt_right" headers="stub-4 mack_se">850</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">1993</th>
<td class="gt_row gt_right" headers="stub-5 boot_mean">31,822</td>
<td class="gt_row gt_right" headers="stub-5 boot_sd">2,549</td>
<td class="gt_row gt_right" headers="stub-5 mack_reserve">31,865</td>
<td class="gt_row gt_right" headers="stub-5 mack_se">1,364</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">1994</th>
<td class="gt_row gt_right" headers="stub-6 boot_mean">45,712</td>
<td class="gt_row gt_right" headers="stub-6 boot_sd">3,013</td>
<td class="gt_row gt_right" headers="stub-6 mack_reserve">45,753</td>
<td class="gt_row gt_right" headers="stub-6 mack_se">1,959</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">1995</th>
<td class="gt_row gt_right" headers="stub-7 boot_mean">60,075</td>
<td class="gt_row gt_right" headers="stub-7 boot_sd">3,624</td>
<td class="gt_row gt_right" headers="stub-7 mack_reserve">60,093</td>
<td class="gt_row gt_right" headers="stub-7 mack_se">2,308</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">1996</th>
<td class="gt_row gt_right" headers="stub-8 boot_mean">80,887</td>
<td class="gt_row gt_right" headers="stub-8 boot_sd">4,545</td>
<td class="gt_row gt_right" headers="stub-8 mack_reserve">80,983</td>
<td class="gt_row gt_right" headers="stub-8 mack_se">3,179</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">1997</th>
<td class="gt_row gt_right" headers="stub-9 boot_mean">105,942</td>
<td class="gt_row gt_right" headers="stub-9 boot_sd">6,839</td>
<td class="gt_row gt_right" headers="stub-9 mack_reserve">105,874</td>
<td class="gt_row gt_right" headers="stub-9 mack_se">9,192</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">Total</th>
<td class="gt_row gt_right" headers="stub-10 boot_mean">373,105</td>
<td class="gt_row gt_right" headers="stub-10 boot_sd">14,194</td>
<td class="gt_row gt_right" headers="stub-10 mack_reserve">373,346</td>
<td class="gt_row gt_right" headers="stub-10 mack_se">10,939</td>
</tr>
</tbody>
</table>


``` python
import matplotlib.pyplot as plt

total_boot = boot.sum(axis=0)
grid = np.linspace(280_000, 470_000, 300)


def normal_pdf(x, mean, sd):
    return np.exp(-0.5 * ((x - mean) / sd) ** 2) / (sd * math.sqrt(2 * math.pi))


fig, ax = plt.subplots()
ax.hist(total_boot, bins=60, density=True, color="0.75", label="ODP bootstrap draws")
ax.plot(grid, normal_pdf(grid, mack.total_reserve, mack.total_standard_error), label="normal, Mack SE")
ax.plot(grid, normal_pdf(grid, cc.total_reserve, pe["rmsep"][-1]), label="normal, GLM RMSEP")
ax.set_xticks(range(300_000, 500_000, 50_000))
ax.xaxis.set_major_formatter(lambda x, _: f"{x:,.0f}")
ax.set_xlabel("total reserve (units of the triangle)")
ax.set_ylabel("density")
ax.set_title("Total reserve: the bootstrap is wider than Mack's error")
ax.legend()
```


<figure class="p-figure figure">
FAgYm9vdHN0cmFwIGRyYXdzPC90ZXh0PgogICAgPC9nPgogICAgPGcgaWQ9ImxpbmUyZF8yNyI+CiAgICAgPHBhdGggZD0iTSAyNzkuODIyNDIyIDY0LjU4NDY4OCAKTCAyOTAuODIyNDIyIDY0LjU4NDY4OCAKTCAzMDEuODIyNDIyIDY0LjU4NDY4OCAKIiBzdHlsZT0iZmlsbDogbm9uZTsgc3Ryb2tlOiB2YXIoLS1wLXNlcmllcy0xKTsgc3Ryb2tlLXdpZHRoOiAxLjU7IHN0cm9rZS1saW5lY2FwOiBzcXVhcmUiIC8+CiAgICA8L2c+CiAgICA8ZyBpZD0idGV4dF8xOCI+CiAgICAgPHRleHQgc3R5bGU9ImZvbnQtc2l6ZTogMTFweDsgZm9udC1mYW1pbHk6IHZhcigtLXAtZm9udCk7IHRleHQtYW5jaG9yOiBzdGFydDsgZmlsbDogdmFyKC0tcC1pbmspIiB4PSIzMTAuNjIyNDIyIiB5PSI2OC40MzQ2ODgiIHRyYW5zZm9ybT0icm90YXRlKC0wIDMxMC42MjI0MjIgNjguNDM0Njg4KSI+bm9ybWFsLCBNYWNrIFNFPC90ZXh0PgogICAgPC9nPgogICAgPGcgaWQ9ImxpbmUyZF8yOCI+CiAgICAgPHBhdGggZD0iTSAyNzkuODIyNDIyIDgxLjA4NTU0NyAKTCAyOTAuODIyNDIyIDgxLjA4NTU0NyAKTCAzMDEuODIyNDIyIDgxLjA4NTU0NyAKIiBzdHlsZT0iZmlsbDogbm9uZTsgc3Ryb2tlOiB2YXIoLS1wLXNlcmllcy0yKTsgc3Ryb2tlLXdpZHRoOiAxLjU7IHN0cm9rZS1saW5lY2FwOiBzcXVhcmUiIC8+CiAgICA8L2c+CiAgICA8ZyBpZD0idGV4dF8xOSI+CiAgICAgPHRleHQgc3R5bGU9ImZvbnQtc2l6ZTogMTFweDsgZm9udC1mYW1pbHk6IHZhcigtLXAtZm9udCk7IHRleHQtYW5jaG9yOiBzdGFydDsgZmlsbDogdmFyKC0tcC1pbmspIiB4PSIzMTAuNjIyNDIyIiB5PSI4NC45MzU1NDciIHRyYW5zZm9ybT0icm90YXRlKC0wIDMxMC42MjI0MjIgODQuOTM1NTQ3KSI+bm9ybWFsLCBHTE0gUk1TRVA8L3RleHQ+CiAgICA8L2c+CiAgIDwvZz4KICA8L2c+CiA8L2c+CiA8ZGVmcz4KICA8Y2xpcHBhdGggaWQ9InBiNTBjYjU2M2ZjIj4KICAgPHJlY3QgeD0iNDYuNjk0Mjk3IiB5PSIzMy42NzU1NDciIHdpZHRoPSIzOTAuNiIgaGVpZ2h0PSIxOTkuNTg0IiAvPgogIDwvY2xpcHBhdGg+CiA8L2RlZnM+Cjwvc3ZnPg==" />
</figure>


The bootstrap's total RMSEP is near the parametric bootstrap's. Mack's is about a quarter lower, and very small for the older years. Mack's variance comes from the scatter of the age-to-age factors, which is little in the later columns; the ODP ties each payment's variance to its size through one [phi](../reference/reserving.PaidIncurredFit.md#prospicio.reserving.PaidIncurredFit.phi). Two models with the same forecast can have different prediction errors (monograph section 5.4.1), and here the difference is large.


# 5. Residual diagnostics

Chapter 6 checks the fit with residuals. A cell's standardized deviance residual is its deviance residual over `sqrt(phi * (1 - h))`, with `h` the leverage (the hat-matrix diagonal). `OdpGlmFit.residuals()` gives these for each observed cell, with Pearson residuals, leverages and actual-to-fitted ratios; `residual_summary` groups them by development, accident or calendar year:


``` python
dev = cc.residual_summary("development")
cal = cc.residual_summary("calendar")
print("by development year 1 to 8, spread (sd) of the residuals")
print(" ".join(f"{s:.2f}" for s in dev["sd"][:8]))
print("by calendar year 1988 to 1997, mean residual")
print(" ".join(f"{m:+.2f}" for m in cal["mean"]))
```


    by development year 1 to 8, spread (sd) of the residuals
    1.42 1.68 0.94 0.67 0.91 0.86 0.75 0.49
    by calendar year 1988 to 1997, mean residual
    -0.38 -0.13 -0.40 +0.56 +0.42 -0.43 +0.23 -0.27 -0.26 +0.32


``` python
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(9, 3.5))
ax1.bar(range(1, 9), dev["sd"][:8], color="0.75")
ax1.axhline(1.0, color="0.4", linestyle=":")
ax1.set_xlabel("development year")
ax1.set_ylabel("sd of standardized residuals")
ax1.set_title("Spread by development year")
ax2.bar(range(1988, 1998), cal["mean"], color="0.75")
ax2.axhline(0.0, color="0.4")
ax2.set_xlabel("calendar year")
ax2.set_ylabel("mean standardized residual")
ax2.set_title("Mean by calendar year")
fig.tight_layout()
```


<figure class="p-figure figure">
<img src="data:image/svg+xml;base64,PHN2ZyB4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjYzNi44ODMwNDdwdCIgaGVpZ2h0PSIyNDIuNjQxNzk3cHQiIHZpZXdib3g9IjAgMCA2MzYuODgzMDQ3IDI0Mi42NDE3OTciIHhtbG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A8cmVjdCB4PSI1My42OTMwNDciIHk9IjIyLjMxODEyNSIgd2lkdGg9IjI1Ni44MDUiIGhlaWdodD0iMTgwLjEyMjgxMyIgLz4KICA8L2NsaXBwYXRoPgogIDxjbGlwcGF0aCBpZD0icGJmODkzNWU4YjUiPgogICA8cmVjdCB4PSIzNzIuODc4MDQ3IiB5PSIyMi4zMTgxMjUiIHdpZHRoPSIyNTYuODA1IiBoZWlnaHQ9IjE4MC4xMjI4MTMiIC8+CiAgPC9jbGlwcGF0aD4KIDwvZGVmcz4KPC9zdmc+" />
</figure>


The spreads use divisor `n - 1`. Two cells have leverage one, the last of 1988 and the first of 1997. Each is the only observation of its parameter, so its residual is undefined. Development year 10 has no residual and year 9 has two, too few for a spread. Development years 1 and 2 scatter more than later years (Figure 6-19), and the calendar-year means change from negative to positive (Figure 6-20).

Actual and fitted totals agree on every row and column, so one-way comparisons show no problem. The ratio of actual to fitted for each cell can (Figure 6-22):


``` python
def heat_map(fit, title):
    """The actual-to-fitted ratio of every observed cell, in percent, a row per accident year."""
    r = fit.residuals()
    rows = []
    for year in map(str, YEARS):
        ratios = [100 * x for o, x in zip(r["origin"], r["actual_to_fitted"]) if o == year]
        rows.append([year, *ratios, *[np.nan] * (K - len(ratios))])
    columns = [str(d) for d in range(1, K + 1)]
    return (GT(pd.DataFrame(rows, columns=["year", *columns]), rowname_col="year")
            .tab_header(title, "Actual over fitted in percent; columns are development years")
            .fmt_integer(columns)
            .sub_missing(missing_text="")
            .data_color(columns, domain=[80, 120], palette=["firebrick", "white", "steelblue"]))


heat_map(cc, "Figure 6-22: the cross-classified model")
```


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

#xkuuczhmpv thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#xkuuczhmpv p { margin: 0; padding: 0; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .gt_column_spanner_outer:first-child { padding-left: 0; }
 #xkuuczhmpv .gt_column_spanner_outer:last-child { padding-right: 0; }
 #xkuuczhmpv .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%; }
 #xkuuczhmpv .gt_spanner_row { border-bottom-style: hidden; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .gt_from_md> :first-child { margin-top: 0; }
 #xkuuczhmpv .gt_from_md> :last-child { margin-bottom: 0; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .gt_indent_1 { text-indent: 5px; }
 #xkuuczhmpv .gt_indent_2 { text-indent: calc(5px * 2); }
 #xkuuczhmpv .gt_indent_3 { text-indent: calc(5px * 3); }
 #xkuuczhmpv .gt_indent_4 { text-indent: calc(5px * 4); }
 #xkuuczhmpv .gt_indent_5 { text-indent: calc(5px * 5); }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .gt_row_group_first td { border-top-width: 2px; }
 #xkuuczhmpv .gt_row_group_first th { border-top-width: 2px; }
 #xkuuczhmpv .gt_striped { color: #333333; background-color: #F4F4F4; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #xkuuczhmpv .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #xkuuczhmpv .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #xkuuczhmpv .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #xkuuczhmpv .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #xkuuczhmpv .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #xkuuczhmpv .gt_left { text-align: left; }
 #xkuuczhmpv .gt_center { text-align: center; }
 #xkuuczhmpv .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #xkuuczhmpv .gt_font_normal { font-weight: normal; }
 #xkuuczhmpv .gt_font_bold { font-weight: bold; }
 #xkuuczhmpv .gt_font_italic { font-style: italic; }
 #xkuuczhmpv .gt_super { font-size: 65%; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #xkuuczhmpv .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; }
 #xkuuczhmpv .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #xkuuczhmpv .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #xkuuczhmpv .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="11" id="title" class="gt_heading gt_title gt_font_normal">Figure 6-22: the cross-classified model</th>
</tr>
<tr class="gt_heading">
<th colspan="11" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Actual over fitted in percent; columns are development years</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="1" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">1</th>
<th id="2" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">2</th>
<th id="3" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">3</th>
<th id="4" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">4</th>
<th id="5" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">5</th>
<th id="6" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">6</th>
<th id="7" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">7</th>
<th id="8" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">8</th>
<th id="9" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">9</th>
<th id="10" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">10</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">1988</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #fdeeec" headers="stub-1 1">98</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fcfdfe" headers="stub-1 2">100</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fefefe" headers="stub-1 3">100</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #dde5f0" headers="stub-1 4">104</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #88a9cc" headers="stub-1 5">113</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #d8786a" headers="stub-1 6">87</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f6d0c9" headers="stub-1 7">96</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #ecada2" headers="stub-1 8">92</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fffdfd" headers="stub-1 9">100</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #ffffff" headers="stub-1 10">100</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">1989</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #fdf1ef" headers="stub-2 1">99</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fef8f7" headers="stub-2 2">99</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #ccd9e9" headers="stub-2 3">106</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #e5ebf4" headers="stub-2 4">103</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f4c9c1" headers="stub-2 5">95</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f4c5bd" headers="stub-2 6">95</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fef5f3" headers="stub-2 7">99</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #edf1f7" headers="stub-2 8">102</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fefefe" headers="stub-2 9">100</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-2 10"></td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">1990</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #f8d6d0" headers="stub-3 1">96</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #bdcee2" headers="stub-3 2">108</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #c4d3e6" headers="stub-3 3">107</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #eaa59a" headers="stub-3 4">91</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #e5998d" headers="stub-3 5">90</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #ecf1f7" headers="stub-3 6">102</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #ecada2" headers="stub-3 7">92</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #dae3ef" headers="stub-3 8">104</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-3 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-3 10"></td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">1991</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #f9dcd6" headers="stub-4 1">97</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #e8eef5" headers="stub-4 2">103</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f8d9d3" headers="stub-4 3">96</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fbe3df" headers="stub-4 4">97</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #e4eaf3" headers="stub-4 5">103</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #9bb6d4" headers="stub-4 6">111</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #9db7d5" headers="stub-4 7">111</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-4 8"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-4 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-4 10"></td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">1992</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #f5cbc4" headers="stub-5 1">95</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #c4d3e6" headers="stub-5 2">107</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fcfdfe" headers="stub-5 3">100</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fffdfd" headers="stub-5 4">100</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f9ddd8" headers="stub-5 5">97</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fbfcfd" headers="stub-5 6">100</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-5 7"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-5 8"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-5 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-5 10"></td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">1993</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #fbe7e4" headers="stub-6 1">98</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #d3deec" headers="stub-6 2">105</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #efb7ad" headers="stub-6 3">93</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f2f5f9" headers="stub-6 4">101</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #e0e7f2" headers="stub-6 5">104</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-6 6"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-6 7"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-6 8"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-6 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-6 10"></td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">1994</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #b3c7de" headers="stub-7 1">109</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #e79e92" headers="stub-7 2">91</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f4c7bf" headers="stub-7 3">95</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #dee6f1" headers="stub-7 4">104</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-7 5"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-7 6"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-7 7"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-7 8"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-7 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-7 10"></td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">1995</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #cdd9e9" headers="stub-8 1">106</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #e49588" headers="stub-8 2">90</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #d1ddeb" headers="stub-8 3">105</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-8 4"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-8 5"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-8 6"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-8 7"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-8 8"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-8 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-8 10"></td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">1996</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #e7edf5" headers="stub-9 1">103</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f9dbd6" headers="stub-9 2">97</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 3"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 4"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 5"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 6"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 7"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 8"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 10"></td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">1997</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #ffffff" headers="stub-10 1">100</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 2"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 3"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 4"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 5"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 6"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 7"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 8"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 10"></td>
</tr>
</tbody>
</table>


In development year 1 the early accident years are below 100% and the later ones above; development year 2 shows the opposite. The payment pattern changed over the accident years: an interaction of row and column, which the cross-classified model cannot represent. Chapter 7 adds it.


# 6. Fewer parameters

Chapter 7 starts from Figure 7-1: the ten `ln a[k]` of section 2 follow a parabola in [k](../reference/models.TargetEncoding.md#prospicio.models.TargetEncoding.k). Model 7-2 replaces them with `a1 * k + a2 * k**2` and keeps all ten `ln b[j]` free. It has 12 parameters instead of 19. In prospicio it is the same [fit](../reference/risk.Gpd.md#prospicio.risk.Gpd.fit) with other columns:


``` python
quad = fit([k, k * k] + [j == b for b in range(1, K + 1)], ["a1", "a2"] + [f"ln b{b}" for b in range(1, K + 1)])
c = quad.glm.coefficients
level = c[2]  # ln b1 carries the level, as the monograph's quadratic does
print(f"accident year effect {level:.3f} + {c[0]:.4f} k {c[1]:.4f} k^2  (book 10.471 + 0.2001 k - 0.0179 k^2)")
```


    accident year effect 10.471 + 0.2001 k -0.0179 k^2  (book 10.471 + 0.2001 k - 0.0179 k^2)


The development pattern is Table 7-1:


``` python
book_7_1 = [-0.206, -0.750, -1.015, -1.452, -1.830, -2.142, -2.353, -2.514, -2.661]
table_7_1 = pd.DataFrame({
    "j": [str(i) for i in range(2, K + 1)],
    "prospicio": [x - level for x in c[3:]],
    "book": book_7_1,
})
(GT(table_7_1, rowname_col="j")
 .tab_header("Table 7-1: ln b[j] - ln b[1] of model 7-2", "By development year j")
 .fmt_number(["prospicio", "book"], decimals=3))
```


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

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

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="3" id="title" class="gt_heading gt_title gt_font_normal">Table 7-1: ln b[j] - ln b[1] of model 7-2</th>
</tr>
<tr class="gt_heading">
<th colspan="3" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">By development year j</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="book" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">2</th>
<td class="gt_row gt_right" headers="stub-1 prospicio">−0.206</td>
<td class="gt_row gt_right" headers="stub-1 book">−0.206</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">3</th>
<td class="gt_row gt_right" headers="stub-2 prospicio">−0.750</td>
<td class="gt_row gt_right" headers="stub-2 book">−0.750</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">4</th>
<td class="gt_row gt_right" headers="stub-3 prospicio">−1.015</td>
<td class="gt_row gt_right" headers="stub-3 book">−1.015</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">5</th>
<td class="gt_row gt_right" headers="stub-4 prospicio">−1.452</td>
<td class="gt_row gt_right" headers="stub-4 book">−1.452</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">6</th>
<td class="gt_row gt_right" headers="stub-5 prospicio">−1.830</td>
<td class="gt_row gt_right" headers="stub-5 book">−1.830</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">7</th>
<td class="gt_row gt_right" headers="stub-6 prospicio">−2.142</td>
<td class="gt_row gt_right" headers="stub-6 book">−2.142</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">8</th>
<td class="gt_row gt_right" headers="stub-7 prospicio">−2.353</td>
<td class="gt_row gt_right" headers="stub-7 book">−2.353</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">9</th>
<td class="gt_row gt_right" headers="stub-8 prospicio">−2.514</td>
<td class="gt_row gt_right" headers="stub-8 book">−2.514</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">10</th>
<td class="gt_row gt_right" headers="stub-9 prospicio">−2.661</td>
<td class="gt_row gt_right" headers="stub-9 book">−2.661</td>
</tr>
</tbody>
</table>


Model 7-10 (section 7.4, six parameters) replaces the development effects with a straight line in `j` with a kink at 7.5 and adds a term for development year 2. Model 7-14 (section 7.6, ten parameters) adds the interactions that the heat map showed: a shift of development years 1 and 2 for accident years 1 to 6, a trend in accident year for development year 3 and a term for development year 4.


``` python
early = k <= 6  # accident years 1 to 6
SMOOTH = [1.0, k, k * k, j - 1, np.maximum(0.0, j - 7.5), j == 2]
smooth = fit(SMOOTH, ["a0", "a1", "a2", "b1", "b2", "c"])
interact = fit(SMOOTH + [j == 4, (j == 1) & early, (j == 2) & early, (j == 3) * k],
               ["a0", "a1", "a2", "b1", "b2", "c1", "c2", "d1", "d2", "d3"])
book_7_3 = [10.469, 0.200, -0.018, -0.358, 0.236, 0.155]
book_7_5 = [10.4900, 0.2066, -0.0183, -0.3685, 0.2720, 0.0375, 0.0528, -0.0671, 0.1273, -0.0113]
missing = [np.nan] * 4  # model 7-10 has no c2 and d1 to d3
table_7_5 = pd.DataFrame({
    "coefficient": ["a0", "a1", "a2", "b1", "b2", "c1", "c2", "d1", "d2", "d3"],
    "m710": [*smooth.glm.coefficients, *missing],
    "t73": [*book_7_3, *missing],
    "m714": interact.glm.coefficients,
    "t75": book_7_5,
})
(GT(table_7_5, rowname_col="coefficient")
 .tab_header("Models 7-10 and 7-14 against Tables 7-3 and 7-5",
             "Model 7-10's c is c1 of model 7-14")
 .cols_label(m710="model 7-10", t73="Table 7-3", m714="model 7-14", t75="Table 7-5")
 .fmt_number(["m710", "m714", "t75"], decimals=4)
 .fmt_number("t73", decimals=3)
 .sub_missing(missing_text=""))
```


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

#fffpbampkt thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#fffpbampkt p { margin: 0; padding: 0; }
 #fffpbampkt .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; }
 #fffpbampkt .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #fffpbampkt .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; }
 #fffpbampkt .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; }
 #fffpbampkt .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; }
 #fffpbampkt .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #fffpbampkt .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; }
 #fffpbampkt .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; }
 #fffpbampkt .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; }
 #fffpbampkt .gt_column_spanner_outer:first-child { padding-left: 0; }
 #fffpbampkt .gt_column_spanner_outer:last-child { padding-right: 0; }
 #fffpbampkt .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%; }
 #fffpbampkt .gt_spanner_row { border-bottom-style: hidden; }
 #fffpbampkt .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; }
 #fffpbampkt .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; }
 #fffpbampkt .gt_from_md> :first-child { margin-top: 0; }
 #fffpbampkt .gt_from_md> :last-child { margin-bottom: 0; }
 #fffpbampkt .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; }
 #fffpbampkt .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; }
 #fffpbampkt .gt_indent_1 { text-indent: 5px; }
 #fffpbampkt .gt_indent_2 { text-indent: calc(5px * 2); }
 #fffpbampkt .gt_indent_3 { text-indent: calc(5px * 3); }
 #fffpbampkt .gt_indent_4 { text-indent: calc(5px * 4); }
 #fffpbampkt .gt_indent_5 { text-indent: calc(5px * 5); }
 #fffpbampkt .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; }
 #fffpbampkt .gt_row_group_first td { border-top-width: 2px; }
 #fffpbampkt .gt_row_group_first th { border-top-width: 2px; }
 #fffpbampkt .gt_striped { color: #333333; background-color: #F4F4F4; }
 #fffpbampkt .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; }
 #fffpbampkt .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #fffpbampkt .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #fffpbampkt .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #fffpbampkt .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #fffpbampkt .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #fffpbampkt .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #fffpbampkt .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; }
 #fffpbampkt .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #fffpbampkt .gt_left { text-align: left; }
 #fffpbampkt .gt_center { text-align: center; }
 #fffpbampkt .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #fffpbampkt .gt_font_normal { font-weight: normal; }
 #fffpbampkt .gt_font_bold { font-weight: bold; }
 #fffpbampkt .gt_font_italic { font-style: italic; }
 #fffpbampkt .gt_super { font-size: 65%; }
 #fffpbampkt .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; }
 #fffpbampkt .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #fffpbampkt .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; }
 #fffpbampkt .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #fffpbampkt .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #fffpbampkt .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">Models 7-10 and 7-14 against Tables 7-3 and 7-5</th>
</tr>
<tr class="gt_heading">
<th colspan="5" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Model 7-10's c is c1 of model 7-14</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="m710" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">model 7-10</th>
<th id="t73" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Table 7-3</th>
<th id="m714" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">model 7-14</th>
<th id="t75" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">Table 7-5</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">a0</th>
<td class="gt_row gt_right" headers="stub-1 m710">10.4687</td>
<td class="gt_row gt_right" headers="stub-1 t73">10.469</td>
<td class="gt_row gt_right" headers="stub-1 m714">10.4904</td>
<td class="gt_row gt_right" headers="stub-1 t75">10.4900</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">a1</th>
<td class="gt_row gt_right" headers="stub-2 m710">0.2001</td>
<td class="gt_row gt_right" headers="stub-2 t73">0.200</td>
<td class="gt_row gt_right" headers="stub-2 m714">0.2066</td>
<td class="gt_row gt_right" headers="stub-2 t75">0.2066</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">a2</th>
<td class="gt_row gt_right" headers="stub-3 m710">−0.0179</td>
<td class="gt_row gt_right" headers="stub-3 t73">−0.018</td>
<td class="gt_row gt_right" headers="stub-3 m714">−0.0183</td>
<td class="gt_row gt_right" headers="stub-3 t75">−0.0183</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">b1</th>
<td class="gt_row gt_right" headers="stub-4 m710">−0.3577</td>
<td class="gt_row gt_right" headers="stub-4 t73">−0.358</td>
<td class="gt_row gt_right" headers="stub-4 m714">−0.3685</td>
<td class="gt_row gt_right" headers="stub-4 t75">−0.3685</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">b2</th>
<td class="gt_row gt_right" headers="stub-5 m710">0.2356</td>
<td class="gt_row gt_right" headers="stub-5 t73">0.236</td>
<td class="gt_row gt_right" headers="stub-5 m714">0.2720</td>
<td class="gt_row gt_right" headers="stub-5 t75">0.2720</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">c1</th>
<td class="gt_row gt_right" headers="stub-6 m710">0.1545</td>
<td class="gt_row gt_right" headers="stub-6 t73">0.155</td>
<td class="gt_row gt_right" headers="stub-6 m714">0.0375</td>
<td class="gt_row gt_right" headers="stub-6 t75">0.0375</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">c2</th>
<td class="gt_row gt_right" headers="stub-7 m710"></td>
<td class="gt_row gt_right" headers="stub-7 t73"></td>
<td class="gt_row gt_right" headers="stub-7 m714">0.0528</td>
<td class="gt_row gt_right" headers="stub-7 t75">0.0528</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">d1</th>
<td class="gt_row gt_right" headers="stub-8 m710"></td>
<td class="gt_row gt_right" headers="stub-8 t73"></td>
<td class="gt_row gt_right" headers="stub-8 m714">−0.0671</td>
<td class="gt_row gt_right" headers="stub-8 t75">−0.0671</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">d2</th>
<td class="gt_row gt_right" headers="stub-9 m710"></td>
<td class="gt_row gt_right" headers="stub-9 t73"></td>
<td class="gt_row gt_right" headers="stub-9 m714">0.1273</td>
<td class="gt_row gt_right" headers="stub-9 t75">0.1273</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">d3</th>
<td class="gt_row gt_right" headers="stub-10 m710"></td>
<td class="gt_row gt_right" headers="stub-10 t73"></td>
<td class="gt_row gt_right" headers="stub-10 m714">−0.0113</td>
<td class="gt_row gt_right" headers="stub-10 t75">−0.0113</td>
</tr>
</tbody>
</table>


``` python
print(f"phi: 7-2 {quad.dispersion:.1f}, 7-10 {smooth.dispersion:.1f}, 7-14 {interact.dispersion:.1f}")
```


    phi: 7-2 102.6, 7-10 107.3, 7-14 53.9


Both fits agree with the tables. Model 7-10's `c1` is 0.1544995, which rounds to 0.154 where Table 7-3 prints 0.155 (SAS differs in the seventh decimal). Table 7-5 prints 10.490 for `a0` with an added trailing zero. Model 7-14's `c1` is for development year 2 and `c2` for year 4, then `d1` to `d3`, the monograph's order. [phi](../reference/reserving.PaidIncurredFit.md#prospicio.reserving.PaidIncurredFit.phi) falls from 114.5 to about 54 with the interactions, the main reason for their lower prediction error.

The heat map of the six-parameter model (Figure 7-5) shows the pattern that the interactions correct:


``` python
heat_map(smooth, "Figure 7-5: the six-parameter model")
```


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

#vorlwgcitv thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#vorlwgcitv p { margin: 0; padding: 0; }
 #vorlwgcitv .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; }
 #vorlwgcitv .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #vorlwgcitv .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; }
 #vorlwgcitv .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; }
 #vorlwgcitv .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; }
 #vorlwgcitv .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #vorlwgcitv .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; }
 #vorlwgcitv .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; }
 #vorlwgcitv .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; }
 #vorlwgcitv .gt_column_spanner_outer:first-child { padding-left: 0; }
 #vorlwgcitv .gt_column_spanner_outer:last-child { padding-right: 0; }
 #vorlwgcitv .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%; }
 #vorlwgcitv .gt_spanner_row { border-bottom-style: hidden; }
 #vorlwgcitv .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; }
 #vorlwgcitv .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; }
 #vorlwgcitv .gt_from_md> :first-child { margin-top: 0; }
 #vorlwgcitv .gt_from_md> :last-child { margin-bottom: 0; }
 #vorlwgcitv .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; }
 #vorlwgcitv .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; }
 #vorlwgcitv .gt_indent_1 { text-indent: 5px; }
 #vorlwgcitv .gt_indent_2 { text-indent: calc(5px * 2); }
 #vorlwgcitv .gt_indent_3 { text-indent: calc(5px * 3); }
 #vorlwgcitv .gt_indent_4 { text-indent: calc(5px * 4); }
 #vorlwgcitv .gt_indent_5 { text-indent: calc(5px * 5); }
 #vorlwgcitv .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; }
 #vorlwgcitv .gt_row_group_first td { border-top-width: 2px; }
 #vorlwgcitv .gt_row_group_first th { border-top-width: 2px; }
 #vorlwgcitv .gt_striped { color: #333333; background-color: #F4F4F4; }
 #vorlwgcitv .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; }
 #vorlwgcitv .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #vorlwgcitv .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #vorlwgcitv .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #vorlwgcitv .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #vorlwgcitv .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #vorlwgcitv .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #vorlwgcitv .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; }
 #vorlwgcitv .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #vorlwgcitv .gt_left { text-align: left; }
 #vorlwgcitv .gt_center { text-align: center; }
 #vorlwgcitv .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #vorlwgcitv .gt_font_normal { font-weight: normal; }
 #vorlwgcitv .gt_font_bold { font-weight: bold; }
 #vorlwgcitv .gt_font_italic { font-style: italic; }
 #vorlwgcitv .gt_super { font-size: 65%; }
 #vorlwgcitv .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; }
 #vorlwgcitv .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #vorlwgcitv .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; }
 #vorlwgcitv .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #vorlwgcitv .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #vorlwgcitv .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="11" id="title" class="gt_heading gt_title gt_font_normal">Figure 7-5: the six-parameter model</th>
</tr>
<tr class="gt_heading">
<th colspan="11" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Actual over fitted in percent; columns are development years</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="1" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">1</th>
<th id="2" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">2</th>
<th id="3" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">3</th>
<th id="4" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">4</th>
<th id="5" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">5</th>
<th id="6" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">6</th>
<th id="7" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">7</th>
<th id="8" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">8</th>
<th id="9" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">9</th>
<th id="10" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">10</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">1988</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #fef5f3" headers="stub-1 1">99</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f8fafc" headers="stub-1 2">101</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fbe5e1" headers="stub-1 3">98</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #a2bbd7" headers="stub-1 4">111</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #97b3d3" headers="stub-1 5">112</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #c85548" headers="stub-1 6">84</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f9dcd7" headers="stub-1 7">97</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f8d8d2" headers="stub-1 8">96</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fffefe" headers="stub-1 9">100</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fae2dd" headers="stub-1 10">97</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">1989</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #fdefed" headers="stub-2 1">99</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fef4f3" headers="stub-2 2">99</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #ebf0f6" headers="stub-2 3">102</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #b2c6de" headers="stub-2 4">109</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #eeb2a8" headers="stub-2 5">93</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #e5998c" headers="stub-2 6">90</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fef9f8" headers="stub-2 7">99</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #ccd9e9" headers="stub-2 8">106</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fefaf9" headers="stub-2 9">99</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-2 10"></td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">1990</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #f6cec7" headers="stub-3 1">95</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #c6d4e6" headers="stub-3 2">107</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #e9eff6" headers="stub-3 3">102</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f7d4ce" headers="stub-3 4">96</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #db7e70" headers="stub-3 5">88</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #faded9" headers="stub-3 6">97</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #ebaa9f" headers="stub-3 7">92</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #bfcfe3" headers="stub-3 8">107</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-3 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-3 10"></td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">1991</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #fae2de" headers="stub-4 1">97</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #e4eaf3" headers="stub-4 2">103</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f2bfb7" headers="stub-4 3">94</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #dee6f1" headers="stub-4 4">104</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f0f4f9" headers="stub-4 5">102</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #bfd0e4" headers="stub-4 6">107</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #90afd0" headers="stub-4 7">113</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-4 8"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-4 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-4 10"></td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">1992</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #f9ddd8" headers="stub-5 1">97</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #b5c8df" headers="stub-5 2">108</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fdf3f1" headers="stub-5 3">99</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #bdcee3" headers="stub-5 4">108</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f9dad4" headers="stub-5 5">97</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fbe7e4" headers="stub-5 6">98</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-5 7"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-5 8"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-5 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-5 10"></td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">1993</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #fadeda" headers="stub-6 1">97</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #dce5f0" headers="stub-6 2">104</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #e29083" headers="stub-6 3">89</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #c7d5e7" headers="stub-6 4">106</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fafbfd" headers="stub-6 5">101</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-6 6"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-6 7"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-6 8"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-6 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-6 10"></td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">1994</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #a3bbd8" headers="stub-7 1">110</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #ecaca1" headers="stub-7 2">92</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #f0b7ae" headers="stub-7 3">93</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #99b5d3" headers="stub-7 4">112</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-7 5"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-7 6"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-7 7"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-7 8"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-7 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-7 10"></td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">1995</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #eaf0f6" headers="stub-8 1">102</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #d77567" headers="stub-8 2">87</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fdf1ee" headers="stub-8 3">99</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-8 4"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-8 5"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-8 6"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-8 7"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-8 8"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-8 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-8 10"></td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">1996</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #d7e1ee" headers="stub-9 1">105</td>
<td class="gt_row gt_right" style="color: #000000; background-color: #fcece9" headers="stub-9 2">98</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 3"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 4"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 5"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 6"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 7"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 8"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-9 10"></td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">1997</th>
<td class="gt_row gt_right" style="color: #000000; background-color: #f4f7fa" headers="stub-10 1">101</td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 2"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 3"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 4"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 5"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 6"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 7"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 8"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 9"></td>
<td class="gt_row gt_right" style="color: #FFFFFF; background-color: #808080" headers="stub-10 10"></td>
</tr>
</tbody>
</table>


# 7. Forecasts and prediction error of the smaller models

Tables 7-2, 7-4 and 7-6 give the monograph's parametric bootstrap of each model, run as in section 4. The table adds the delta method of section 3 (the total row of [prediction_error()](../reference/reserving.ApcGlmFit.md#prospicio.reserving.ApcGlmFit.prediction_error)), which applies to every design and has no simulation noise:


``` python
BOOK = {  # total forecast and RMSEP of the parametric bootstrap
    "7-2 quadratic": (373641, 13086), "7-10 smooth": (373403, 13248), "7-14 interactions": (371559, 10907),
}
rows = []
for (name, book), model in zip(BOOK.items(), [quad, smooth, interact]):
    total = by_year_draws(model, seed=1).sum(axis=0)
    rows.append((name, model.total_reserve, model.prediction_error()["rmsep"][-1],
                 total.mean(), total.std(ddof=1), *book))
totals = pd.DataFrame(rows, columns=["model", "delta_forecast", "delta_rmsep", "boot_mean",
                                     "boot_rmsep", "book_mean", "book_rmsep"])
(GT(totals, rowname_col="model")
 .tab_header("Total reserve of the smaller models", "Money in the units of the triangle")
 .cols_label(delta_forecast="delta forecast", delta_rmsep="delta RMSEP", boot_mean="bootstrap mean",
             boot_rmsep="bootstrap RMSEP", book_mean="book mean", book_rmsep="book RMSEP")
 .fmt_integer(["delta_forecast", "delta_rmsep", "boot_mean", "boot_rmsep", "book_mean", "book_rmsep"]))
```


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

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

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="7" id="title" class="gt_heading gt_title gt_font_normal">Total reserve of the smaller models</th>
</tr>
<tr class="gt_heading">
<th colspan="7" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Money in the units of the triangle</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="delta_forecast" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">delta forecast</th>
<th id="delta_rmsep" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">delta RMSEP</th>
<th id="boot_mean" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">bootstrap mean</th>
<th id="boot_rmsep" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">bootstrap RMSEP</th>
<th id="book_mean" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book mean</th>
<th id="book_rmsep" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">book RMSEP</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">7-2 quadratic</th>
<td class="gt_row gt_right" headers="stub-1 delta_forecast">372,532</td>
<td class="gt_row gt_right" headers="stub-1 delta_rmsep">13,030</td>
<td class="gt_row gt_right" headers="stub-1 boot_mean">373,866</td>
<td class="gt_row gt_right" headers="stub-1 boot_rmsep">13,131</td>
<td class="gt_row gt_right" headers="stub-1 book_mean">373,641</td>
<td class="gt_row gt_right" headers="stub-1 book_rmsep">13,086</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">7-10 smooth</th>
<td class="gt_row gt_right" headers="stub-2 delta_forecast">373,006</td>
<td class="gt_row gt_right" headers="stub-2 delta_rmsep">13,215</td>
<td class="gt_row gt_right" headers="stub-2 boot_mean">373,675</td>
<td class="gt_row gt_right" headers="stub-2 boot_rmsep">13,392</td>
<td class="gt_row gt_right" headers="stub-2 book_mean">373,403</td>
<td class="gt_row gt_right" headers="stub-2 book_rmsep">13,248</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">7-14 interactions</th>
<td class="gt_row gt_right" headers="stub-3 delta_forecast">370,493</td>
<td class="gt_row gt_right" headers="stub-3 delta_rmsep">11,021</td>
<td class="gt_row gt_right" headers="stub-3 boot_mean">370,965</td>
<td class="gt_row gt_right" headers="stub-3 boot_rmsep">11,135</td>
<td class="gt_row gt_right" headers="stub-3 book_mean">371,559</td>
<td class="gt_row gt_right" headers="stub-3 book_rmsep">10,907</td>
</tr>
</tbody>
</table>


The bootstrap totals are within simulation noise of the monograph, with the lognormal bias of section 4. As in the monograph, the quadratic accident-year effect lowers the total RMSEP from about 14,100 to 13,000 with little change in the forecast, and the smooth development pattern raises it a little. The interactions lower it to about 11,000 (CV near 3%) because they model the change in the payment pattern, which the chain ladder treats as noise.

By year, the interaction model (Table 7-6):


``` python
TABLE_7_6 = {
    1989: (3630, 569, 15.7), 1990: (8557, 935, 10.9), 1991: (14563, 1203, 8.3),
    1992: (22193, 1418, 6.4), 1993: (32505, 1677, 5.2), 1994: (45771, 2018, 4.4),
    1995: (62998, 2459, 3.9), 1996: (79601, 3079, 3.9), 1997: (101742, 4094, 4.0),
    "Total": (371559, 10907, 2.9),
}
sim_table(by_year_draws(interact, seed=1), TABLE_7_6, "Table 7-6: model 7-14, parametric bootstrap")
```


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

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

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="4" id="title" class="gt_heading gt_title gt_font_normal">Table 7-6: model 7-14, parametric bootstrap</th>
</tr>
<tr class="gt_heading">
<th colspan="4" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Money in the units of the triangle; CVP in percent</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="mean" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">mean</th>
<th id="rmsep" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">RMSEP</th>
<th id="cvp" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">CVP %</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">1989</th>
<td class="gt_row gt_right" headers="stub-1 mean">3,635</td>
<td class="gt_row gt_right" headers="stub-1 rmsep">560</td>
<td class="gt_row gt_right" headers="stub-1 cvp">15.4</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">1989, book</th>
<td class="gt_row gt_right" headers="stub-2 mean">3,630</td>
<td class="gt_row gt_right" headers="stub-2 rmsep">569</td>
<td class="gt_row gt_right" headers="stub-2 cvp">15.7</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">1990</th>
<td class="gt_row gt_right" headers="stub-3 mean">8,573</td>
<td class="gt_row gt_right" headers="stub-3 rmsep">937</td>
<td class="gt_row gt_right" headers="stub-3 cvp">10.9</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">1990, book</th>
<td class="gt_row gt_right" headers="stub-4 mean">8,557</td>
<td class="gt_row gt_right" headers="stub-4 rmsep">935</td>
<td class="gt_row gt_right" headers="stub-4 cvp">10.9</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">1991</th>
<td class="gt_row gt_right" headers="stub-5 mean">14,576</td>
<td class="gt_row gt_right" headers="stub-5 rmsep">1,204</td>
<td class="gt_row gt_right" headers="stub-5 cvp">8.3</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">1991, book</th>
<td class="gt_row gt_right" headers="stub-6 mean">14,563</td>
<td class="gt_row gt_right" headers="stub-6 rmsep">1,203</td>
<td class="gt_row gt_right" headers="stub-6 cvp">8.3</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">1992</th>
<td class="gt_row gt_right" headers="stub-7 mean">22,218</td>
<td class="gt_row gt_right" headers="stub-7 rmsep">1,418</td>
<td class="gt_row gt_right" headers="stub-7 cvp">6.4</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">1992, book</th>
<td class="gt_row gt_right" headers="stub-8 mean">22,193</td>
<td class="gt_row gt_right" headers="stub-8 rmsep">1,418</td>
<td class="gt_row gt_right" headers="stub-8 cvp">6.4</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">1993</th>
<td class="gt_row gt_right" headers="stub-9 mean">32,521</td>
<td class="gt_row gt_right" headers="stub-9 rmsep">1,694</td>
<td class="gt_row gt_right" headers="stub-9 cvp">5.2</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">1993, book</th>
<td class="gt_row gt_right" headers="stub-10 mean">32,505</td>
<td class="gt_row gt_right" headers="stub-10 rmsep">1,677</td>
<td class="gt_row gt_right" headers="stub-10 cvp">5.2</td>
</tr>
<tr>
<th id="stub-11" class="gt_row gt_left gt_stub" scope="row">1994</th>
<td class="gt_row gt_right" headers="stub-11 mean">45,714</td>
<td class="gt_row gt_right" headers="stub-11 rmsep">1,992</td>
<td class="gt_row gt_right" headers="stub-11 cvp">4.4</td>
</tr>
<tr>
<th id="stub-12" class="gt_row gt_left gt_stub" scope="row">1994, book</th>
<td class="gt_row gt_right" headers="stub-12 mean">45,771</td>
<td class="gt_row gt_right" headers="stub-12 rmsep">2,018</td>
<td class="gt_row gt_right" headers="stub-12 cvp">4.4</td>
</tr>
<tr>
<th id="stub-13" class="gt_row gt_left gt_stub" scope="row">1995</th>
<td class="gt_row gt_right" headers="stub-13 mean">63,015</td>
<td class="gt_row gt_right" headers="stub-13 rmsep">2,423</td>
<td class="gt_row gt_right" headers="stub-13 cvp">3.8</td>
</tr>
<tr>
<th id="stub-14" class="gt_row gt_left gt_stub" scope="row">1995, book</th>
<td class="gt_row gt_right" headers="stub-14 mean">62,998</td>
<td class="gt_row gt_right" headers="stub-14 rmsep">2,459</td>
<td class="gt_row gt_right" headers="stub-14 cvp">3.9</td>
</tr>
<tr>
<th id="stub-15" class="gt_row gt_left gt_stub" scope="row">1996</th>
<td class="gt_row gt_right" headers="stub-15 mean">79,385</td>
<td class="gt_row gt_right" headers="stub-15 rmsep">3,143</td>
<td class="gt_row gt_right" headers="stub-15 cvp">4.0</td>
</tr>
<tr>
<th id="stub-16" class="gt_row gt_left gt_stub" scope="row">1996, book</th>
<td class="gt_row gt_right" headers="stub-16 mean">79,601</td>
<td class="gt_row gt_right" headers="stub-16 rmsep">3,079</td>
<td class="gt_row gt_right" headers="stub-16 cvp">3.9</td>
</tr>
<tr>
<th id="stub-17" class="gt_row gt_left gt_stub" scope="row">1997</th>
<td class="gt_row gt_right" headers="stub-17 mean">101,327</td>
<td class="gt_row gt_right" headers="stub-17 rmsep">4,191</td>
<td class="gt_row gt_right" headers="stub-17 cvp">4.1</td>
</tr>
<tr>
<th id="stub-18" class="gt_row gt_left gt_stub" scope="row">1997, book</th>
<td class="gt_row gt_right" headers="stub-18 mean">101,742</td>
<td class="gt_row gt_right" headers="stub-18 rmsep">4,094</td>
<td class="gt_row gt_right" headers="stub-18 cvp">4.0</td>
</tr>
<tr>
<th id="stub-19" class="gt_row gt_left gt_stub" scope="row">Total</th>
<td class="gt_row gt_right" headers="stub-19 mean">370,965</td>
<td class="gt_row gt_right" headers="stub-19 rmsep">11,135</td>
<td class="gt_row gt_right" headers="stub-19 cvp">3.0</td>
</tr>
<tr>
<th id="stub-20" class="gt_row gt_left gt_stub" scope="row">Total, book</th>
<td class="gt_row gt_right" headers="stub-20 mean">371,559</td>
<td class="gt_row gt_right" headers="stub-20 rmsep">10,907</td>
<td class="gt_row gt_right" headers="stub-20 cvp">2.9</td>
</tr>
</tbody>
</table>


Each year agrees within noise. The forecast for 1997, whose only payment is in development year 1, where the pattern changed, falls from 105,874 to about 101,300 (101,742 in Table 7-6).


# 8. Choosing between the models

Table 7-7 compares the four models by AIC, BIC and generalized cross-validation (GCV). The monograph's log-likelihood is the Poisson kernel `sum(y log(mu) - mu) / phi`, with [phi](../reference/reserving.PaidIncurredFit.md#prospicio.reserving.PaidIncurredFit.phi) held at the interaction model's value for all models, so the comparison measures fit, not a change of scale. GCV (section 4.4) is `n * RSS / (n - p)**2`, with `RSS` the plain sum of squared differences between actual and fitted.


``` python
yy = np.array(cc.residuals()["actual"])  # the 55 observed increments
n = len(yy)
phi_fixed = interact.dispersion
TABLE_7_7 = {  # AIC, BIC, GCV
    "chain ladder": (-509392, -509354, 6685428), "7-2 quadratic": (-509400, -509376, 5075351),
    "7-10 smooth": (-509397, -509385, 4311874), "7-14 interactions": (-509441, -509421, 1733202),
}
rows = []
for (name, book), model in zip(TABLE_7_7.items(), [cc, quad, smooth, interact]):
    mu, p = np.array(model.glm.fitted), len(model.glm.coefficients)
    loglik = np.sum(yy * np.log(mu) - mu) / phi_fixed
    gcv = n * np.sum((yy - mu) ** 2) / (n - p) ** 2
    rows += [(name, -2 * loglik + 2 * p, -2 * loglik + p * math.log(n), gcv), (f"{name}, book", *book)]
criteria = pd.DataFrame(rows, columns=["model", "aic", "bic", "gcv"])
(GT(criteria, rowname_col="model")
 .tab_header("Table 7-7: AIC, BIC and GCV", "Lower is better")
 .cols_label(aic="AIC", bic="BIC", gcv="GCV")
 .fmt_integer(["aic", "bic", "gcv"]))
```


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

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

<table class="gt_table" aria-labelledby="title" aria-describedby="subtitle" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
<thead>
<tr class="gt_heading">
<th colspan="4" id="title" class="gt_heading gt_title gt_font_normal">Table 7-7: AIC, BIC and GCV</th>
</tr>
<tr class="gt_heading">
<th colspan="4" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Lower is better</th>
</tr>
<tr class="gt_col_headings">
<th class="gt_col_heading gt_columns_bottom_border gt_left" scope="col"></th>
<th id="aic" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">AIC</th>
<th id="bic" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">BIC</th>
<th id="gcv" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">GCV</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">chain ladder</th>
<td class="gt_row gt_right" headers="stub-1 aic">−509,391</td>
<td class="gt_row gt_right" headers="stub-1 bic">−509,353</td>
<td class="gt_row gt_right" headers="stub-1 gcv">6,685,459</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">chain ladder, book</th>
<td class="gt_row gt_right" headers="stub-2 aic">−509,392</td>
<td class="gt_row gt_right" headers="stub-2 bic">−509,354</td>
<td class="gt_row gt_right" headers="stub-2 gcv">6,685,428</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">7-2 quadratic</th>
<td class="gt_row gt_right" headers="stub-3 aic">−509,399</td>
<td class="gt_row gt_right" headers="stub-3 bic">−509,375</td>
<td class="gt_row gt_right" headers="stub-3 gcv">5,075,358</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">7-2 quadratic, book</th>
<td class="gt_row gt_right" headers="stub-4 aic">−509,400</td>
<td class="gt_row gt_right" headers="stub-4 bic">−509,376</td>
<td class="gt_row gt_right" headers="stub-4 gcv">5,075,351</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">7-10 smooth</th>
<td class="gt_row gt_right" headers="stub-5 aic">−509,396</td>
<td class="gt_row gt_right" headers="stub-5 bic">−509,384</td>
<td class="gt_row gt_right" headers="stub-5 gcv">4,311,876</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">7-10 smooth, book</th>
<td class="gt_row gt_right" headers="stub-6 aic">−509,397</td>
<td class="gt_row gt_right" headers="stub-6 bic">−509,385</td>
<td class="gt_row gt_right" headers="stub-6 gcv">4,311,874</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">7-14 interactions</th>
<td class="gt_row gt_right" headers="stub-7 aic">−509,440</td>
<td class="gt_row gt_right" headers="stub-7 bic">−509,420</td>
<td class="gt_row gt_right" headers="stub-7 gcv">1,733,200</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">7-14 interactions, book</th>
<td class="gt_row gt_right" headers="stub-8 aic">−509,441</td>
<td class="gt_row gt_right" headers="stub-8 bic">−509,421</td>
<td class="gt_row gt_right" headers="stub-8 gcv">1,733,202</td>
</tr>
</tbody>
</table>


GCV agrees to five significant figures. AIC and BIC are 0.7 to 1.4 above the monograph's, a difference of level only: differences between models agree within the printed rounding, and every criterion ranks the models as the monograph does, with the interaction model best.

The level is sensitive: the log-likelihood is about 254,700 in these units, so a relative difference of `2e-6` in [phi](../reference/reserving.PaidIncurredFit.md#prospicio.reserving.PaidIncurredFit.phi), or a looser convergence test elsewhere, moves the AIC by one. The code uses each fit's `glm.fitted` and `glm.coefficients` because the monograph defines its own criteria; the GLM's [aic](../reference/models.GlmFit.md#prospicio.models.GlmFit.aic) is the usual Poisson AIC and answers a different question.


# 9. A gamma cross-classified model

Chapter 2 of the monograph puts the ODP in the Tweedie family. Section 6.5 gives a gamma error (variance proportional to the mean squared) as the alternative to try when the residual spread grows with the fitted value. The monograph prints no gamma results for this triangle. In prospicio the fit needs one argument, `family="gamma"` (or `family="tweedie"` with a [power](../reference/reserving.ApcGlm.md#prospicio.reserving.ApcGlm.power) between 1 and 2). This uses the default cross-classified design:


``` python
gamma = OdpGlm(family="gamma").fit(tri, "paid")
print(f"gamma phi {gamma.dispersion:.4f}")
```


    gamma phi 0.0047


``` python
by_gamma = pd.DataFrame({
    "year": [str(y) for y in YEARS[1:]] + ["Total"],
    "chain_ladder": [*cc.reserves[1:], cc.total_reserve],
    "gamma": [*gamma.reserves[1:], gamma.total_reserve],
})
(GT(by_gamma, rowname_col="year")
 .tab_header("Reserves of the cross-classified model", "Poisson (the chain ladder) against gamma")
 .cols_label(chain_ladder="chain ladder")
 .fmt_integer(["chain_ladder", "gamma"]))
```


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

#jcujqjcuqy thead, tbody, tfoot, tr, td, th { border-style: none; }
 tr { background-color: transparent; }
#jcujqjcuqy p { margin: 0; padding: 0; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .gt_caption { padding-top: 4px; padding-bottom: 4px; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .gt_column_spanner_outer:first-child { padding-left: 0; }
 #jcujqjcuqy .gt_column_spanner_outer:last-child { padding-right: 0; }
 #jcujqjcuqy .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%; }
 #jcujqjcuqy .gt_spanner_row { border-bottom-style: hidden; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .gt_from_md> :first-child { margin-top: 0; }
 #jcujqjcuqy .gt_from_md> :last-child { margin-bottom: 0; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .gt_indent_1 { text-indent: 5px; }
 #jcujqjcuqy .gt_indent_2 { text-indent: calc(5px * 2); }
 #jcujqjcuqy .gt_indent_3 { text-indent: calc(5px * 3); }
 #jcujqjcuqy .gt_indent_4 { text-indent: calc(5px * 4); }
 #jcujqjcuqy .gt_indent_5 { text-indent: calc(5px * 5); }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .gt_row_group_first td { border-top-width: 2px; }
 #jcujqjcuqy .gt_row_group_first th { border-top-width: 2px; }
 #jcujqjcuqy .gt_striped { color: #333333; background-color: #F4F4F4; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #jcujqjcuqy .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
 #jcujqjcuqy .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
 #jcujqjcuqy .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
 #jcujqjcuqy .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
 #jcujqjcuqy .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #jcujqjcuqy .gt_left { text-align: left; }
 #jcujqjcuqy .gt_center { text-align: center; }
 #jcujqjcuqy .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
 #jcujqjcuqy .gt_font_normal { font-weight: normal; }
 #jcujqjcuqy .gt_font_bold { font-weight: bold; }
 #jcujqjcuqy .gt_font_italic { font-style: italic; }
 #jcujqjcuqy .gt_super { font-size: 65%; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
 #jcujqjcuqy .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; }
 #jcujqjcuqy .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
 #jcujqjcuqy .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
 #jcujqjcuqy .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">Reserves of the cross-classified model</th>
</tr>
<tr class="gt_heading">
<th colspan="3" id="subtitle" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">Poisson (the chain ladder) against gamma</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="gamma" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">gamma</th>
</tr>
</thead>
<tbody class="gt_table_body">
<tr>
<th id="stub-1" class="gt_row gt_left gt_stub" scope="row">1989</th>
<td class="gt_row gt_right" headers="stub-1 chain_ladder">3,398</td>
<td class="gt_row gt_right" headers="stub-1 gamma">3,423</td>
</tr>
<tr>
<th id="stub-2" class="gt_row gt_left gt_stub" scope="row">1990</th>
<td class="gt_row gt_right" headers="stub-2 chain_ladder">8,155</td>
<td class="gt_row gt_right" headers="stub-2 gamma">8,134</td>
</tr>
<tr>
<th id="stub-3" class="gt_row gt_left gt_stub" scope="row">1991</th>
<td class="gt_row gt_right" headers="stub-3 chain_ladder">14,579</td>
<td class="gt_row gt_right" headers="stub-3 gamma">15,086</td>
</tr>
<tr>
<th id="stub-4" class="gt_row gt_left gt_stub" scope="row">1992</th>
<td class="gt_row gt_right" headers="stub-4 chain_ladder">22,645</td>
<td class="gt_row gt_right" headers="stub-4 gamma">22,667</td>
</tr>
<tr>
<th id="stub-5" class="gt_row gt_left gt_stub" scope="row">1993</th>
<td class="gt_row gt_right" headers="stub-5 chain_ladder">31,865</td>
<td class="gt_row gt_right" headers="stub-5 gamma">31,820</td>
</tr>
<tr>
<th id="stub-6" class="gt_row gt_left gt_stub" scope="row">1994</th>
<td class="gt_row gt_right" headers="stub-6 chain_ladder">45,753</td>
<td class="gt_row gt_right" headers="stub-6 gamma">45,434</td>
</tr>
<tr>
<th id="stub-7" class="gt_row gt_left gt_stub" scope="row">1995</th>
<td class="gt_row gt_right" headers="stub-7 chain_ladder">60,093</td>
<td class="gt_row gt_right" headers="stub-7 gamma">60,216</td>
</tr>
<tr>
<th id="stub-8" class="gt_row gt_left gt_stub" scope="row">1996</th>
<td class="gt_row gt_right" headers="stub-8 chain_ladder">80,983</td>
<td class="gt_row gt_right" headers="stub-8 gamma">80,829</td>
</tr>
<tr>
<th id="stub-9" class="gt_row gt_left gt_stub" scope="row">1997</th>
<td class="gt_row gt_right" headers="stub-9 chain_ladder">105,874</td>
<td class="gt_row gt_right" headers="stub-9 gamma">105,857</td>
</tr>
<tr>
<th id="stub-10" class="gt_row gt_left gt_stub" scope="row">Total</th>
<td class="gt_row gt_right" headers="stub-10 chain_ladder">373,346</td>
<td class="gt_row gt_right" headers="stub-10 gamma">373,466</td>
</tr>
</tbody>
</table>


The gamma fit weights each cell's relative error equally and does not keep the row and column totals, so its forecasts differ slightly from the chain ladder's. `gamma.prediction_error()` applies the delta method of section 3 with process variance `phi * mu**2`.


# 10. What matched

Every table and figure above agrees with the monograph to the printed digits, apart from these known differences:

- The parametric bootstraps (Tables 5-5, 7-2, 7-4 and 7-6) differ by simulation noise and by the process distribution, which the monograph does not state. Their means have the lognormal bias.
- The AIC and BIC of Table 7-7 differ by about one unit in 509,000, from [phi](../reference/reserving.PaidIncurredFit.md#prospicio.reserving.PaidIncurredFit.phi) or convergence. GCV agrees to five figures.
- Three renormalised ultimates of Table 3-5 are one unit different from Table 3-3, because the monograph rounds.
