Skip to main content

reinsurance.Layer

A per-occurrence excess-of-loss layer: limit xs attachment on each

Usage

Source

reinsurance.Layer()

loss, then annual terms.

For one year, ceded = share * min(max(sum of per-loss recoveries - aggregate_deductible, 0), aggregate_limit), less any loss corridor (with_loss_corridor) before the annual limit.

Parameters

name: str
limit: float

Per-occurrence limit; may be inf.

attachment: float
share: float = 1.0

Placed share, in (0, 1].

aggregate_deductible: float = 0.0
aggregate_limit: float = inf
reinstatements: int

Free reinstatements: sets aggregate_limit to limit * (reinstatements + 1); cannot be combined with aggregate_limit.

premium: float = 0.0

Upfront premium for the placed share: the base of paid reinstatements, ceding and profit commissions and a sliding scale’s loss ratio. with_rate_on_line, with_premium_rate and with_deposit_premium set it from a quote.

reinstatement_rates: list of float

Paid reinstatements, one rate per reinstatement as a fraction of premium (1.0 is 100%), pro rata as to amount. Sets aggregate_limit to limit * (len(reinstatement_rates) + 1); cannot be combined with aggregate_limit or reinstatements.

pro_rata_time: bool = False

Paid reinstatements also pro rata as to time: the limit a loss at time t (the fraction of the year elapsed) uses up is charged at 1 - t. Needs reinstatement_rates, and events with times (EventSet.with_uniform_times, or times= in EventSet.from_years).

allocation: (event_order, pro_rata) = "event_order"
How the annual terms (aggregate deductible and limit, reinstatements) split the year’s recovery among its events. "event_order" uses the aggregate limit up in the order the events occur, so a later event gets what is left. "pro_rata" scales every event’s recovery by the same factor, the annual recovery after the terms over the one before them. The annual total is the same; the split by event, and so what an inuring stage sees, differs. Cannot be combined with pro_rata_time.

Raises

ValueError
If a term is out of range, or more than one of aggregate_limit, reinstatements and reinstatement_rates is given.

Examples

>>> from prospicio.reinsurance import Layer
>>> layer = Layer("5x5", 5e6, 5e6, reinstatements=1)
>>> layer.ceded([7e6])

2000000.0

>>> layer.ceded([12e6, 20e6, 30e6])

10000000.0

>>> paid = Layer("10x10", 10.0, 10.0, premium=2.0, reinstatement_rates=[1.0, 0.5])
>>> paid.reinstatement_premium([22.0, 12.0])

2.2

>>> timed = Layer("10x10", 10.0, 10.0, premium=2.0, reinstatement_rates=[1.0, 0.5],
...               pro_rata_time=True)
>>> round(timed.reinstatement_premium([22.0, 12.0], times=[0.25, 0.5]), 12)

1.6

>>> Layer("10x5", 10.0, 5.0, reinstatements=1).ceded_by_event([15.0, 20.0, 10.0])

[10.0, 10.0, 0.0]

>>> Layer("10x5", 10.0, 5.0, reinstatements=1, allocation="pro_rata").ceded_by_event([15.0, 20.0, 10.0])

[8.0, 8.0, 4.0]

Attributes

Name Description
aggregate_deductible Annual aggregate deductible.
aggregate_limit Annual aggregate limit.
allocation How the annual terms split the year’s recovery among its events:
attachment Per-occurrence attachment.
brokerage The flat brokerage rate, or None (also when it is on a scale).
brokerage_scale The brokerage scale’s (rate, loss_ratio) anchors in increasing
brokerage_within_commission_range Whether the brokerage scale is held inside the commission’s range.
ceding_commission The flat ceding commission rate, or None (also when the
deductions The deductions as (label, basis, value, inside_nmbf).
disappearing The end of a disappearing deductible (with_disappearing), or
drop_down A top-and-drop cover as (underlying, attachment), or None.
franchise Whether the layer has a franchise deductible (with_franchise).
limit Per-occurrence limit.
loss_corridor The loss corridor as (lower, upper, retained), or None.
name Layer name.
needs_sums_insured Whether the layer is a surplus treaty, which needs sums insured.
no_claims_bonus The no-claims bonus as (share, years, threshold), or None.
nth_event An nth-event cover as (n, threshold), or None.
premium Upfront premium for the placed share.
pro_rata_time Whether paid reinstatements are pro rata as to time.
profit_commission The profit commission as (share, allowance), or None.
profit_commission_carry The profit commission’s carry-forward as {"years": n} (n is
reinstatement_rates Rate of each paid reinstatement; empty when reinstatements are free.
scales_before_annual_terms Whether the sliding scales read the loss ratio before annual terms.
scope The losses the layer covers, (label, values), or None for
sees_aggregate_part Whether the layer cedes from an EventSet’s aggregate part: it is
share Placed share.
sliding_scale The sliding scale’s (commission, loss_ratio) anchors in
sliding_scale_carry The sliding scale’s carry-forward as {"deficit", "credit",</td> </tr> <tr> <td><a href="#swing_rating" class="doc-attribute doc-label doc-label-property">swing_rating</a></td> <td>The swing rating at 100% as(basic, lcm, minimum, maximum)``, or

aggregate_deductible

Annual aggregate deductible.

aggregate_deductible: float


aggregate_limit

Annual aggregate limit.

aggregate_limit: float


allocation

How the annual terms split the year’s recovery among its events:

allocation: str

"event_order" or "pro_rata".


attachment

Per-occurrence attachment.

attachment: float


brokerage

The flat brokerage rate, or None (also when it is on a scale).

brokerage: float | None


brokerage_scale

The brokerage scale’s (rate, loss_ratio) anchors in increasing

brokerage_scale: list[tuple[float, float]] | None

loss ratio, or None.


brokerage_within_commission_range

Whether the brokerage scale is held inside the commission’s range.

brokerage_within_commission_range: bool


ceding_commission

The flat ceding commission rate, or None (also when the

ceding_commission: float | None

commission slides).


deductions

The deductions as (label, basis, value, inside_nmbf).

deductions: list[tuple[str, str, float, bool]]


disappearing

The end of a disappearing deductible (with_disappearing), or

disappearing: float | None

None.



franchise

Whether the layer has a franchise deductible (with_franchise).

franchise: bool


limit

Per-occurrence limit.

limit: float


loss_corridor

The loss corridor as (lower, upper, retained), or None.

loss_corridor: tuple[float, float, float] | None


name

Layer name.

name: str


needs_sums_insured

Whether the layer is a surplus treaty, which needs sums insured.

needs_sums_insured: bool


no_claims_bonus

The no-claims bonus as (share, years, threshold), or None.

no_claims_bonus: tuple[float, int, float] | None


nth_event

An nth-event cover as (n, threshold), or None.

nth_event: tuple[int, float] | None


premium

Upfront premium for the placed share.

premium: float


pro_rata_time

Whether paid reinstatements are pro rata as to time.

pro_rata_time: bool


profit_commission

The profit commission as (share, allowance), or None.

profit_commission: tuple[float, float] | None


profit_commission_carry

The profit commission’s carry-forward as {"years": n} (n is

profit_commission_carry: dict | None

None without limit), or None.


reinstatement_rates

Rate of each paid reinstatement; empty when reinstatements are free.

reinstatement_rates: list[float]


scales_before_annual_terms

Whether the sliding scales read the loss ratio before annual terms.

scales_before_annual_terms: bool


scope

The losses the layer covers, (label, values), or None for

scope: tuple[str, list[str]] | None

every loss.


sees_aggregate_part

Whether the layer cedes from an EventSet’s aggregate part: it is

sees_aggregate_part: bool

on the loss with attachment 0 and no limit, as a quota share or a stop loss is. A layer with a per-occurrence attachment or limit sees the events alone.


share

Placed share.

share: float


sliding_scale

The sliding scale’s (commission, loss_ratio) anchors in

sliding_scale: list[tuple[float, float]] | None

increasing loss ratio, or None.


sliding_scale_carry

The sliding scale’s carry-forward as ``{“deficit”, “credit”,

sliding_scale_carry: dict | None

“years”}, orNone``.


swing_rating

The swing rating at 100% as (basic, lcm, minimum, maximum), or

swing_rating: tuple[float, float, float, float] | None

None.

Methods

Name Description
brokerage_for() The year’s brokerage given its ceded loss.
ceded() Ceded loss for one year’s losses.
ceded_by_event() Ceded loss per event for one year, taking losses as chronological.
ceded_with_sums_insured() Ceded loss for one year’s losses on risks with the given sums
ceding_commission_for() The year’s ceding commission (flat or sliding) given its ceded loss.
ceding_commissions_over() The ceding commissions over consecutive years of a term with these
deduction_for() The year’s amount of the deduction labelled label given its
no_claims_bonus_for() The year’s no-claims bonus given its ceded loss, on that year alone.
occurrence_moments() The first three raw moments of one occurrence’s recovery at 100%,
premium_for() The year’s premium given its ceded loss: the swing-rated premium,
profit_commission_for() The year’s profit commission given its ceded loss.
profit_commissions_over() The profit commissions over consecutive years of a term with these
quota_share() A quota share ceding cession of every loss.
reinstatement_premium() Reinstatement premium for one year’s losses.
stop_loss() An aggregate stop-loss: limit xs retention on the year’s total.
surplus() A surplus treaty: each risk cedes the part of its sum insured above
trial_statistics() How often the layer is attached and used up in simulated years.
with_brokerage() The same layer with a flat brokerage: rate of the year’s
with_brokerage_scale() The same layer with brokerage on a scale of the loss ratio.
with_brokerage_within_commission_range() The same layer with its brokerage scale reading the loss ratio held
with_ceding_commission() The same layer with a flat ceding commission: rate of the
with_deduction() The same layer with another deduction from its premium: a TPA fee,
with_deposit_premium() The same layer with its premium set from a deposit quoted for 100%
with_disappearing() The same layer with a disappearing deductible, aggregate’s
with_franchise() The same layer with a franchise deductible: an occurrence at or
with_loss_corridor() The same layer with a loss corridor.
with_no_claims_bonus() The same layer with a no-claims bonus: share of the year’s
with_nth_event() The same layer as an nth-event cover: only the n-th and later
with_premium_rate() The same layer with its premium set as a rate on the subject
with_profit_commission() The same layer with a profit commission: share of max(premium</td> </tr> <tr> <td><a href="#with_profit_commission_carry_forward" class="doc-function doc-label doc-label-method">with_profit_commission_carry_forward()</a></td> <td>The same layer, carrying the profit commission's deficits forward</td> </tr> <tr> <td><a href="#with_rate_on_line" class="doc-function doc-label doc-label-method">with_rate_on_line()</a></td> <td>The same layer with its premium set from a rate on line:</td> </tr> <tr> <td><a href="#with_scales_before_annual_terms" class="doc-function doc-label doc-label-method">with_scales_before_annual_terms()</a></td> <td>The same layer with its sliding scales (commission and brokerage)</td> </tr> <tr> <td><a href="#with_scope" class="doc-function doc-label doc-label-method">with_scope()</a></td> <td>The same layer covering only the losses whose labellabel</td> </tr> <tr> <td><a href="#with_sliding_scale" class="doc-function doc-label doc-label-method">with_sliding_scale()</a></td> <td>The same layer with a sliding-scale ceding commission.</td> </tr> <tr> <td><a href="#with_sliding_scale_carry_forward" class="doc-function doc-label doc-label-method">with_sliding_scale_carry_forward()</a></td> <td>The same layer, carrying the sliding scale's deficits (ceded loss</td> </tr> <tr> <td><a href="#with_swing_rating" class="doc-function doc-label doc-label-method">with_swing_rating()</a></td> <td>The same layer, swing rated: the year's premium isclip(share *
with_top_and_drop() The same layer as a top-and-drop cover: it sits at its own

brokerage_for()

The year’s brokerage given its ceded loss.

Usage

Source

brokerage_for(ceded)
Parameters
ceded: float
Returns
float

ceded()

Ceded loss for one year’s losses.

Usage

Source

ceded(losses)
Parameters
losses: list of float
Returns
float
Raises
ValueError
If a loss is negative or not finite, usually losses stored with the sign of money paid out (read_ylt(..., losses_negative=True) reads such a file).

ceded_by_event()

Ceded loss per event for one year, taking losses as chronological.

Usage

Source

ceded_by_event(losses)

The annual deductible absorbs the first recoveries and the annual limit stops the last ones; the entries sum to ceded(losses).

Parameters
losses: list of float
Returns
list of float
Examples
>>> from prospicio.reinsurance import Layer
>>> layer = Layer("L", 10.0, 5.0, aggregate_deductible=4.0, aggregate_limit=15.0)
>>> layer.ceded_by_event([8.0, 20.0, 12.0])

[0.0, 9.0, 6.0]


ceded_with_sums_insured()

Ceded loss for one year’s losses on risks with the given sums

Usage

Source

ceded_with_sums_insured(losses, sums_insured)

insured, one per loss.

Parameters
losses: list of float
sums_insured: list of float
Returns
float

ceding_commission_for()

The year’s ceding commission (flat or sliding) given its ceded loss.

Usage

Source

ceding_commission_for(ceded)
Parameters
ceded: float
Returns
float

ceding_commissions_over()

The ceding commissions over consecutive years of a term with these

Usage

Source

ceding_commissions_over(ceded)

ceded losses, carrying the sliding scale’s deficits and credits forward if the layer does.

Parameters
ceded: list of float
Returns
list of float

deduction_for()

The year’s amount of the deduction labelled label given its

Usage

Source

deduction_for(label, ceded)

ceded loss.

Parameters
label: str
ceded: float
Returns
float
Raises
ValueError
If the layer has no deduction labelled label.

no_claims_bonus_for()

The year’s no-claims bonus given its ceded loss, on that year alone.

Usage

Source

no_claims_bonus_for(ceded)
Parameters
ceded: float
Returns
float

occurrence_moments()

The first three raw moments of one occurrence’s recovery at 100%,

Usage

Source

occurrence_moments(severity)

before annual terms, for a ground-up loss with distribution severity, exact for an ordinary, franchise or disappearing deductible on the loss basis. Divide by 1 - severity.cdf(attachment) for the moments of a loss that reaches the layer, as aggregate reports a layered severity.

Parameters
severity: a severity distribution
Returns
list of float
[E[g], E[g**2], E[g**3]].
Examples
>>> from prospicio.distributions import Lognormal
>>> from prospicio.reinsurance import Layer
>>> x = Lognormal.from_mean_cv(100.0, 1.0)
>>> m = Layer("D", 300.0, 50.0).with_disappearing(100.0).occurrence_moments(x)
>>> round(m[0] / (1 - x.cdf(50.0)), 6)

112.607961


premium_for()

The year’s premium given its ceded loss: the swing-rated premium,

Usage

Source

premium_for(ceded)

or else the fixed premium.

Parameters
ceded: float
The layer’s ceded loss for the year, at the placed share.
Returns
float

profit_commission_for()

The year’s profit commission given its ceded loss.

Usage

Source

profit_commission_for(ceded)
Parameters
ceded: float
Returns
float

profit_commissions_over()

The profit commissions over consecutive years of a term with these

Usage

Source

profit_commissions_over(ceded)

ceded losses, carrying deficits forward if the layer does.

Parameters
ceded: list of float
The layer’s ceded loss in each year, at the placed share.
Returns
list of float

quota_share()

A quota share ceding cession of every loss.

Usage

Source

quota_share(name, cession)

Unlimited cover from the first unit with share = cession.

Parameters
name: str
cession: float
In (0, 1].
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> Layer.quota_share("QS", 0.4).ceded([10.0, 5.0])

6.0


reinstatement_premium()

Reinstatement premium for one year’s losses.

Usage

Source

reinstatement_premium(losses, times=None)

With layer loss L at 100% after annual terms, premium * sum(rate_k * min(max(L - k * limit, 0), limit) / limit); zero when reinstatements are free. Pro rata as to time, the limit each loss uses up is charged at 1 - t, its time’s share of the year left.

Parameters
losses: list of float

In time order.

times: list of float = None
Each loss’s time, as the fraction of the year elapsed; needed (and only used) when the layer is pro rata as to time.
Returns
float
NaN for a layer pro rata as to time without times.

stop_loss()

An aggregate stop-loss: limit xs retention on the year’s total.

Usage

Source

stop_loss(name, limit, retention)

Covers the total of the losses it sees: gross, or net of earlier stages in an inuring Tower.

Parameters
name: str
limit: float

Annual limit; may be inf.

retention: float
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> Layer.stop_loss("SL", 50.0, 100.0).ceded([60.0, 70.0])

30.0


surplus()

A surplus treaty: each risk cedes the part of its sum insured above

Usage

Source

surplus(name, retention, lines)

the retention line retention, up to lines lines, and the same share of every loss on it.

With a retention of 1m and 9 lines (a capacity of 9m), a 5m risk cedes 80% and a 20m risk 45%. The events must carry sums insured (EventSet.from_years(..., sums_insured=...)); it can inure to a per-risk excess of loss in a later stage of a Tower.

Parameters
name: str
retention: float

The retention line; positive.

lines: float
Number of lines of capacity; positive.
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> s = Layer.surplus("surplus", 1e6, 9.0)
>>> round(s.ceded_with_sums_insured([2e6, 2e6], [5e6, 20e6]))

2500000


trial_statistics()

How often the layer is attached and used up in simulated years.

Usage

Source

trial_statistics(events)

Counted on events’ years as the first stage of a tower sees them (the gross events, and the aggregate part for a layer without occurrence terms). p_attach is the share of years with an occurrence above the attachment, p_exhaust_occurrence with one at or above attachment plus limit, and p_exhaust_annual in which the annual limit (the aggregate limit, or the limit times one plus the reinstatements) is used up; each has its binomial standard error (*_se), to set beside an event loss table’s per-occurrence occurrence_layer_statistics. occurrences_mean (with occurrences_se) is the mean number of occurrences a year that reach the layer, ceded_mean the mean ceded loss and ceded_given_attach its mean over the attached years (NaN when none is).

Parameters
events: EventSet
Returns
dict of str to float
Examples
>>> from prospicio.aggregate import EventSet
>>> from prospicio.reinsurance import Layer
>>> layer = Layer("10x10", 10.0, 10.0, reinstatements=1)
>>> years = EventSet.from_years([[5.0], [12.0], [25.0], [25.0, 30.0]])
>>> s = layer.trial_statistics(years)
>>> s["p_attach"], s["p_exhaust_occurrence"], s["p_exhaust_annual"]

(0.75, 0.5, 0.25)


with_brokerage()

The same layer with a flat brokerage: rate of the year’s

Usage

Source

with_brokerage(rate)

premium. It replaces any brokerage set before.

Parameters
rate: float
In [0, 1].
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> qs = Layer.quota_share("QS", 0.5).with_premium_rate(1.0, 200.0).with_brokerage(0.025)
>>> round(qs.brokerage_for(70.0), 12)

2.5


with_brokerage_scale()

The same layer with brokerage on a scale of the loss ratio.

Usage

Source

with_brokerage_scale(anchors)

The rate is read from (rate, loss_ratio) anchors as a sliding scale is, linear between anchors and flat beyond the first and last, and may rise or fall with the loss ratio. It reads the ceded loss ratio, or the one before annual terms with with_scales_before_annual_terms, held inside a sliding-scale commission’s range with with_brokerage_within_commission_range. Set the premium first; it cannot be combined with swing rating or paid reinstatements.

Parameters
anchors: list of (float, float)
(rate, loss_ratio) pairs.
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> qs = (Layer.quota_share("QS", 0.5).with_premium_rate(1.0, 200.0)
...       .with_brokerage_scale([(0.03, 0.5), (0.01, 0.8)]))
>>> round(qs.brokerage_for(65.0), 12)

2.0


with_brokerage_within_commission_range()

The same layer with its brokerage scale reading the loss ratio held

Usage

Source

with_brokerage_within_commission_range()

inside the sliding-scale commission’s range, from its first anchor to its last.

Returns
Layer

with_ceding_commission()

The same layer with a flat ceding commission: rate of the

Usage

Source

with_ceding_commission(rate)

year’s premium (the swing-rated premium, if any) is paid back to the cedant. Reinstatement premiums carry none.

Parameters
rate: float
In [0, 1].
Returns
Layer

with_deduction()

The same layer with another deduction from its premium: a TPA fee,

Usage

Source

with_deduction(label, value, basis="premium", inside_nmbf=True)

tax, reinsurance cost, a fronting fee or a manager’s fee.

Each deduction is its own (label, layer) component in a tower’s results and its own ratio in Tower.deal_ratios.

Parameters
label: str

Its name, distinct from the layer’s other deductions and from the kinds a tower’s result and the deal ratios use.

value: float

The rate, or the amount for basis="fixed"; non-negative.

basis: (premium, loss, fixed) = "premium"

A rate of the year’s premium, of its ceded loss, or an amount.

inside_nmbf: bool = True
Whether the nominal margin before fees counts it; False for a fee kept outside it, such as a manager’s fee.
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> qs = (Layer.quota_share("QS", 0.5).with_premium_rate(1.0, 200.0)
...       .with_deduction("tax", 0.03)
...       .with_deduction("tpa", 0.02, basis="loss"))
>>> [round(qs.deduction_for(k, 70.0), 12) for k in ["tax", "tpa"]]

[3.0, 1.4]


with_deposit_premium()

The same layer with its premium set from a deposit quoted for 100%

Usage

Source

with_deposit_premium(amount)

of the layer: premium = share * amount.

Parameters
amount: float
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> Layer("5x5", 5e6, 5e6, share=0.4).with_deposit_premium(1e6).premium

400000.0


with_disappearing()

The same layer with a disappearing deductible, aggregate’s

Usage

Source

with_disappearing(end)

y xs d1 to d2 disappearing: the retention falls linearly from the attachment d1 to 0 as the loss rises from d1 to end, so a loss pays nothing up to d1, k (x - d1) with k = end / (end - d1) up to end and the whole loss above, each capped at the limit. On the loss basis only; not with a franchise or a top-and-drop cover.

Parameters
end: float
Above the attachment.
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> Layer("D", 300.0, 50.0).with_disappearing(100.0).ceded_by_event([40.0, 75.0, 250.0, 400.0])

[0.0, 50.0, 250.0, 300.0]


with_franchise()

The same layer with a franchise deductible: an occurrence at or

Usage

Source

with_franchise()

above the attachment is paid from the ground up, min(x, limit), and one below it pays nothing. On the loss basis only.

Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> Layer("F", 20.0, 5.0).with_franchise().ceded_by_event([4.0, 5.0, 12.0, 30.0])

[0.0, 5.0, 12.0, 20.0]


with_loss_corridor()

The same layer with a loss corridor.

Usage

Source

with_loss_corridor(lower, upper, retained=1.0)

Of the annual layer loss at 100% after the annual deductible, the cedant keeps retained of the part between lower and upper; the annual limit then caps what is left, so the reinsurer still pays up to the full annual limit. Reinstatement premiums follow the loss after the corridor. A corridor quoted as loss ratios lr on the reinsurer’s premium P for a placed share s is lr * P / s (for a quota share, P / s is the subject premium).

Parameters
lower: float

Non-negative.

upper: float

Finite, above lower.

retained: float = 1.0
Share of the band the cedant keeps, in (0, 1].
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> qs = Layer.quota_share("QS", 0.3).with_loss_corridor(70.0, 90.0)
>>> round(qs.ceded([50.0, 30.0]), 12), round(qs.ceded([120.0]), 12)

(21.0, 30.0)


with_no_claims_bonus()

The same layer with a no-claims bonus: share of the year’s

Usage

Source

with_no_claims_bonus(share, years=1, threshold=0.0)

premium returned when the layer’s ceded loss over the last years contract years is at most threshold.

The bonus is figured on its own, beside any sliding scale or profit commission, on the year’s premium as the layer prices it (the deposit or a swing-rated premium), without reinstatement premium. years > 1 looks back over the earlier years of a term and needs Tower.apply_term; a single year, a grid or a ledger refuses it. Set the premium first.

Parameters
share: float

In (0, 1].

years: int = 1

The years looked at, this one included.

threshold: float = 0.0
The most ceded loss over those years that still earns the bonus; 0 is a claims-free year.
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> cat = (Layer("20x10", 20.0, 10.0).with_premium_rate(0.1, 20.0)
...        .with_no_claims_bonus(0.15))
>>> round(cat.no_claims_bonus_for(0.0), 12), cat.no_claims_bonus_for(5.0)

(0.3, 0.0)


with_nth_event()

The same layer as an nth-event cover: only the n-th and later

Usage

Source

with_nth_event(n, threshold)

events of a year whose loss to the layer exceeds threshold are covered; earlier ones, and events at or below the threshold, cede nothing. Events count in the order given, chronological when the event set has times. with_nth_event(1, attachment) is the plain layer. The grids and annual losses have no events in order and refuse it.

Parameters
n: int

The first event covered, at least 1.

threshold: float
The loss an event must exceed to count.
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> Layer("2nd", 10.0, 5.0).with_nth_event(2, 5.0).ceded_by_event([12.0, 3.0, 9.0, 20.0])

[0.0, 0.0, 4.0, 10.0]


with_premium_rate()

The same layer with its premium set as a rate on the subject

Usage

Source

with_premium_rate(rate, subject_premium)

premium: premium = share * rate * subject_premium. A quota share’s ceded premium is with_premium_rate(1.0, subject_premium).

Parameters
rate: float
subject_premium: float
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> Layer.quota_share("QS", 0.3).with_premium_rate(1.0, 1000.0).premium

300.0


with_profit_commission()

The same layer with a profit commission: share of ``max(premium

Usage

Source

with_profit_commission(share, allowance=0.0)
  • (1 - allowance) - ceded, 0), asaggregate'spc after ``.

The allowance is the reinsurer’s expenses and margin as a fraction of premium, including any ceding commission the contract deducts before profit. Set the premium first; it cannot be combined with swing rating or paid reinstatements.

Parameters
share: float

In [0, 1].

allowance: float = 0.0
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> qs = (Layer.quota_share("QS", 0.5).with_premium_rate(1.0, 200.0)
...       .with_profit_commission(0.25, 0.1))
>>> round(qs.profit_commission_for(60.0), 12)

7.5


with_profit_commission_carry_forward()

The same layer, carrying the profit commission’s deficits forward

Usage

Source

with_profit_commission_carry_forward(years=None)

between the years of a term (Tower.apply_term).

A year whose ceded loss exceeds premium * (1 - allowance) pays no commission and carries the excess, which later years’ profits cover before any commission is paid. Deficits are used up oldest first. Set the profit commission first. A single year (Tower.apply) starts with nothing carried.

Parameters
years: int = None
How many later years a deficit may be carried into; None (the default) carries it until it is used up.
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> qs = (Layer.quota_share("QS", 0.5).with_premium_rate(1.0, 200.0)
...       .with_profit_commission(0.25, 0.1)
...       .with_profit_commission_carry_forward())
>>> qs.profit_commissions_over([120.0, 40.0])

[0.0, 5.0]


with_rate_on_line()

The same layer with its premium set from a rate on line:

Usage

Source

with_rate_on_line(rol)

premium = share * rol * limit. Needs a finite limit.

Parameters
rol: float
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> Layer("10x10", 10e6, 10e6).with_rate_on_line(0.125).premium

1250000.0


with_scales_before_annual_terms()

The same layer with its sliding scales (commission and brokerage)

Usage

Source

with_scales_before_annual_terms()

read on the loss ratio before the annual terms.

That is the placed share of the year’s recoveries before the annual deductible, the corridor and the annual limit, over the premium: a loss-ratio cap stated as aggregate_limit then caps the ceded loss but not what the scales read. A tower’s result then has each year’s ("loss_before_terms", <layer>). The grid methods and the P&L ledger refuse such a layer with annual terms and a sliding scale.

Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer, Tower
>>> cover = (Layer("cover", 1000.0, 0.0, aggregate_limit=120.0)
...          .with_premium_rate(1.0, 100.0)
...          .with_sliding_scale([(0.3, 0.5), (0.1, 1.5)])
...          .with_scales_before_annual_terms())
>>> res = Tower([cover]).apply_annual([140.0])
>>> [res.marginal([k, "cover"]).draws[0] for k in ["ceded", "loss_before_terms"]]

[120.0, 140.0]

>>> round(res.marginal(["ceding_commission", "cover"]).draws[0], 12)

12.0


with_scope()

The same layer covering only the losses whose label label

Usage

Source

with_scope(label, values)

takes one of values: a windstorm treaty on a multi-peril event set is scoped to ("peril", ["windstorm"]).

The layer’s occurrence and annual terms see only those losses, so another peril’s events neither use its annual limit nor count toward its deductible; the losses it does not cover pass to the next inuring stage whole. That differs from reading one label’s share of an unscoped layer, whose annual terms every peril uses up. A tower with a scoped layer needs labelled events (Tower.apply, apply_term, apply_timeline) and refuses the grids and annual losses.

Parameters
label: str

A label dimension of the events.

values: list of str
At least one; at least one must occur.
Returns
Layer
Examples
>>> from prospicio.aggregate import EventSet
>>> from prospicio.reinsurance import Layer, Tower
>>> e = EventSet.from_years([[20.0, 15.0]]).with_labels({"peril": ["quake", "wind"]})
>>> xl = Layer("10x5", 10.0, 5.0, aggregate_limit=15.0)
>>> wind = Tower([xl.with_scope("peril", ["wind"])]).apply(e)
>>> wind.marginal(("ceded", "10x5", "wind")).mean()

10.0

>>> Tower([xl]).apply(e).marginal(("ceded", "10x5", "wind")).mean()

5.0


with_sliding_scale()

The same layer with a sliding-scale ceding commission.

Usage

Source

with_sliding_scale(anchors)

The commission rate at the year’s ceded loss ratio (ceded loss over premium) is interpolated linearly between (commission, loss_ratio) anchors and flat beyond the first and last, as aggregate’s slide. Set the premium first; it cannot be combined with swing rating or paid reinstatements, and replaces a flat commission.

Parameters
anchors: list of (float, float)
(commission, loss_ratio) pairs; the commission must not rise with the loss ratio.
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> qs = (Layer.quota_share("QS", 0.5).with_premium_rate(1.0, 200.0)
...       .with_sliding_scale([(0.45, 0.60), (0.25, 0.70), (0.19, 0.80)]))
>>> round(qs.ceding_commission_for(65.0), 12)

35.0


with_sliding_scale_carry_forward()

The same layer, carrying the sliding scale’s deficits (ceded loss

Usage

Source

with_sliding_scale_carry_forward(deficit=True, credit=False, years=None)

above the last anchor’s loss ratio), credits (below the first anchor’s) or both forward between the years of a term (Tower.apply_term).

Each year adds what was carried to its own ceded loss before the commission is read off the scale, and carries what is then still beyond the scale’s ends. Amounts are used up oldest first. Set the sliding scale first.

Parameters
deficit: bool = True
credit: bool = False
years: int = None
How many later years an amount may be carried into; None (the default) without limit.
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> qs = (Layer.quota_share("QS", 0.5).with_premium_rate(1.0, 200.0)
...       .with_sliding_scale([(0.45, 0.60), (0.25, 0.70)])
...       .with_sliding_scale_carry_forward())
>>> [round(c, 12) for c in qs.ceding_commissions_over([80.0, 55.0])]

[25.0, 35.0]


with_swing_rating()

The same layer, swing rated: the year’s premium is ``clip(share *

Usage

Source

with_swing_rating(basic, lcm, minimum=None, maximum=None)

basic + lcm * ceded, share * minimum, share * maximum)``.

The terms are quoted for 100% of the layer, as in aggregate; the ceded loss is already at the placed share. The swing premium replaces the fixed premium in the tower’s results. It cannot be combined with paid reinstatements, a sliding scale or a profit commission.

Parameters
basic: float
lcm: float

Loss conversion factor, such as 100 / 80.

minimum: float = None

Defaults to basic.

maximum: float = None
Defaults to no cap.
Returns
Layer
Examples
>>> from prospicio.reinsurance import Layer
>>> layer = Layer("L", 1000.0, 0.0).with_swing_rating(0.0, 1.25, 100.0, 300.0)
>>> [layer.premium_for(x) for x in (40.0, 200.0, 400.0)]

[100.0, 250.0, 300.0]


with_top_and_drop()

The same layer as a top-and-drop cover: it sits at its own

Usage

Source

with_top_and_drop(underlying, attachment)

attachment until the annual limit of the layer named underlying (earlier in the same stage, with an annual limit) is used up, and from the next event attaches at attachment, with the same occurrence and annual limits. On the loss basis only. A drop-down whose underlying layer never exhausts is the plain layer.

Parameters
underlying: str
attachment: float
Below the layer’s own.
Returns
Layer
Examples
>>> from prospicio.aggregate import EventSet
>>> from prospicio.reinsurance import Layer, Tower
>>> lower = Layer("lower", 10.0, 10.0, aggregate_limit=20.0)
>>> top = Layer("top", 10.0, 30.0).with_top_and_drop("lower", 10.0)
>>> ce = Tower([lower, top]).ceded_events(EventSet.from_years([[25.0, 25.0, 25.0, 40.0]]), "top")
>>> ce.events(0)

[10.0, 10.0]