Skip to main content

reserving.ExpectedLoss

The expected loss ratio method: each origin’s ultimate is apriori

Usage

Source

reserving.ExpectedLoss()

times its exposure, whatever has been observed. The chain ladder is still fitted for the development pattern the fit reports.

The exposure is a measure column of the same triangle (premium, say): each origin’s latest observed cumulative value in the segment fitted.

Parameters

apriori: (float, sequence or dict) = 1.0

Expected loss ratio: the ultimate per unit of exposure, positive: one for every origin, one per origin in origin order (oldest first, over the triangle’s origins or, for a latest diagonal, its origins), or a dict from origin (its label as fits report it, "2021" or "2021Q3", or an integer year) to its loss ratio. Every origin fitted needs one; a value for an origin the triangle does not have is an error. Over segments each segment takes its own origins’ values. A pandas Series is read by its index, as a dict, so df.set_index("origin")["elr"] works in any row order; one with a default RangeIndex is an error, since its order cannot be checked. A Polars Series or numpy array is a sequence. On a latest diagonal a sequence needs the rows oldest first, each origin once, and is otherwise an error, since the exposure is read by row.

average: (volume, simple, regression, geometric) = "volume"

How link ratios are averaged, as in ChainLadder.

sigma_interpolation: (log - linear, mack) = "log-linear"
n_periods: optional

As ChainLadder: average only the latest diagonals and leave out the highest and lowest link ratios at each age.

drop_high: optional

As ChainLadder: average only the latest diagonals and leave out the highest and lowest link ratios at each age.

drop_low: optional

As ChainLadder: average only the latest diagonals and leave out the highest and lowest link ratios at each age.

tail: (float, TailConstant, TailCurve, TailBondy or TailLogLinear)

As ChainLadder; no tail by default.

ldf: optional

A selected development pattern, as in ChainLadder: the development pattern’s factors at the ages it gives, so cdf and the share developed 1 / cdf follow it.

ldf_kind: optional

A selected development pattern, as in ChainLadder: the development pattern’s factors at the ages it gives, so cdf and the share developed 1 / cdf follow it.

ldf_weight: optional

A selected development pattern, as in ChainLadder: the development pattern’s factors at the ages it gives, so cdf and the share developed 1 / cdf follow it.

ldf_origin: optional

A selected development pattern, as in ChainLadder: the development pattern’s factors at the ages it gives, so cdf and the share developed 1 / cdf follow it.

ldf_underwriting: optional
A selected development pattern, as in ChainLadder: the development pattern’s factors at the ages it gives, so cdf and the share developed 1 / cdf follow it.

Examples

>>> from prospicio.reserving import ExpectedLoss, Triangle
>>> tri = Triangle.from_long(
...     [2020, 2020, 2021], [12, 24, 12],
...     {"paid": [100.0, 150.0, 200.0], "premium": [250.0, 250.0, 400.0]},
... )
>>> fit = ExpectedLoss(apriori=0.5).fit(tri, "paid", "premium")
>>> fit.ultimate, fit.reserve

([125.0, 200.0], [-25.0, 0.0])

Attributes

Name Description
apriori Expected loss ratio: a float, a list in origin order or a dict by origin
average How link ratios are averaged.
drop_high Highest link ratios left out at each age.
drop_low Lowest link ratios left out at each age.
ldf The selected pattern by age, as given; None without one.
ldf_kind How ldf is expressed: "ldf", "cdf" or
ldf_origin The origin grain ldf was measured on, averaged over the fitted
ldf_underwriting The underwriting basis ldf is converted to at fit time
ldf_weight The weight on the selected factors: a number, a dict by age, or
n_periods Number of latest diagonals averaged; None uses every link ratio.
sigma_interpolation How unestimable variance parameters are filled in.
tail The tail: a constant factor as a number, otherwise its estimator.

apriori

Expected loss ratio: a float, a list in origin order or a dict by origin

apriori: Any

label, as given.


average

How link ratios are averaged.

average: str


drop_high

Highest link ratios left out at each age.

drop_high: int


drop_low

Lowest link ratios left out at each age.

drop_low: int


ldf

The selected pattern by age, as given; None without one.

ldf: dict | None


ldf_kind

How ldf is expressed: "ldf", "cdf" or

ldf_kind: str | None

"percent_developed"; None without a pattern.


ldf_origin

The origin grain ldf was measured on, averaged over the fitted

ldf_origin: str | None

origins’ periods at fit time; None reads it at the origin’s age.


ldf_underwriting

The underwriting basis ldf is converted to at fit time

ldf_underwriting: UnderwritingBasis | None

(UnderwritingBasis), or None.


ldf_weight

The weight on the selected factors: a number, a dict by age, or

ldf_weight: Any | None

None without a pattern.


n_periods

Number of latest diagonals averaged; None uses every link ratio.

n_periods: int | None


sigma_interpolation

How unestimable variance parameters are filled in.

sigma_interpolation: str


tail

The tail: a constant factor as a number, otherwise its estimator.

tail: Any

Methods

Name Description
fit() Fits one loss column in every segment of a triangle, each with its
fit_diagonal() ExpectedLoss on a latest diagonal with its exposure, in every

fit()

Fits one loss column in every segment of a triangle, each with its

Usage

Source

fit(triangle, column, exposure)

own exposure.

Parameters
triangle: Triangle
column: str

The losses to project.

exposure: str
The exposure column; each origin’s latest observed cumulative value is its exposure (an incremental triangle’s is cumulated).
Returns
ExpectedLossFit
Raises
ValueError
As ChainLadder.fit, if apriori is not positive, or if an origin has no observed, finite, positive exposure (the message names it and, with keys, its segment).

fit_diagonal()

ExpectedLoss on a latest diagonal with its exposure, in every

Usage

Source

fit_diagonal(diagonal, development=None, segment_map=None)

segment, as ChainLadder.fit_diagonal projects one.

Parameters
diagonal: LatestDiagonal

With an exposure per origin.

development: ChainLadderFit = None

As ChainLadder.fit_diagonal; this method keeps its own apriori.

segment_map: dict = None
As ChainLadder.fit_diagonal.
Returns
ExpectedLossFit