pricing.CasualtyProfile
A book of casualty policies, each rated on its own curve
Usage
pricing.CasualtyProfile()(docs/design/casualty-exposure.md).
Policy i pays share * min((X - attachment)+, limit) for a ground-up loss X per occurrence. A per-policy treaty limit xs attachment cedes the part above its retention, and the share of the policy’s expected loss it takes is its exposure factor.
Parameters
curves: listlimit: list of float-
One per policy: the policy limit above its attachment (
inffor none, as in workers compensation), on-level premium and expected loss ratio. premium: list of float-
One per policy: the policy limit above its attachment (
inffor none, as in workers compensation), on-level premium and expected loss ratio. elr: list of float-
One per policy: the policy limit above its attachment (
inffor none, as in workers compensation), on-level premium and expected loss ratio. attachment: list of float-
Underlying attachment (0) and share of the layer written (1).
share: list of float-
Underlying attachment (0) and share of the layer written (1).
curve: list of int-
Each policy’s index into
curves(0). tag: list of str or None- A segment or line, for reporting and for leaving a segment out.
Examples
Clark’s workers compensation example, 750,000 xs 250,000:
>>> from prospicio.pricing import CasualtyProfile, ElfTable
>>> book = CasualtyProfile(
... [ElfTable([250e3, 1e6], [0.030, 0.006])], limit=[float("inf")],
... premium=[100e3], elr=[0.70])
>>> round(book.rate(750e3, 250e3, alae="in_severity").ceded, 6)1680.0
Methods
| Name | Description |
|---|---|
| count_test() | Expected against observed claims at each size, with the Poisson |
| expected_claims() | The expected number of claims a year recorded at or above the |
| exposure_factors() | Each policy’s exposure factor for the treaty limit xs |
| occurrences_above() | Each policy’s expected ground-up occurrences above t a year, |
| rate() |
The ILF form: each policy’s premium * elr times its exposure
|
| rate_by_frequency() | The frequency form: each policy’s expected number of ground-up |
| sweep() | The frequency form at each alpha of a Pareto from threshold, |
count_test()
Expected against observed claims at each size, with the Poisson
Usage
count_test(sizes, *, threshold, counts, excess, exposure_years, observed)probability of a count at least as extreme in the direction observed.
Parameters
sizes: list of float-
Ground-up sizes, at or above threshold.
threshold: float-
As in rate_by_frequency.
counts: float-
As in rate_by_frequency.
excess: float-
As in rate_by_frequency.
exposure_years: float-
The experience period in the profile’s years: each year’s on-level premium over the profile’s, summed.
observed: list of float- The trended ground-up losses (PreparedLosses.trended), a claim closed at its limit at the limit.
Returns
dict-
Columns
size, expected,observedandp_value.
expected_claims()
The expected number of claims a year recorded at or above the
Usage
expected_claims(t, threshold, counts, excess)ground-up size t: a policy records an occurrence once it passes its attachment and caps it at a + l, so it adds counts[i] * S(max(t, a)) when t <= a + l, S the survival of excess.
exposure_factors()
Each policy’s exposure factor for the treaty limit xs
Usage
exposure_factors(limit, attachment, *, alae, loading=None)Parameters
limit: floatattachment: floatalae: (pro_rata, on_top, in_severity) = "pro_rata"-
pro_rata: ALAE in proportion to loss, the ceded loss times1 + loadingon a loss-only ELR.on_top: the policy limit caps loss only and ALAE isloadingtimes it; the treaty’s retention and limit apply to loss and ALAE (Clark’s second formula).in_severity: the curves are of loss and ALAE. loading: float = None-
Required with
pro_rataandon_top, refused otherwise.
occurrences_above()
Each policy’s expected ground-up occurrences above t a year,
Usage
occurrences_above(t)from its own curve: premium * elr / (share * [LEV(a + l) - LEV(a)]) * S(t), a table’s S its slope just above t.
Returns
list of float
rate()
The ILF form: each policy’s premium * elr times its exposure
Usage
rate(limit, attachment, *, alae, loading=None)factor, with the ALAE loading. Arguments as exposure_factors.
Returns
CasualtyRating
rate_by_frequency()
The frequency form: each policy’s expected number of ground-up
Usage
rate_by_frequency(
limit, attachment, *, alae, threshold, counts, excess, loading=None
)occurrences above threshold (counts) times the expected ceded amount given X > threshold under excess, a severity of the losses above it (a Pareto from it, say). Fails when an exposed policy’s cession starts below the threshold.
Returns
CasualtyRating
sweep()
The frequency form at each alpha of a Pareto from threshold,
Usage
sweep(limit, attachment, *, alae, threshold, counts, alphas, loading=None)the counts held fixed. The central alpha and its source are yours to state beside the result; prospicio ships no benchmark.
Returns
Examples
>>> from prospicio.distributions import Pareto
>>> from prospicio.pricing import CasualtyProfile
>>> book = CasualtyProfile([Pareto(1e6, 1.5)], limit=[10e6], premium=[1e6], elr=[0.6])
>>> s = book.sweep(5e6, 5e6, alae="in_severity", threshold=1e6, counts=[1.0],
... alphas=[1.0, 2.0])
>>> round(s["ceded"][0] / s["ceded"][1], 2)6.93