methods.odp_bootstrap()
England and Verrall’s over-dispersed Poisson bootstrap of the whole run-off.
Usage
methods.odp_bootstrap(
cells,
*,
method="chain_ladder",
premium=None,
expected_loss_ratio=None,
n_iters=1,
decay=None,
trend=None,
prior_cv=0.0,
n_draws=1000,
seed=None,
quantiles=_BOOTSTRAP_QUANTILES,
residual_adjustment="hat",
residual_pool="centred",
negative_increments="refuse",
process="gamma",
dev_grain_months=12,
average="volume",
history_periods=None,
drop_high=False,
drop_low=False,
preserve=1,
drop_above=None,
drop_below=None,
exclude=(),
exclude_valuations=(),
trim_ties="volume",
unsupported_factor="raise",
exhausted_exclusions="keep",
zero_cells="missing",
tail=None,
tail_factor=None,
tail_decay=None,
tail_attach_lag=None,
tail_fit_lags=None,
tail_steps=None,
tail_rows=None
)The residual bootstrap of R’s BootChainLadder and chainladder-python’s BootstrapODPSample: fit method, take the Pearson residuals of the observed increments against the fitted ones, resample them into n_draws simulated triangles, refit method on each, and add process noise to every future cell. Each draw is a possible run-off of every origin; draws has them all, and origins, totals and quantiles summarise them beside the point fit, central.
cells, the development options and the tail options are as in chain_ladder(). method is "chain_ladder" (the default), "bornhuetter_ferguson", "benktander" or "cape_cod"; premium, expected_loss_ratio, n_iters, decay and trend are as in those functions, each given only to the methods that read it (decay and trend, None by default, are Cape Cod’s 1.0 and 0.0). Mack’s standard errors are mack()’s.
One set of development options. They make the central fit, whose factors (before any tail) make the fitted values, and they decide which residuals are resampled: the cell a link ratio develops into leaves the pool when a development option leaves that ratio out, and so does the first cell of an origin whose ratio from the first age is left out (chainladder-python’s rule; the zero rule leaves every residual in, since a zero increment is data). Every simulated triangle is refitted with the options that pick a link ratio by where it is (history_periods, exclude, exclude_valuations, the zero rule), decided once on the real triangle. The options that pick a ratio by its size (drop_high, drop_low, drop_above, drop_below) act once, on the central factors and the pool, and not again on each simulated triangle: trimming those again removes ordinary draws a second time and pulls the simulated mean below the central estimate (3.5% on the Reserving app’s workbook and 22% on raa with drop_high, measured on chainladder-python itself). average applies in both places. The fitted values are the backward recursion from the central factors whatever the average, so the hat adjustment’s leverage is exactly the ODP GLM’s only for the volume average over every link ratio; refitting the fitted triangle gives the central factors back for every average.
Tails act once too, like the size rules: the fitted values and the residual pool come from the central factors before the tail, and the tail (the same kind, attachment age and fitted range) is applied only in each refit, as chainladder-python does. A curve is refitted to each simulated triangle’s own factors; a draw whose curve fails the tail’s checks uses the central fit’s curve and is counted in totals.n_draws_tail_fallback. With a tail every origin’s run-off includes it, as one more future cell per origin. Refitting the fitted triangle gives the central fit back whatever the tail and wherever it is attached. Were a curve attached before the last age (tail_attach_lag) also in the fitted values, each refit would fit it to ratios scattered around the curve rather than the data, and the mean of the draws would move off the central estimate (measured at 20,000 draws, as a share of the central IBNR: 6.2% below on genins with an exponential curve at 72 months; 0.4% above with the curve out of them, and chainladder-python 0.1% to 0.5% above). A curve is not a straight line in the factors, so the mean need not sit exactly on the central estimate even so: on raa with an inverse power curve at 60 months it is 26% above, and chainladder-python’s 27% to 28%.
The bootstrap options:
residual_adjustment:"hat"(the default) divides each Pearson residual bysqrt(1 - h),hits leverage in the ODP GLM, chainladder-python’shat_adj=True;"dof"multiplies every residual bysqrt(n / (n - p)), R’s rule;"none"leaves them as they are, which is what chainladder-python’shat_adj=Falsedoes (its docstring says degrees of freedom). The leverage is computed with a pseudo-inverse, so a development factor of exactly 1.0 does not switch the adjustment off, as it does in chainladder-python.residual_pool:"centred"(the default, chainladder-python’s rule) resamples every residual except the cells fitted exactly (leverage one: the first origin’s last cell and the last origin’s first cell), after subtracting their mean;"all"(R’s rule) resamples every residual, the exact cells’ zeros included, as they are.negative_increments:"refuse"(the default) refuses a negative observed increment, and a tail that puts link factors below 1 (negative_fitted_mean: it makes the expected payments after it negative in every refit), because the over-dispersed Poisson model is defined on non-negative increments."reflect"bootstraps them as R and chainladder-python do:sqrt(|m|)scales a residual and the noise of a negative mean is reflected through its sign.totals.n_negative_fittedcounts the negative fitted means, whose results are rarely usable.process: the noise added to each future cell, with meanmand variancephi * |m|:"gamma"(the default, as in R and chainladder-python),"od_poisson"(phitimes a Poisson count) or"none"(no noise, so the draws are the refitted means).prior_cv: Bornhuetter-Ferguson, Benktander and Cape Cod only. Above 0 it varies the a priori loss ratio from draw to draw: each draw’s a priori ultimates are multiplied by one lognormal number with mean 1 and coefficient of variationprior_cv, shared by every origin of the draw (for Cape Cod, the loss ratio estimated from that draw’s triangle). The central fit never draws. chainladder-python’sapriori_sigmais a normal standard deviation instead:prior_cv = apriori_sigma / apriorifor Bornhuetter-Ferguson and Benktander,prior_cv = apriori_sigmafor Cape Cod, keeps its first two moments.- n_draws: how many run-offs to simulate, a whole number of 1 or more (1,000 by default).
drawsholds n_draws times the number of origins rows, and that product is refused above 100,000,000. seed: a whole number of 0 or more makes the draws repeatable, 0 included;None(the default) draws fresh entropy and returns it asBootstrapResult.seed. The residuals, the process noise and the a priori multipliers each have a stream of their own, soprocessandprior_cvnever change the simulated triangles, and the firstkdraws of a run are the draws of ak-draw run. The draws do not reproduce chainladder-python’s or R’s for the same seed.quantiles: the levels of thequantilestable, probabilities strictly between 0 and 1 (divide a percentile by 100).
Every draw is a finite number: a simulated triangle whose refitted factors have no positive volume takes a factor of 1.0 at that age (counted in totals.n_draws_unit_factor), and a run with a draw that is still not finite is refused (result_not_finite) rather than answered with 0 in its place. The simulated mean usually sits a little above the central estimate (3% on raa, 1% on genins); that is the refit’s non-linearity, and R shows it too.
Returns a BootstrapResult. Input it will not answer is refused with Refusal: besides the refusals of the point method, negative_increment and negative_fitted_mean (under negative_increments="refuse"), degenerate_fit (a non-zero increment against a zero fitted mean, or a leverage that cannot be computed under the hat adjustment or the centred pool), not_identified (no more cells than the ODP model has parameters), empty_residual_pool and result_not_finite. The run ties out to chainladder-python 0.9.2 draw for draw when both are fed the same residual choices, and to R’s BootChainLadder within Monte Carlo error (tests/test_odp_runoff.py).