Property catastrophe: a renewal at Larkspur Re
cat-0-overview.RmdRendered from docs/guides/cat-0-overview.qmd.
The code runs each time the site is built, so the output below is
current.
This track follows one reinsurer through one renewal of property catastrophe business, from the loss tables of a vendor model to a priced portfolio and its capital. Each page takes one step and runs it in prospicio on the same small book.
This is the R twin of the Python guide cat-0-overview.md.
It has the same sections, files and numbers. Under each R chunk is the
text that it prints. R/prospicio/tests/test-guides.R
requires each chunk to print exactly that text, which is also the text
of the Python guide.
Who it is for
The track is for an analyst who knows what a layer and a reinstatement are and now works with simulated catastrophe losses: a year event loss table, some treaties and a request for a price. If layer, rate on line or cost of capital are new to you, read a first course first, then what a reinsurance price is.
The pages work on simulated years (trials). For an exact method on a grid, see aggregate distributions, which also covers event sets in general.
The pages
Each page uses the one before it and also runs on its own.
- What the cat model hands over: the three loss tables (YELT, YLT and ELT), secondary uncertainty, how to read a YELT, event times, and a check of a simulation against the ELT.
- How bad can Alder’s year get?: VaR and TVaR on simulated years, exceedance curves, return periods, and how often a loss reaches a layer or exhausts it.
- Writing Larkspur’s contracts in code: the hours clause, occurrence layers with reinstatements, the capped quota share, the aggregate cover and its perils, and the contract year.
- Stacked covers, and who keeps what: several layers together, a signed line against the whole layer, a quota share that inures to a cat cover, losses out of reach of a cover, and a retro.
- The money around the loss: reinstatement premium and the season, commissions, sliding scales and brokerage, and the deal ledger.
- A price for Alder’s first layer: cost of capital and distortion prices, the technical quote, reinstatement premium in the price, sensitivities and the market check.
- Larkspur’s whole book: the five deals together, the tail of the book, capital allocation, diversification and the marginal price of a new deal.
Each page uses the terms of page 1 (year, event, piece, occurrence) and the hours clause of page 3, section 2. Pages 6 and 7 also use the reinstatement premium of page 5.
Notation
| Symbol | Meaning |
|---|---|
l xs a |
a layer of limit l above an attachment
a
|
AD, AL
|
aggregate deductible and aggregate limit |
j |
the index of a reinstatement |
k |
a rank among the simulated years, as in “the k-th
largest” |
N |
the number of simulated years, here 2,000 |
p |
a probability level, as in VaR at p
|
EL |
expected loss |
P |
premium (upfront premium on an excess layer) |
RIP |
reinstatement premium |
A, K
|
assets and capital, K = A - P
|
r |
cost of capital |
The story
Larkspur Re, a fictional reinsurer, writes property catastrophe cover for three fictional insurers in Varland. Varland has three regions: the coast, the plains and the range.
-
Alder Mutual (
alder) writes mostly on the coast. -
Bracken Insurance (
bracken) writes mostly on the plains. -
Corran General (
corran) writes mostly in the range.
Four perils hit Varland:
-
windstorm (
WS), late in the year, from about day 213 to day 305. -
earthquake (
EQ), at any time. -
flood (
FL), in spring, from about day 60 to day 180. -
convective storm (
CS), hail and tornado, from about day 100 to day 220.
Money is in millions of Varland crowns, a synthetic currency. All names and numbers in the book are fictional.
Market terms used on many pages:
- Subject premium: the premium of the business that the reinsurance protects. The cat premium is its part for catastrophe risk.
- Signed line: the share of a layer that a reinsurer takes. Other reinsurers take the remainder.
- Rate on line (RoL): the premium of an excess layer divided by its limit.
- Deal: one contract as Larkspur wrote it, with the premium, losses and other flows of its line, year by year.
A windstorm on the coast hits all three cedents at the same time, so their losses move together. A convective storm outbreak often comes into the loss table as two or three pieces, one or two days apart. The hours clause (page 3) decides if these pieces count as one loss or as several, which changes what each treaty pays.
The files
The book is in four CSV files in examples/data/. The
script examples/data/make_cat_book.py writes them from a
fixed seed, and a test checks that the committed files match its output.
The Python and R pages read the same files.
| File | One row per |
|---|---|
cat_book_yelt.csv |
loss to one cedent from one event in one simulated year |
cat_book_elt_alder.csv |
event of the catalog that can hit Alder |
cat_book_cedents.csv |
cedent: home region, subject premium, catastrophe premium |
cat_book_contracts.csv |
contract Larkspur Re writes this year, with all its terms |
The year event loss table (YELT) holds 2,000 simulated years. Its
fields are year, slot (the place of the event in the year),
event, day, hour, peril, region, cedent and loss. A year with no loss
has no rows. The event loss table (ELT) gives the annual rate of each
event and the mean loss to Alder with its spread. A cat model gives its
results in this form before it simulates years. Page 1 explains the two
tables and checks that they agree.
The pages read every contract term from
cat_book_contracts.csv. To try a different case, change the
script and run it again.
The cedents and the contracts
The chunk reads the two small files with only read.csv()
from base R. The tests run the guides from the repository root, and
Quarto renders them from docs/guides/, so a helper looks
for examples/data/ in the working directory and in its
parent directories. Every column is read as text, as the
csv module of the Python guide does. An empty term is
NA.
# The data files, found from the repository root (CI) or from docs/guides (Quarto).
find_data <- function(name, dir = getwd()) {
repeat {
path <- file.path(dir, "examples", "data", name)
if (file.exists(path)) return(path)
parent <- dirname(dir)
if (identical(parent, dir)) stop("examples/data/", name, " not found", call. = FALSE)
dir <- parent
}
}
read_book <- function(name) {
utils::read.csv(find_data(name), colClasses = "character", na.strings = character())
}
cedents <- read_book("cat_book_cedents.csv")
contracts <- read_book("cat_book_contracts.csv")
cedent_table <- data.frame(
cedent = cedents$cedent,
name = cedents$name,
home = cedents$home_region,
subject_premium = as.numeric(cedents$subject_premium),
cat_premium = as.numeric(cedents$cat_premium)
)
gt(cedent_table, rowname_col = "cedent") |>
tab_header("The three cedents", "Premiums in millions of Varland crowns") |>
cols_label(subject_premium = "subject premium", cat_premium = "cat premium") |>
fmt_number(columns = c(subject_premium, cat_premium), decimals = 1)| The three cedents | ||||
| Premiums in millions of Varland crowns | ||||
| name | home | subject premium | cat premium | |
|---|---|---|---|---|
| alder | Alder Mutual | coast | 420.0 | 40.0 |
| bracken | Bracken Insurance | plains | 310.0 | 36.0 |
| corran | Corran General | range | 260.0 | 30.0 |
num <- function(key) suppressWarnings(as.numeric(contracts[[key]]))
agg <- contracts$kind == "aggregate_xl"
qs <- contracts$kind == "quota_share"
terms_table <- data.frame(
contract = contracts$contract,
kind = contracts$kind,
perils = contracts$perils,
limit = ifelse(agg, num("aggregate_limit"), num("limit")),
attachment = ifelse(agg, num("aggregate_deductible"), num("attachment")),
annual_limit = ifelse(qs, num("aggregate_limit"), NA_real_),
share = num("share"),
reinstatements = num("reinstatements"),
reinstatement_rate = num("reinstatement_rate"),
rate_on_line = num("rate_on_line"),
ceding_commission = num("ceding_commission"),
hours = num("hours")
)
gt(terms_table, rowname_col = "contract") |>
tab_header("Larkspur Re's five contracts",
"Limits and attachments in millions of Varland crowns, 100% basis") |>
cols_label(annual_limit = "annual limit", reinstatement_rate = "reinst. rate",
rate_on_line = "rate on line", ceding_commission = "ceding commission") |>
fmt_number(columns = c(limit, attachment, annual_limit, reinstatements, hours),
decimals = 0) |>
fmt_percent(columns = c(share, reinstatement_rate, ceding_commission), decimals = 0) |>
fmt_number(columns = rate_on_line, decimals = 2) |>
sub_missing(missing_text = "")| Larkspur Re's five contracts | |||||||||||
| Limits and attachments in millions of Varland crowns, 100% basis | |||||||||||
| kind | perils | limit | attachment | annual limit | share | reinstatements | reinst. rate | rate on line | ceding commission | hours | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| alder_cat_1 | occurrence_xl | all | 40 | 30 | 30% | 1 | 100% | 0.15 | 72 | ||
| alder_cat_2 | occurrence_xl | all | 100 | 70 | 20% | 1 | 100% | 0.05 | 72 | ||
| bracken_cat | occurrence_xl | all | 50 | 25 | 25% | 2 | 100% | 0.14 | 72 | ||
| bracken_agg | aggregate_xl | CS+FL | 30 | 40 | 25% | 0.06 | |||||
| corran_qs | quota_share | all | 150 | 0 | 300 | 10% | 25% | 72 | |||
The amounts are on a 100% basis. On an excess of loss contract,
share is the signed line of Larkspur Re. On the quota
share, share is the cession, and limit is the
maximum for one event. The aggregate cover of Bracken applies only to
convective storm and flood. Its limit and
attachment are the aggregate limit and deductible. The
quota share also pays Corran a 25% ceding commission on the ceded
premium.
The year event loss table at a glance
yelt <- utils::read.csv(find_data("cat_book_yelt.csv"))
years <- unique(yelt$year)
cat(sprintf("rows %s, years with a loss %s of 2,000\n",
format(nrow(yelt), big.mark = ","), format(length(years), big.mark = ",")))## rows 16,432, years with a loss 1,820 of 2,000
## first year with a loss 2, last 2000
The mean annual loss splits by peril and cedent.
perils <- c("WS", "EQ", "FL", "CS")
who <- cedents$cedent
total <- tapply(yelt$loss, list(factor(yelt$peril, perils), factor(yelt$cedent, who)), sum)
total[is.na(total)] <- 0
mean_loss <- total / 2000
loss_table <- cbind(mean_loss, all = rowSums(mean_loss))
loss_table <- rbind(loss_table, all = colSums(loss_table))
gt(data.frame(peril = rownames(loss_table), loss_table), rowname_col = "peril") |>
tab_header("Mean annual loss by peril and cedent", "Millions of Varland crowns") |>
fmt_number(decimals = 3)| Mean annual loss by peril and cedent | ||||
| Millions of Varland crowns | ||||
| alder | bracken | corran | all | |
|---|---|---|---|---|
| WS | 9.915 | 6.163 | 5.575 | 21.652 |
| EQ | 2.473 | 2.050 | 4.371 | 8.894 |
| FL | 3.042 | 3.999 | 1.997 | 9.038 |
| CS | 1.349 | 3.165 | 1.106 | 5.620 |
| all | 16.778 | 15.376 | 13.049 | 45.204 |
Two figures: the cedents by peril, then the annual loss of all cedents together for the years with a loss.
library(ggplot2, exclude = "layer") # keeps prospicio's layer()
by_peril <- as.data.frame(as.table(mean_loss), responseName = "loss")
names(by_peril)[1:2] <- c("peril", "cedent")
ggplot(by_peril, aes(peril, loss, fill = cedent)) +
geom_col(position = "dodge") +
labs(x = "peril", y = "mean annual loss (millions of crowns)", fill = "cedent",
title = "Windstorm is the largest peril for every cedent")
annual <- tapply(yelt$loss, yelt$year, sum)
ggplot(data.frame(loss = as.numeric(annual)), aes(loss)) +
geom_histogram(bins = 40, fill = "grey75") +
geom_vline(aes(xintercept = sum(loss) / 2000, linetype = "mean over all 2,000 years")) +
scale_x_log10() +
labs(x = "annual loss of the three cedents (millions of crowns)", y = "years",
linetype = NULL,
title = "1,820 years with a loss: the annual loss spans four orders of magnitude") +
theme(legend.position = "top")The mean annual loss over all years is the average annual loss (AAL, defined on page 1). Windstorm is the largest peril for every cedent, also for Corran in the range, because a coastal storm is the largest event in the catalog. The home region shows in the second peril: flood and convective storm for Bracken, earthquake for Corran.
In 180 years no event hits a cedent. Year 1 is one of them, so the file starts at year 2. A year with no row is still a year, so every average on these pages divides by 2,000.
Further reading
reinsurance.dev by Oliver Baltzer is another introduction to property catastrophe reinsurance.