reserving.ClarkFit
A fitted Clark LDF or Cape Cod model of every segment of a triangle
Usage
reserving.ClarkFit()column.
Per-origin lists (origins, latest, expected_ultimate, ultimate, reserve and the standard errors) run over the origins of each segment in turn, like the rows of to_frame(). The fitted parameters and the standard errors of the total need a single-segment fit; for several segments use totals_frame() or segment(...). total_ultimate and total_reserve sum over every segment.
Examples
>>> from prospicio.reserving import ClarkLdf, Triangle
>>> rows = [[110.0, 290.0, 370.0, 420.0, 440.0], [95.0, 300.0, 390.0, 425.0],
... [130.0, 320.0, 410.0], [105.0, 305.0], [120.0]]
>>> tri = Triangle.from_long(
... [2020 + i for i, row in enumerate(rows) for _ in row],
... [12 * (d + 1) for row in rows for d in range(len(row))],
... [v for row in rows for v in row],
... )
>>> fit = ClarkLdf().fit(tri, "values")
>>> len(fit.covariance), fit.elr, fit.growth(float("inf"))(7, None, 1.0)
Attributes
| Name | Description |
|---|---|
| chain_ladder | The volume-weighted chain ladder of the same column, with the chain |
| covariance | Covariance of the parameters: the expected ultimates (LDF) or the |
| curve | The growth curve. |
| elr |
Expected loss ratio (Cape Cod), or None (LDF).
|
| expected_ultimate | Expected ultimate per origin, developed to infinity: fitted (LDF) |
| exposure |
Exposure per origin (Cape Cod), or None (LDF).
|
| 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. |
| max_age |
Age in months at which development stops; None for infinity.
|
| n_observations | Number of observed incremental values fitted; scale divides by |
| omega | Fitted shape of the growth curve. |
| origin_width | Length of the origin period in months; ages are shifted by half of |
| origins | Origin period of each per-origin value. |
| parameter_risk | Parameter standard error per origin. |
| process_risk | Process standard error per origin. |
| reserve | Reserve per origin. |
| scale |
Over-dispersion sigma**2: squared Pearson residuals over the
|
| standard_error |
Standard error per origin: sqrt(process**2 + parameter**2).
|
| theta | Fitted scale of the growth curve, in months. |
| total_parameter_risk | Parameter standard error of the total reserve, with the covariance |
| total_process_risk | Process standard error of the total reserve. |
| total_reserve | Total reserve across segments and origins. |
| total_standard_error | Standard error of the total reserve. |
| total_ultimate | Total ultimate across segments and origins. |
| ultimate | Ultimate per origin: the latest value plus the reserve. |
chain_ladder
The volume-weighted chain ladder of the same column, with the chain
chain_ladder: ChainLadderFit
ladder’s ultimate.
covariance
Covariance of the parameters: the expected ultimates (LDF) or the
covariance: list[list[float]]
curve
The growth curve.
curve: str
elr
Expected loss ratio (Cape Cod), or None (LDF).
elr: float | None
expected_ultimate
Expected ultimate per origin, developed to infinity: fitted (LDF)
expected_ultimate: list[float]
or elr * exposure (Cape Cod).
exposure
Exposure per origin (Cape Cod), or None (LDF).
exposure: list[float] | None
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]
max_age
Age in months at which development stops; None for infinity.
max_age: float | None
n_observations
Number of observed incremental values fitted; scale divides by
n_observations: int
this less the number of parameters.
omega
Fitted shape of the growth curve.
omega: float
origin_width
Length of the origin period in months; ages are shifted by half of
origin_width: float
it to the average date of loss.
origins
Origin period of each per-origin value.
origins: list[str]
parameter_risk
Parameter standard error per origin.
parameter_risk: list[float]
process_risk
Process standard error per origin.
process_risk: list[float]
reserve
Reserve per origin.
reserve: list[float]
scale
Over-dispersion sigma**2: squared Pearson residuals over the
scale: float
observed incremental values less the number of parameters.
standard_error
Standard error per origin: sqrt(process**2 + parameter**2).
standard_error: list[float]
theta
Fitted scale of the growth curve, in months.
theta: float
total_parameter_risk
Parameter standard error of the total reserve, with the covariance
total_parameter_risk: float
between origins.
total_process_risk
Process standard error of the total reserve.
total_process_risk: float
total_reserve
Total reserve across segments and origins.
total_reserve: float
total_standard_error
Standard error of the total reserve.
total_standard_error: float
total_ultimate
Total ultimate across segments and origins.
total_ultimate: float
ultimate
Ultimate per origin: the latest value plus the reserve.
ultimate: list[float]
Methods
| Name | Description |
|---|---|
| growth() | Share of the expected ultimate developed by a development age. |
| 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, the segment’s total |
growth()
Share of the expected ultimate developed by a development age.
Usage
growth(age)Parameters
age: float-
Development age in months, before the shift to the average date of loss;
infgives 1.
Returns
float
segment()
The fit of one segment, chosen by key values as
Usage
segment(**keys)Returns
ClarkFit
to_frame()
One row per segment and origin: the key columns, origin,
Usage
to_frame()latest, ultimate, reserve, (Cape Cod) exposure, expected_ultimate, process_risk, parameter_risk and standard_error. Needs pandas.
Returns
pandas.DataFrame
totals_frame()
One row per segment: the key columns, the segment’s total
Usage
totals_frame()latest, ultimate and reserve, the process_risk, parameter_risk and standard_error of its total reserve, and its omega, theta, scale and (Cape Cod) elr. Needs pandas.
Returns
pandas.DataFrame