ODP bootstrap
odp_bootstrap_fit.RdOver-dispersed Poisson bootstrap of the chain ladder (England and 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. The scale and residuals match BootChainLadder()
exactly, and the reserve distribution within Monte Carlo error
(validation/reference/reserving_bootstrap_r.csv).
Usage
odp_bootstrap_fit(ptr)
odp_bootstrap(
triangle,
column = NULL,
n_sims = 10000,
seed = 0,
process = c("gamma", "none"),
tail = 1,
tail_std_err = NULL,
dependence = c("independent", "synchronized", "rank_correlation"),
spearman = NULL,
ldf = NULL,
ldf_kind = NULL,
ldf_weight = 1,
ldf_origin = NULL,
ldf_underwriting = NULL,
n_periods = NULL,
drop_high = 0,
drop_low = 0,
cells = FALSE
)Arguments
- ptr
An
OdpBootstrapFitpointer; used internally.- triangle
A cumulative triangle, with any number of segments, every origin observed from the first age up to its latest.
- column
Name of the column to fit; by default the only one.
- n_sims
Number of simulations; positive.
- seed
Seed of the simulation streams, a non-negative whole number.
- process
Process error on each simulated future incremental value:
"gamma"(mean the expected value, variancescale * |mean|, R'sprocess.distr = "gamma") or"none"for parameter error only.- tail
Development past the oldest age: a number (a constant factor),
tail_constant(),tail_curve(),tail_bondy()ortail_log_linear(), as inchain_ladder(); 1 (no tail, as R'sBootChainLadder) by default. An estimated tail (a curve, Bondy or the log-linear rule) is refitted on each simulation's pseudo factors, which gives its parameter error; a constant one is fixed unlesstail_std_erris given. The step from the oldest age to ultimate is one more future increment, with mean the pseudo value at the oldest age times the tail factor less 1 and the same process error.odp_one_year()takes it withbootstrap_tail = TRUE. R's rule (tail_log_linear()) refitted on the ODP's pseudo factors is often exactly 1 (5.7% of simulations on RAA) and on average high (RAA's oldest origin's mean reserve 78% above the plug-in); a constant tail withtail_std_errhas neither.- tail_std_err
Standard error of a constant tail factor: each simulation draws the factor from the lognormal with the factor as mean and this standard deviation.
NULLkeeps it fixed, unlikemack_bootstrap(), which extrapolates Mack's standard error; unused when the factor is 1, and an error with an estimated tail.- dependence
How the segments of a multi-segment triangle depend on each other:
"independent", each resampling its own residuals;"synchronized", every segment resampling the residuals of the same origins and ages in each simulation (the synchronous bootstrap of Taylor and McGuire 2007 and Kirschner, Kerley and Isaacs 2008), so the lines' parameter error takes the correlation of their residuals while process error stays independent, which needs the same origins, ages and observed cells in every segment; or"rank_correlation", each segment bootstrapped independently and the segments' simulations then reordered as whole rows (Iman-Conover on the segment totals) to the Spearman matrixspearmanand put in a random order, so that rowiis no longer simulationibut any subset of rows is a fair sample.- spearman
With
dependence = "rank_correlation"only: Spearman's rho between the segments' totals, a symmetric matrix with a unit diagonal and one row and column per segment in index order. It is converted to the normal scores' correlation2 sin(pi rho / 6), which must be positive definite.- ldf, ldf_kind, ldf_weight, ldf_origin, ldf_underwriting
A selected development pattern, as in
chain_ladder(). The residuals and the scale come from the triangle's own volume-weighted factors; each simulation then usesw * selected + (1 - w) * pseudoat the selected ages, so a fully selected factor is the same in every simulation (no parameter error) and a blended one moves by1 - wtimes the pseudo factor's deviation. The origins' level still moves (each simulation projects from its pseudo latest values), so even a fully selected pattern keeps part of the spread: with every factor selected and no process error, about 73% of the unblended standard deviation on RAA. This is the ODP's parameter error in the origins' levels, which a development pattern does not fix, and it is kept on purpose;mack_bootstrap()projects from the observed latest values and keeps only the process error. A supplied pattern lowers the reported uncertainty. With notail, a cumulative pattern to the oldest age implies a constant tail (pattern_tailofchain_ladder()), the same in every simulation unlesstail_std_erris given.- n_periods, drop_high, drop_low
Which link ratios the volume-weighted chain ladder behind
odp_bootstrap()averages, as inchain_ladder()(the bootstrap has noaverage). The fitted values are back-cast with the factors under the exclusions; an incremental cell has a residual only if the link ratio it closes is kept (the first age's cells always do), and the pseudo factors average the kept links only. The drops are fixed on the observed triangle: the simulated triangles are not ranked again. The scale is the sum of the kept squared residuals overN - p(chainladder-python's rule), which is biased low under exclusions: on RAA withn_periods = 3it is about 70% of the plain scale (694 against 984), and the standard deviations are correspondingly narrow. Seeodp_one_year()for the one-year view.- cells
TRUEto keep each simulation's future incremental values in the fit'scells, forreinflate_draws(). The reserves and patterns are the same, bit for bit, with and without them, since keeping them draws no other random number. They taken_simstimes the number of future cells in memory (about 4 MB on RAA at 10,000 simulations, 66 MB on a 40 by 40 quarterly triangle), so they are kept only when asked for. An error when no segment has a future cell (a fully developed triangle with notail).
Details
Every segment of the triangle is bootstrapped with its own residuals and
scale, into one joint distribution of the reserves, the segments
depending on each other as dependence says: independently by default,
synchronized, or rank-correlated to a Spearman matrix. The joint
distribution goes on to the portfolio's risk measure and its allocation
to the lines (capital_allocation()). Simulation i uses random stream i of
seed for every segment in turn, so results do not depend on the number
of threads.
Properties of the fit: chain_ladder (the chain_ladder_fit the
bootstrap is centred on), origins, development, fitted (fitted
incremental values) and residuals (adjusted Pearson residuals
(x - m) / sqrt(|m|) * sqrt(n / (n - p))), both origin x development
matrices with NA where not observed, scale (the dispersion phi) and
reserves, a predictive_distribution of the reserve with the
triangle's keys and origin as dimensions and one component per segment
and origin, so aggregate(boot@reserves, keep = "lob") keeps the
dependence between segments. mean(), quantile(), VaR() and
TVaR() of reserves describe the total reserve. Columns of
draw_matrix() follow origins. fitted, residuals and scale need
a single-segment fit: with several segments use segment(), or
totals_frame() for the scales.
cells is NULL unless the fit was made with cells = TRUE: then a
predictive_distribution of each simulation's future incremental
values, as simulated with their process error, with the triangle's
keys, origin and development (the age in months at the end of the
cell's development period) as dimensions; one component per future
cell, each origin's cells after its latest age in age order, segment by
segment as reserves, and one row per simulation in the reserves'
order (under dependence = "rank_correlation" each segment's cells move
with its reserves). With a tail each origin has one more cell, at the
oldest age plus one development period, kept in every simulation even
when it is 0; a fully developed origin with no tail has no cell. Each
origin's cells sum to its reserve in every simulation, so
aggregate(boot@cells, c(keys, "origin")) gives reserves.
reinflate_draws() takes them as they are. segment() keeps its
segment's part of them, NULL when that segment has no future cell.
See also
chain_ladder(), mack(); odp_one_year() for the one-year
view on the same bootstrap.
Examples
long <- data.frame(year = rep(2018:2021, 4:1),
age = c(12, 24, 36, 48, 12, 24, 36, 12, 24, 12),
paid = c(100, 150, 165, 170, 110, 170, 180, 120, 175, 130))
boot <- odp_bootstrap(triangle(long, "year", "age", "paid"), n_sims = 2000, seed = 42)
boot@scale
#> [1] 0.7286819
boot@reserves@keys
#> origin
#> 1 2018
#> 2 2019
#> 3 2020
#> 4 2021
mean(boot@reserves)
#> [1] 111.7906
quantile(boot@reserves, 0.995)
#> [1] 155.9527