methods.ReserveResult
What a reserving method returns: pyarrow Tables with fixed column types.
Usage
methods.ReserveResult(
method,
as_of,
dev_grain_months,
origins,
development,
link_ratios,
totals,
cells=None,
coefficients=None
)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 function that made it, such as
"chain_ladder". as_of: datetime.date-
The information date, the evaluation date of the latest cell, which is the last day of a period (the accident year 1988 at 12 months is 1988-12-31).
dev_grain_months: int-
Months per development step.
origins: pyarrow.Table-
One row per origin period:
origin(the caller’s label for the period, the value written in the cells’origin_periodcolumn, as an Arrow int64 for integer years of any width, string for text labels of any string or dictionary type, date32 for dates, or the input’s own timestamp type, time zone included, for timestamps),origin_period(date32, always the first day of the period),latest_dev_lag(int64, months), latest, ultimate andibnr(float64;ibnrisultimate - latest). Bornhuetter-Ferguson, Benktander and Cape Cod addexpected_loss_ratio, the loss ratio applied to the origin’s premium; Cape Cod also addstrended_loss_ratio(the loss ratio at the valuation date’s level, chainladder-python’sapriori_) andtrend_factor(1.0 attrend=0); Mack addsmack_seand its two parts,parameter_seandprocess_se. With a tail the ultimates, reserves and standard errors include it, the oldest origin’s too. An origin whose latest cumulative is zero keeps 0 as its latest amount, so its chain-ladder ultimate is 0 and, under Mack withzero_cells="missing", itsmack_seis 0 too; chainladder-python leaves both missing. development: pyarrow.Table-
One row per observed development age, and with a tail
tail_rowsmore for the ages after the last observed one:dev_lag(int64),factor(the factor from this row to the next, null on the final row), cdf (the factor to ultimate, float64) andpct_reported(1 / cdf). Without a tail cdf runs to the last observed age, sopct_reportedis 1.0 there by construction rather than by measurement. With one it includes the tail, and on the final row it is what is left of the tail after the rows shown, so the factors from any row times the final row’s cdf are that row’s cdf.source(string) is"link_ratios"for a factor averaged from link ratios and"tail"for one from the tail (an attached age, or a row beyond the triangle), null at the last age without a tail;curve_factor(float64) is a fitted curve’s factor at each row but the final one;in_tail_fit(bool) says whether the curve was fitted through that age’s factor, null from the last observed age on. Every method but tweedie_glm() and ml_development() addsn_selected(int64, the link ratios selected at that age; on an age whosesourceis"tail"the factor is the tail’s, not their average),extreme_trimming_skippedandbounds_skipped(bool); the chain ladder, Bornhuetter-Ferguson, Benktander and Cape Cod addunity_fallback(bool); Mack addssigma,std_err(the factor’s standard error) andsigma_extrapolated(bool), all null at the last observed age and beyond it. The module docstring has the table of every column and the methods that carry it. tweedie_glm() addsn_observed(int64) and ml_development()n_trained(int64) andunity_fallback; both have none of the tail columns, and fit a pattern that can differ by origin, wherefactor, cdf andpct_reportedare null and each origin’s are incells. link_ratios: pyarrow.Table or None-
Every observed link ratio, one row each:
originandorigin_period(as inorigins),from_dev_lag(int64, the age the ratio develops from),previousandfollowing(float64, the cumulatives at that age and the next),ratio(float64,following / previous, null whenpreviousis 0),included(bool, whether the factor used it) andreason(string:included,zero_cell(a zero at either end, left out underzero_cells="missing"),undefined_ratio(previousis 0, underzero_cells="observed"),history_window,explicit_exclusion,valuation_exclusion,drop_above,drop_below,drop_lowordrop_high: the first rule that left it out, in the order the rules run). Mack’s is the chain ladder’s for the same options; underzero_cells="observed"with no development option every observed link ratio isincluded, a ratio out of a zero too (null, with its following amount in the volume sum), as R’sMackChainLadderreads it. Every link-ratio method returns this table;Nonefor tweedie_glm() and ml_development(), which fit the cells rather than link ratios, and for a result built by hand. totals: pyarrow.Table-
One row with latest, ultimate and
ibnrsummed over the origins, andtail_factor(float64), the development beyond the last observed age: 1.0 without a tail, the constant itself for a constant tail attached at the last age, and what is left of it after the attached ages for one attached earlier (chainladder-python’stail_). Mack addsmack_se,parameter_seandprocess_sefor the total, which is not the sum of the origins’ standard errors: the origins share the estimated factors; andtail_sigma,tail_std_err(the tail step’s sigma and the tail factor’s standard error) andtail_position(where the tail sits on the link axis, link 1 developing from the first age), all float64 and null without a tail,tail_positionalso whentail_sigmaandtail_std_errwere both given or the tail factor is exactly 1. tweedie_glm() and ml_development() add the columns their docstrings list. cells: pyarrow.Table or None-
One row per cell of the full rectangle, observed or not, from a method that fits a model to the cells (tweedie_glm(), ml_development());
Nonefor the others. Its columns are listed in each of those functions. coefficients: pyarrow.Table or None-
One row per term of a fitted model (tweedie_glm());
Nonefor the others.
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
to_polars(table="origins")table is "origins" (the default), "development", "link_ratios", "totals", "cells" or "coefficients"; a table the result does not carry is refused. Needs polars, which the polars extra installs: pip install "ibnr[polars]".