reserving.CapeCodFit
A fitted Cape Cod of every segment of a triangle column: the fields of
Usage
reserving.CapeCodFit()ExpectedLossFit, with apriori the detrended loss ratio applied to each origin (chainladder-python’s detrended_apriori_), plus trended_apriori before detrending (its apriori_).
Per-origin lists run over the origins of each segment in turn, like the rows of to_frame().
Examples
>>> from prospicio.reserving import CapeCod, 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 = CapeCod(trend=0.1).fit(tri, "paid", "premium")
>>> round(fit.trended_apriori[0] / fit.apriori[0], 10)1.1
Attributes
| Name | Description |
|---|---|
| apriori | Detrended expected loss ratio applied per origin. |
| cdf | Age-to-ultimate factors, one per age, including the tail. |
| chain_ladder | The underlying chain-ladder projection, with the chain ladder’s |
| development | Development ages in months. |
| expected_loss | The expected-loss fit: ultimates, exposures and the detrended |
| exposure | Exposure per origin: the exposure column’s latest observed cumulative |
| index | Label of each segment, as Triangle.index. |
| keys | Names of the triangle’s key columns; empty without keys. |
| latest | Latest observed cumulative value per origin. |
| ldf |
Age-to-age factors; factor k links age k to k + 1.
|
| origins | Origin period of each per-origin value. |
| reserve | Reserve (ultimate minus latest) per origin. |
| total_reserve | Total reserve across segments and origins. |
| total_ultimate | Total ultimate across segments and origins. |
| trended_apriori | Expected loss ratio per origin at the valuation’s cost level, before |
| ultimate | Cape Cod ultimate per origin. |
apriori
Detrended expected loss ratio applied per origin.
apriori: list[float]
cdf
Age-to-ultimate factors, one per age, including the tail.
cdf: list[float]
chain_ladder
The underlying chain-ladder projection, with the chain ladder’s
chain_ladder: ChainLadderFit
ultimate.
development
Development ages in months.
development: list[int]
expected_loss
The expected-loss fit: ultimates, exposures and the detrended
expected_loss: ExpectedLossFit
apriori.
exposure
Exposure per origin: the exposure column’s latest observed cumulative
exposure: list[float]
value.
index
Label of each segment, as Triangle.index.
index: list[Any]
keys
Names of the triangle’s key columns; empty without keys.
keys: list[str]
latest
Latest observed cumulative value per origin.
latest: list[float]
ldf
Age-to-age factors; factor k links age k to k + 1.
ldf: list[float]
origins
Origin period of each per-origin value.
origins: list[str]
reserve
Reserve (ultimate minus latest) per origin.
reserve: list[float]
total_reserve
Total reserve across segments and origins.
total_reserve: float
total_ultimate
Total ultimate across segments and origins.
total_ultimate: float
trended_apriori
Expected loss ratio per origin at the valuation’s cost level, before
trended_apriori: list[float]
detrending.
ultimate
Cape Cod ultimate per origin.
ultimate: list[float]
Methods
| Name | Description |
|---|---|
| development_frame() | One row per segment and age, as ChainLadderFit.development_frame. |
| segment() | The fit of one segment, chosen by key values as |
| to_frame() |
One row per segment and origin: the key columns, origin,
|
| totals_frame() | One row per segment: the key columns and the segment’s total |
development_frame()
One row per segment and age, as ChainLadderFit.development_frame.
Usage
development_frame()Needs pandas.
Returns
pandas.DataFrame
segment()
The fit of one segment, chosen by key values as
Usage
segment(**keys)Returns
CapeCodFit
to_frame()
One row per segment and origin: the key columns, origin,
Usage
to_frame()Returns
pandas.DataFrame
totals_frame()
One row per segment: the key columns and the segment’s total
Usage
totals_frame()Returns
pandas.DataFrame