Reinsurer default on a tower
reinsurer_panel.RdA panel holds the reinsurers on a tower and their signed lines, and
draws which reinsurers default in each of a tower's simulated years
(docs/design/reinsurer-default.md). reinsurer_panel() builds a panel
with no lines; panel_line() adds lines, each a share of a layer's
ceded loss (after the layer's share); panel_driver() ranks the years
by another quantity than the gross loss; apply_panel() gives the
tower's result after default and panel_by_reinsurer() each reinsurer's
credit loss, exposure and default; apply_panel_term() and
panel_by_reinsurer_term() do the same over a term's paths
(apply_tower_term()).
Usage
reinsurer_panel(reinsurers, ptr = NULL)
panel_line(panel, reinsurer, layer, line)
panel_driver(panel, by_year)
apply_panel(panel, result, seed = 0)
panel_by_reinsurer(panel, result, seed = 0)
apply_panel_term(panel, result, n_years, seed = 0)
panel_by_reinsurer_term(panel, result, n_years, seed = 0)Arguments
- reinsurers
A list of reinsurer objects with unique names.
- ptr
Internal: an existing panel to wrap.
- panel
A
reinsurer_panel.- reinsurer, layer, line
The reinsurer's name, the layer's name and the line, in
(0, 1]; equal lengths (or length 1, at least one), one line each.- by_year
One finite value per simulated year, in the order of the tower's result (over a term, one per path-year, path-major).
- result
A tower's one-year result from
apply_tower()(on an event_set, a predictive_distribution or annual losses), or forapply_panel_term()andpanel_by_reinsurer_term()a term's paths fromapply_tower_term().- seed
The default draws' seed, a non-negative whole number; their streams are apart from the events' even with the events' seed.
- n_years
The term's years; the result's years must be exactly 1 to
n_years.
Value
reinsurer_panel(), panel_line() and panel_driver(): a
reinsurer_panel, whose reinsurers property lists its reinsurer
objects and reinsurer_names property their names, in panel order.
apply_panel(): a predictive_distribution
with the result's components, copied bit for bit, then
("credit_loss", <layer>) for every layer of the result (zero on a
layer the panel does not name), ("recovered", <layer>), the layer's
ceded loss less its credit loss, and ("net_after_default", "retained"), the net loss plus the year's credit loss; a reinsurer's
credit loss is split over its layers in proportion to its exposure on
each, and on a labelled result the new components get "" labels.
panel_by_reinsurer(): a predictive_distribution with dimensions
kind and reinsurer: ("credit_loss", r), ("exposure", r) (after
collateral) and ("default", r) (1 or 0) for every reinsurer, from the
same draws as apply_panel() with the same seed.
apply_panel_term(): the term's components, copied bit for bit, then
for each year in turn the components apply_panel() adds, with the
year as the last key. panel_by_reinsurer_term(): dimensions kind,
reinsurer and year, panel_by_reinsurer()'s components for each
year, the exposure after the collateral still held at the start of the
year and default 1 in every year from the one the reinsurer defaults
in.
Details
Reinsurer r's exposure in a year is E = sum over l of s_rl X_l, with
X_l layer l's ceded loss and s_rl its line; if it defaults, the
cedant loses (1 - R_r) (E - C_r)^+, with R_r its recovery rate and
C_r its collateral. Defaults follow Vasicek's one-factor model: given
the year's factor z, reinsurer r defaults with probability
pnorm((qnorm(p_r) - sqrt(rho_r) z) / sqrt(1 - rho_r)), and
z = -qnorm(U), where U is the year's rank by its driver (the gross
loss, or panel_driver()), ties broken at random, so the worst years
have the highest probability of default. Each year draws from its own
random stream, so the result has the same bits on any number of threads.
Over a term each row is a path, and a default is final: a reinsurer that
defaults in year t of a path is in default in every later year of it.
The collateral is held once per reinsurer and path and is used up: in
each year in default the collateral still held is set against that
year's exposure, and what it covered is gone for the later years. Each
path-year's factor comes from its driver ranked among all path-years (a
driver is given path-major: year t of path j at (j - 1) * n_years + t). Each path draws from its own stream, its years in order, so a term
of one year draws as apply_panel() does on that year. With a constant
probability p and independent default (correlation 0), a reinsurer is
in default by year t with probability 1 - (1 - p)^t. With a
correlation above 0 this holds only when the years' drivers are
independent and identically distributed: the ranks are taken over all
path-years together, so a driver that trends from year to year moves
defaults between years.
The lines of a layer the panel names must sum to 1 (to 1e-9), and every layer a line names must be in the result; both are checked when the panel is applied, since a panel is built before it meets a tower. A layer the panel does not name carries no credit risk.
apply_panel_term() and panel_by_reinsurer_term() stop with an error
for an n_years that is not a whole number of at least 1, a one-year
result, a result whose years are not exactly 1 to n_years, a driver
without one value per path-year, a result the panel was already applied
to, lines that break the rules above, or a seed that is not a
non-negative whole number.
apply_panel() and panel_by_reinsurer() likewise refuse a term.
See also
reinsurer(), apply_tower(), solvency2_type1() for the
Solvency II standard formula's charge.
Examples
years <- apply_tower(reinsurance_tower(list(xol_layer("10x10", 10, 10))), c(5, 15, 30))
# Re A certainly defaults and pays back 40% of what it owes.
panel <- reinsurer_panel(list(reinsurer("Re A", 1, 0.4), reinsurer("Re B", 0, 0.4)))
panel <- panel_line(panel, c("Re A", "Re B"), "10x10", c(0.5, 0.5))
after <- apply_panel(panel, years, seed = 7)
marginal(after, list("credit_loss", "10x10"))@draws
#> [1] 0.0 1.5 3.0
marginal(after, list("net_after_default", "retained"))@draws
#> [1] 5.0 11.5 23.0
draw_matrix(panel_by_reinsurer(panel, years, seed = 7))
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 0.0 0 0.0 0.0 1 0
#> [2,] 1.5 0 2.5 2.5 1 0
#> [3,] 3.0 0 5.0 5.0 1 0
# Over a term: one path of two years, ceding 5 and then 10. Re C
# certainly defaults, recovers nothing and has collateral of 8: year 1
# uses 5 of it, year 2 the 3 left.
term <- apply_tower_term(
reinsurance_tower(list(xol_layer("10x10", 10, 10))),
list(events_from_years(list(15)), events_from_years(list(25)))
)
re_c <- reinsurer("Re C", 1, 0, collateral = 8)
panel_c <- panel_line(reinsurer_panel(list(re_c)), "Re C", "10x10", 1)
after <- apply_panel_term(panel_c, term, n_years = 2)
marginal(after, list("credit_loss", "10x10", 2L))@draws
#> [1] 7
draw_matrix(panel_by_reinsurer_term(panel_c, term, n_years = 2))
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 0 0 1 7 7 1