reserving.OdpBootstrap

Over-dispersed Poisson bootstrap of the chain ladder (England and

Usage

reserving.OdpBootstrap()

Verrall 2002), as R ChainLadder’s BootChainLadder: adjusted Pearson residuals of the volume-weighted chain ladder are resampled into pseudo triangles, each is re-projected, and process error is added to every future incremental value. Simulation i uses random stream i of seed for every segment in turn, so results do not depend on the number of threads.

Parameters

n_sims: int = 10000

Number of simulations; positive.

seed: int = 0

Seed of the simulation streams, from 0 to 2**64 - 1. R accepts seeds below 2**53; a seed in both ranges gives the same draws.

process: (gamma, none) = "gamma"
Process error on each simulated future incremental value: Gamma with the expected value as mean and variance scale * |mean| (R’s process.distr = "gamma"), or none for parameter error only.

Raises

ValueError

If n_sims is zero or process is unknown.

OverflowError
If n_sims or seed is negative or too large.

Examples

>>> from prospicio.reserving import OdpBootstrap, Triangle
>>> tri = Triangle.from_long(
...     [2020] * 4 + [2021] * 3 + [2022] * 2 + [2023],
...     [12, 24, 36, 48, 12, 24, 36, 12, 24, 12],
...     [100.0, 150.0, 165.0, 170.0, 110.0, 170.0, 180.0, 120.0, 175.0, 130.0],
... )
>>> fit = OdpBootstrap(n_sims=2000, seed=42).fit(tri, "values")
>>> fit.reserves.components()

[(‘2020’,), (‘2021’,), (‘2022’,), (‘2023’,)]

>>> fit.reserves.mean() > 0

True

Attributes

Name Description
n_sims Number of simulations.
process Process error: "gamma" or "none".
seed Seed of the simulation streams.

n_sims

Number of simulations.

n_sims: int


process

Process error: "gamma" or "none".

process: str


seed

Seed of the simulation streams.

seed: int

Methods

Name Description
fit() Bootstraps one measure column in every segment of a cumulative
one_year() The one-year view of any reserving method: the claims development

fit()

Bootstraps one measure column in every segment of a cumulative

Usage

fit(triangle, column)

triangle, each with its own residuals and scale, into one joint distribution of the reserves. Every origin must be observed from the first age up to its latest.

Parameters
triangle: Triangle

Cumulative, with any number of segments.

column: str
Returns
OdpBootstrapFit
Raises
ValueError
As ChainLadder.fit, and if an origin has a gap before its latest age or a segment has too few observed cells for the degrees of freedom to be positive.

one_year()

The one-year view of any reserving method: the claims development

Usage

one_year(triangle, column, method, exposure=None)

result over the coming year, by re-reserving on the bootstrap (“actuary in the box”). The coming year is every cell valued in the twelve months after the segment’s valuation: one per origin for an annual development grain, four for a quarterly one (fewer for an origin that reaches the last age). Each simulation resamples the residuals for the volume-weighted factors, projects the increments of those cells in turn from the origin’s resampled latest value with the bootstrap’s process error, as fit projects, adds them to the observed latest value, appends the cells to the triangle, refits method and records CDR = opening ultimate - closing ultimate; a negative CDR is an adverse development. An origin whose remaining cells all fall in the year thus has its lifetime bootstrap reserve as its one-year view; an origin at the last age gets no new cell; an origin short of the latest diagonal develops from its own latest cell, and only the year’s cells are appended. Unlike MackFit.claims_development_result() (Merz and Wüthrich), any averaging, tail and development grain are allowed.

Parameters
triangle: Triangle

Cumulative, with any number of segments and any development grain.

column: str
method: (ChainLadder, ExpectedLoss, BornhuetterFerguson, Benktander or CapeCod)

The method refitted at the start and at the end of the year.

exposure: str = None
The exposure column; required by the expected-loss methods, not taken by ChainLadder. Its latest value per origin is kept for the end of the year.
Returns
OneYearFit
Raises
TypeError

If method is not one of the classes above.

ValueError
As fit and the method’s own fit; if exposure is missing for an expected-loss method or given for ChainLadder; or if the refit fails in any simulation (the message counts them and gives one).
Examples
>>> from prospicio.reserving import BornhuetterFerguson, OdpBootstrap, Triangle
>>> tri = Triangle.from_long(
...     [2020] * 4 + [2021] * 3 + [2022] * 2 + [2023],
...     [12, 24, 36, 48, 12, 24, 36, 12, 24, 12],
...     {
...         "paid": [100.0, 150.0, 165.0, 170.0, 110.0, 170.0, 180.0, 120.0, 175.0, 130.0],
...         "premium": [250.0] * 4 + [260.0] * 3 + [270.0] * 2 + [280.0],
...     },
... )
>>> boot = OdpBootstrap(n_sims=2000, seed=42)
>>> fit = boot.one_year(tri, "paid", BornhuetterFerguson(apriori=0.7), exposure="premium")
>>> fit.cdr.components()

[(‘2020’,), (‘2021’,), (‘2022’,), (‘2023’,)]

>>> fit.opening_reserve[0]

0.0

>>> fit.cdr.variance() < boot.fit(tri, "paid").reserves.variance()

True