Skip to contents

The ledger of a book, as the Python package aggregate's pnl and xpnl builders: a gross premium less the annual loss less expenses, over a source of annual gross losses, with the annual covers of a reinsurance_tower. book_ledger() lays it out as one of three faces:

Usage

pnl_book(
  name,
  premium,
  expenses = list(),
  premium_label = NULL,
  loss_label = NULL,
  step_label = NULL,
  retro = NULL,
  expense_at_expected_loss = FALSE
)

pnl_expense(basis, value = NULL, label = NULL)

book_ledger(book, source, tower = NULL, face = "consolidated")

derive_premium(technical, expenses)

Arguments

name

The ledger's name.

premium

The gross premium.

expenses

A list of pnl_expense()s.

premium_label, loss_label, step_label

The premium leg's label ("Premium"), the loss leg's ("Loss", also the gross book's margin on a walk) and the gross book's step on a walk ("Gross").

retro

NULL, or c(basic, lcm, minimum, maximum) (NA for an open end) to rate the book retrospectively, aggregate's retro <collar> premium: the premium is clip(basic + lcm * x, minimum, maximum) at the year's gross loss x, 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

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).

basis

"fixed", "premium" or "loss", or a list of list(basis, value) terms.

value

The amount or rate, with a single basis.

label

The leg's label.

book

A pnl_book().

source

A grid_distribution or list(values, probs) of annual gross losses.

tower

NULL or a reinsurance_tower.

face

"consolidated", "walk", "peel-top-down" or "peel-bottom-up".

technical

The technical premium.

Value

pnl_book() and pnl_expense() lists, book_ledger() a pnl_ledger(), derive_premium() a number.

Details

  • "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, with expense_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-down" and "peel-bottom-up": one buy group per layer, with an All aggregate subtotal.

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 pnl_leg()).

pnl_expense() is one expense leg: an amount ("fixed"), a fraction of the gross premium ("premium") or of the gross loss ("loss"), or several terms. Unlabelled, a book's only expense is the leg expense; with several, a single-basis one is <basis> expense and a mixed one expense. derive_premium() is the gross premium whose expenses leave a technical premium, (T + F) / (1 - r) (aggregate's derive premium).

Examples

cover <- with_ceding_commission(with_deposit_premium(aggregate_stop_loss("agg 3 xs 5", 3, 5), 1), 0.1)
book <- pnl_book("Ex3", 10, list(pnl_expense("premium", 0.1)))
gross <- list(c(2, 3, 4, 5, 6, 8), c(0.25, 0.3, 0.09, 0.2, 0.12, 0.04))
walk <- book_ledger(book, gross, reinsurance_tower(list(cover)), "walk")
mean(ledger_result(walk))
#> [1] 4.54