Skip to main content

methods.BootstrapResult

What odp_bootstrap() returns: pyarrow Tables with fixed column types.

Usage

Source

methods.BootstrapResult(
    method,
    as_of,
    dev_grain_months,
    n_draws,
    seed,
    central,
    origins,
    totals,
    quantiles,
    draws,
    residuals
)

A missing number is an Arrow null, never NaN. to_polars(name) gives any of the tables as a polars DataFrame.

Attributes

method: str

The method refitted on every simulated triangle: "chain_ladder", "bornhuetter_ferguson", "benktander" or "cape_cod".

as_of: datetime.date

The information date, the evaluation date of the latest cell.

dev_grain_months: int

Months per development step.

n_draws: int

The number of simulated run-offs.

seed: int

The seed the draws came from: the one passed, or, when seed=None was passed, the fresh entropy drawn for it, so passing it back as seed gives the same draws again.

central: ReserveResult

The point fit: exactly what methods.<method> returns for the same cells and options.

origins: pyarrow.Table

One row per origin period: origin and origin_period (as in ReserveResult), latest_dev_lag (int64), latest (the actual latest cumulative), central_ultimate and central_ibnr (from central), mean_ibnr and sd_ibnr (the draws’ mean, and their standard deviation with ddof=1, null when n_draws is 1) and mean_ultimate (latest + mean_ibnr), all float64.

totals: pyarrow.Table

One row: latest, central_ultimate, central_ibnr, mean_ibnr, sd_ibnr (null at one draw) and mean_ultimate for the sum over the origins (float64); n_draws; n_residuals (the residuals resampled); degrees_of_freedom (observed cells minus the ODP model’s parameters, one per origin and one per development age after the first); n_negative_fitted (observed cells whose fitted mean is negative, 0 unless negative_increments="reflect"); n_draws_unit_factor (draws in which some refitted factor had no positive volume and took 1.0); n_draws_negative_ibnr (draws whose total is below 0); n_draws_tail_fallback (draws whose tail curve failed its checks and used the central fit’s curve), all int64; phi (float64, the Pearson scale); and the options residual_adjustment, residual_pool, negative_increments and process (string).

quantiles: pyarrow.Table

One row per origin, or the total, and level: origin and origin_period (null for the total), level (the probability, as passed), ibnr (the quantile of the draws, numpy’s linear rule, which is np.percentile with the level times 100 and R’s type 7) and tvar (the mean of the draws at or above that quantile). The total’s rows come first, then each origin’s in origin order, each in the order of the levels.

draws: pyarrow.Table

Every draw of every origin, n_draws times the number of origins rows, draw by draw: draw (int64, from 0), origin, origin_period and ibnr (float64). A draw’s total is the sum of its rows.

residuals: pyarrow.Table
One row per observed cell, origin by origin: origin, origin_period, dev_lag (int64), increment and fitted (float64, the observed and the fitted incremental amount), residual (float64, the unscaled Pearson residual (increment - fitted) / sqrt(|fitted|), null where fitted is 0), leverage (float64, the cell’s leverage in the ODP GLM, null where fitted is 0), adjusted (float64, the value resampled from this cell: adjusted, and centred under residual_pool="centred"; null off the pool), in_pool (bool), reason (string: pooled, leverage_one (a cell fitted exactly, left out under residual_pool="centred"), zero_fitted_mean or excluded_link) and link_reason (string, the link_ratios.reason of the link ratio whose development option took the cell out, null otherwise).

Methods

Name Description
to_polars() One of the result’s tables as a polars DataFrame.

to_polars()

One of the result’s tables as a polars DataFrame.

Usage

Source

to_polars(table="origins")

table is "origins" (the default), "totals", "quantiles", "draws" or "residuals"; central.to_polars gives the point fit’s. Needs polars: pip install "ibnr[polars]".