aggregate.Book
A seller’s book, aggregate’s pnl and xpnl builders: a gross
Usage
aggregate.Book()premium, expenses and the labels of its legs, laid out over a source of annual gross losses with the annual covers of a tower.
ledger() gives one of three faces:
consolidated(pnl): one group, the net position. With a tower it books net premium (gross less ceded premiums) less the net loss less the commission received less expenses, over the net loss; a loss-basis expense books as its rate times each year’s gross loss (or the expected one, withexpense_at_expected_loss).walk(xpnl): the gross book, then one buy group per stage of the tower, with the running net and the covers’ total impact.peel-top-downandpeel-bottom-up(xpnl ... peel): one buy group per layer, with anAll aggregatesubtotal.
Every layer’s terms are taken at the annual total. The builders book a fixed premium and a flat ceding commission; a layer with loss-sensitive terms is refused (write its legs with Leg).
Parameters
name: str-
The ledger’s name.
premium: float-
The gross premium.
expenses: list of Expensepremium_label: str-
Premiumby default. loss_label: str-
Lossby default; also the gross book’s margin on a walk. step_label: str-
The gross book’s step on a walk,
Grossby default. retro: prospicio.reinsurance.LossSensitivePremium-
Rate the book retrospectively (aggregate’s
retro <collar> premium): the premium is these terms at the year’s gross loss, and premium (the collar’s basic premium in aggregate) is what premium-basis expenses are taken on. A retro book buys no cover here. expense_at_expected_loss: bool = False- Book a loss-basis expense on the consolidated face at the expected gross loss, as aggregate’s guaranteed-cost builder does, rather than at each year’s gross loss (which makes the consolidated margin the walk’s net margin year by year).
Examples
>>> from prospicio.aggregate import Book, Expense
>>> from prospicio.reinsurance import Layer, Tower
>>> gross = ([2, 3, 4, 5, 6, 8], [0.25, 0.3, 0.09, 0.2, 0.12, 0.04])
>>> cover = Layer.stop_loss("agg 3 xs 5", 3.0, 5.0).with_deposit_premium(1.0)
>>> cover = cover.with_ceding_commission(0.1)
>>> book = Book("Ex3", 10.0, [Expense("premium", 0.1)])
>>> walk = book.ledger(gross, Tower([cover]), "walk")
>>> round(walk.result.mean(), 12), walk.sheet()["step"][-1](4.54, ‘All’)
Attributes
| Name | Description |
|---|---|
| premium | The gross premium. |
Methods
| Name | Description |
|---|---|
| ledger() |
The ledger over the annual gross losses source.
|
| occurrence_ledger() |
The ledger with occurrence covers over the joint source joint
|
| occurrence_peel() | Several occurrence layers peeled one by one, and the aggregate |
ledger()
The ledger over the annual gross losses source.
Usage
ledger(source, tower=None, face="consolidated")Parameters
source: Grid or tuple of (list of float, list of float)tower: prospicio.reinsurance.Tower = None-
Annual covers; without one, the plain book.
face: str = "consolidated"-
consolidated,walk,peel-top-downorpeel-bottom-up.
Returns
Ledger
Raises
ValueError- A peel without a tower, a layer that needs each event, or one with loss-sensitive terms.
occurrence_ledger()
The ledger with occurrence covers over the joint source joint
Usage
occurrence_ledger(joint, occurrence, aggregate=None, face="consolidated")of the annual gross loss and the loss the occurrence tower cedes (occurrence_source()), then the aggregate covers of aggregate on the net of the occurrence covers, as aggregate’s xpnl and pnl over its occ_bivariate.
The occurrence covers are one group on the walk, named after the first layer; a peel needs exactly one occurrence layer. The consolidated face is over the net loss at each atom. A single occurrence layer may carry annual terms and paid reinstatements on the joint’s unlimited annual cession R: its recovery A(R) and premium D + h(R) then vary with the year.
Parameters
joint: tuple of (list of float, list of float, list of float)-
(gross, ceded, probs). occurrence: prospicio.reinsurance.Tower-
Per-occurrence covers; annual terms and reinstatements on a single layer only.
aggregate: prospicio.reinsurance.Tower = Noneface: str = "consolidated"
Returns
Ledger
Raises
ValueError- As ledger(), annual terms on an occurrence tier of several layers, or a peel through several occurrence layers.
occurrence_peel()
Several occurrence layers peeled one by one, and the aggregate
Usage
occurrence_peel(
frequency,
severity,
occurrence,
aggregate=None,
face="peel-top-down",
points=1024
)covers of aggregate behind them, aggregate‘s stitched peel. The joint source carries only the occurrence tier’s total cession, so every row is its own exact marginal: each occurrence layer’s recovery, running net and the tier’s total the compound of a per-claim map of severity under frequency (by FFT on twice points), each aggregate layer’s a pushforward of the net-of-occurrence aggregate. The mean column foots; the other statistics are each row’s own, with no scenario columns; Impact is the difference of the grand and gross results’ statistics; a loss-basis expense is booked at the expected gross loss.
Parameters
frequency: Poisson, NegativeBinomial, Binomial or a countseverity: Gridoccurrence: prospicio.reinsurance.Tower-
Occurrence layers with fixed terms.
aggregate: prospicio.reinsurance.Tower = Noneface: str = "peel-top-down"-
peel-top-downorpeel-bottom-up. points: int = 1024
Returns
Ledger- A stitched ledger (is_stitched).
Raises
ValueError- A face that is not a peel, a retro book, occurrence layers with annual terms, reinstatements or loss-sensitive terms, aggregate layers with loss-sensitive terms, or a severity grid longer than points.