Iman-Conover, uncertainty and capital by layer: CAS Monograph 15, chapter 8
capital-modeling-monograph-15-iman-conover.RmdRendered from docs/guides/capital-modeling-monograph-15-iman-conover.qmd.
The code runs each time the site is built, so the output below is
current.
CAS Monograph 15 is Introduction to Capital Modeling and Portfolio Management (John Major and Stephen Mildenhall, 2026). Chapter 8 covers parameter uncertainty, the Iman-Conover method, capital allocation by layer and Bodoff’s layer allocation. This guide runs each topic in prospicio from R and shows the monograph’s numbers beside prospicio’s.
This is the R twin of the Python guide capital-modeling-monograph-15-iman-conover.md,
with the same sections and numbers. The R package calls the same Rust
code as the Python package, so the seeded samples and the shuffles agree
with it. The text block after each R chunk is that chunk’s output, and
R/prospicio/tests/test-guides.R checks it.
Exact numbers (Example 2’s regional means and percentiles, the InsCo tables of sections 8.3 and 8.4) agree with prospicio to the printed digits. Numbers from one sample of 1,000 simulations (the achieved correlations of Examples 1 and 2) agree within sampling error, whose size the guide shows. The explanations are in new words; the table numbers are the monograph’s.
Companion guides: chapter 9, chapters 3 and 4, chapters 5 and 6 and chapters 1, 2 and 7.
1. Parameter uncertainty
Section 8.1 separates process risk (the randomness of a loss with a
known distribution) from parameter uncertainty (an unknown
distribution). It gives four responses: ignore the uncertainty, report a
range, absorb it into a predictive distribution, or isolate a credible
worst case. Take a lognormal severity with sigma 1.2 and a
mean of about 100, whose log-scale location is known only to within 0.3
in each direction:
library(prospicio)
library(gt)
SIGMA <- 1.2
best <- log(100) - SIGMA^2 / 2
severities <- lapply(c(-0.3, 0, 0.3), function(shift) lognormal(best + shift, SIGMA))
mixture_quantile <- function(dists, p, lo = 0, hi = 1e6) {
# The p quantile of an equal mixture, by bisection on its cdf.
for (i in 1:200) {
mid <- (lo + hi) / 2
if (mean(sapply(dists, function(d) cdf(d, mid))) < p) lo <- mid else hi <- mid
}
(lo + hi) / 2
}
responses <- data.frame(
response = c("report, low", "report, best", "report, high", "ignore it", "absorb it", "isolate it"),
mean = c(sapply(severities, function(d) mean(d)), NA, NA, NA),
q = c(sapply(severities, function(d) quantile(d, 0.995)), quantile(severities[[2]], 0.995),
mixture_quantile(severities, 0.995), quantile(severities[[3]], 0.995))
)
gt(responses, rowname_col = "response") |>
tab_header(title = "Responses to parameter uncertainty",
subtitle = "Lognormal severity with sigma 1.2; the location moves by 0.3") |>
cols_label(q = "99.5% quantile") |>
fmt_number(c(mean, q), decimals = 1, use_seps = FALSE) |>
sub_missing(missing_text = "")| Responses to parameter uncertainty | ||
| Lognormal severity with sigma 1.2; the location moves by 0.3 | ||
| mean | 99.5% quantile | |
|---|---|---|
| report, low | 74.1 | 793.3 |
| report, best | 100.0 | 1070.8 |
| report, high | 135.0 | 1445.4 |
| ignore it | 1070.8 | |
| absorb it | 1139.9 | |
| isolate it | 1445.4 | |
Absorbing the uncertainty, with equal weights on the three locations, gives a quantile about 6% above the best estimate. This is the downward bias that the monograph finds in a quantile that ignores parameter uncertainty.
blend_predictive() does the same mixing of whole
simulations: it takes each simulation from one of several models with
given weights. The Bayesian models (for example bayes_odp()
in reserving) return predictive distributions that already include
parameter uncertainty.
2. Example 1: three units
Section 8.2.2 correlates three units: Auto, GL and Property. Each unit has a lognormal severity limited per occurrence and a gamma-mixed Poisson count:
| Unit | Expected loss | Limit | Severity mean | Severity CV | Mixing CV |
|---|---|---|---|---|---|
| Auto | 5,000 | 2,000 | 30 | 2 | 0.2 |
| GL | 2,000 | 5,000 | 50 | 5 | 0.3 |
| Property | 7,000 | 10,000 | 100 | 5 | 0.1 |
prospicio compounds each unit by FFT. Then
copula_simulate() with an independence (identity) Gaussian
copula draws 1,000 independent years from the three distributions, as
the monograph does:
unit <- function(loss, limit, mean, cv, mixing_cv, step = 1, points = 2^16) {
# A unit's annual loss: limited lognormal claims, gamma-mixed Poisson count.
severity <- discretize(lognormal_from_mean_cv(mean, cv), step, points, "local_moment")
claim <- map_grid(severity, function(x) pmin(x, limit))$grid
compound_distribution(mixed_poisson_count(loss / mean(claim), mixing_cv), claim, points,
method = "fft")
}
UNITS <- list(Auto = c(5000, 2000, 30, 2, 0.2), GL = c(2000, 5000, 50, 5, 0.3),
Property = c(7000, 10000, 100, 5, 0.1))
grids <- lapply(UNITS, function(a) do.call(unit, as.list(a)))
KEYS <- data.frame(unit = names(UNITS))
IDENTITY <- diag(3)
sample <- copula_simulate(gaussian_copula(IDENTITY), grids, 1000, 815, keys = KEYS)
X <- draw_matrix(sample)
BOOK_81 <- list(Auto = c(5011.7, 0.257), GL = c(2092.4, 0.660), Property = c(7117.8, 0.467))
table_81 <- do.call(rbind, lapply(seq_along(UNITS), function(j) {
g <- grids[[j]]
data.frame(unit = names(UNITS)[j], fft_mean = mean(g), fft_cv = sqrt(variance(g)) / mean(g),
mean = mean(X[, j]), cv = sd(X[, j]) / mean(X[, j]),
book_mean = BOOK_81[[j]][1], book_cv = BOOK_81[[j]][2])
}))
gt(table_81, rowname_col = "unit") |>
tab_header(title = "Table 8.1: three units, model and sample",
subtitle = "Annual loss; the sample has 1,000 years") |>
cols_label(fft_mean = "FFT mean", fft_cv = "FFT cv", mean = "sample mean", cv = "sample cv",
book_mean = "book mean", book_cv = "book cv") |>
fmt_number(c(fft_mean, mean, book_mean), decimals = 1, use_seps = FALSE) |>
fmt_number(c(fft_cv, cv, book_cv), decimals = 3)| Table 8.1: three units, model and sample | ||||||
| Annual loss; the sample has 1,000 years | ||||||
| FFT mean | FFT cv | sample mean | sample cv | book mean | book cv | |
|---|---|---|---|---|---|---|
| Auto | 5000.0 | 0.262 | 4998.8 | 0.262 | 5011.7 | 0.257 |
| GL | 2000.0 | 0.672 | 2042.0 | 0.644 | 2092.4 | 0.660 |
| Property | 7000.0 | 0.465 | 7017.0 | 0.454 | 7117.8 | 0.467 |
The FFT columns are the model. Both samples differ from it by a few percent, which is sampling error, not a model difference.
3. The target and the achieved correlation
The target (Table 8.2) has a correlation of -0.3 between Auto and GL, 0.8 between GL and Property, and 0 between Auto and Property. A target must be a correlation matrix: symmetric and positive definite. prospicio refuses one that is not:
TARGET <- rbind(c(1, -0.3, 0), c(-0.3, 1, 0.8), c(0, 0.8, 1))
cat("eigenvalues of the target:", sprintf("%.3f", sort(eigen(TARGET, symmetric = TRUE)$values)), "\n")## eigenvalues of the target: 0.146 1.000 1.854
bad <- rbind(c(1, 0.9, 0.9), c(0.9, 1, -0.9), c(0.9, -0.9, 1))
tryCatch(iman_conover(sample, bad, 1), error = function(e) cat("not positive definite: error\n"))## not positive definite: error
iman_conover() reorders each column of the sample. Each
unit keeps exactly its own 1,000 values, and only the grouping of the
values into years changes. Ties are ranked in order of appearance
(rank(ties.method = "first")), as in the Python guide:
PAIRS <- list(c(1, 2), c(1, 3), c(2, 3))
NAMES <- c("Auto-GL", "Auto-Property", "GL-Property")
ranks <- function(m) apply(as.matrix(m), 2, rank, ties.method = "first")
pairs_of <- function(m) {
# Pearson and Spearman correlation of each pair of columns.
pearson <- cor(m)
spearman <- cor(ranks(m))
lapply(PAIRS, function(p) c(pearson[p[1], p[2]], spearman[p[1], p[2]]))
}
joint <- iman_conover(sample, TARGET, 1)
Y <- draw_matrix(joint)
cat("marginals unchanged:", all(sapply(1:3, function(j) identical(sort(X[, j]), sort(Y[, j])))), "\n")## marginals unchanged: TRUE
The achieved correlations, against the monograph’s Table 8.3:
BOOK_83 <- list(c(-0.271, -0.287), c(0.003, 0.003), c(0.772, 0.779)) # (linear, rank)
got <- pairs_of(Y)
table_83 <- data.frame(
pair = NAMES, target = sapply(PAIRS, function(p) TARGET[p[1], p[2]]),
pearson = sapply(got, `[`, 1), book_pearson = sapply(BOOK_83, `[`, 1),
spearman = sapply(got, `[`, 2), book_spearman = sapply(BOOK_83, `[`, 2)
)
gt(table_83, rowname_col = "pair") |>
tab_header(title = "Table 8.3: achieved correlation",
subtitle = "Of the reordered sample, against the target") |>
cols_label(pearson = "Pearson", book_pearson = "Pearson, book", spearman = "Spearman",
book_spearman = "Spearman, book") |>
fmt_number(target, decimals = 1) |>
fmt_number(c(pearson, book_pearson, spearman, book_spearman), decimals = 3)| Table 8.3: achieved correlation | |||||
| Of the reordered sample, against the target | |||||
| target | Pearson | Pearson, book | Spearman | Spearman, book | |
|---|---|---|---|---|---|
| Auto-GL | −0.3 | −0.278 | −0.271 | −0.270 | −0.287 |
| Auto-Property | 0.0 | −0.002 | 0.003 | 0.003 | 0.003 |
| GL-Property | 0.8 | 0.773 | 0.772 | 0.784 | 0.779 |
As in the monograph, Auto-GL and GL-Property land a little inside the target. To see how far a sample of 1,000 moves the digits, repeat with 100 samples and shuffles:
runs <- array(0, c(100, 3, 2)) # run, pair, (Pearson, Spearman)
for (s in 0:99) {
draw <- copula_simulate(gaussian_copula(IDENTITY), grids, 1000, 1000 + s, keys = KEYS)
got <- pairs_of(draw_matrix(iman_conover(draw, TARGET, s)))
for (k in 1:3) runs[s + 1, k, ] <- got[[k]]
}
flat <- function(x) round(as.numeric(x), 3) + 0 # -0 becomes 0
spread_rows <- do.call(rbind, lapply(1:3, function(k) {
pe <- runs[, k, 1]
sp <- runs[, k, 2]
p <- PAIRS[[k]]
data.frame(pair = NAMES[k], p5 = flat(quantile(pe, 0.05)), pm = flat(mean(pe)),
p95 = flat(quantile(pe, 0.95)), s5 = flat(quantile(sp, 0.05)), sm = flat(mean(sp)),
s95 = flat(quantile(sp, 0.95)), gauss = flat(6 / pi * asin(TARGET[p[1], p[2]] / 2)))
}))
gt(spread_rows, rowname_col = "pair") |>
tab_header(title = "Achieved correlation over 100 samples",
subtitle = "5%, mean and 95% quantiles; Gaussian Spearman = (6/pi) asin(r/2)") |>
cols_label(p5 = "Pearson 5%", pm = "Pearson mean", p95 = "Pearson 95%", s5 = "Spearman 5%",
sm = "Spearman mean", s95 = "Spearman 95%", gauss = "Gaussian Spearman") |>
fmt_number(c(p5, pm, p95, s5, sm, s95, gauss), decimals = 3)| Achieved correlation over 100 samples | |||||||
| 5%, mean and 95% quantiles; Gaussian Spearman = (6/pi) asin(r/2) | |||||||
| Pearson 5% | Pearson mean | Pearson 95% | Spearman 5% | Spearman mean | Spearman 95% | Gaussian Spearman | |
|---|---|---|---|---|---|---|---|
| Auto-GL | −0.286 | −0.269 | −0.252 | −0.298 | −0.286 | −0.271 | −0.288 |
| Auto-Property | −0.020 | 0.000 | 0.021 | −0.012 | 0.000 | 0.016 | 0.000 |
| GL-Property | 0.752 | 0.773 | 0.791 | 0.778 | 0.787 | 0.795 | 0.786 |
library(ggplot2, exclude = "layer") # keeps prospicio's layer()
ranges <- do.call(rbind, lapply(1:3, function(k) {
do.call(rbind, lapply(1:2, function(kind) {
v <- runs[, k, kind]
data.frame(pair = NAMES[k], kind = c("Pearson", "Spearman")[kind], mean = mean(v),
lo = quantile(v, 0.05), hi = quantile(v, 0.95))
}))
}))
ranges$pair <- factor(ranges$pair, levels = rev(NAMES))
targets <- data.frame(pair = factor(NAMES, levels = rev(NAMES)),
target = sapply(PAIRS, function(p) TARGET[p[1], p[2]]))
targets$spearman <- 6 / pi * asin(targets$target / 2)
ggplot(ranges, aes(y = pair)) +
geom_point(aes(x = target, shape = "target (Pearson)"), data = targets, colour = "grey75", size = 5) +
geom_point(aes(x = spearman, shape = "Gaussian Spearman of the target"), data = targets,
colour = "grey40", size = 5) +
geom_linerange(aes(xmin = lo, xmax = hi, colour = kind), position = position_dodge(width = 0.4),
linewidth = 1) +
geom_point(aes(x = mean, colour = kind), position = position_dodge(width = 0.4)) +
scale_shape_manual(values = c("target (Pearson)" = 124, "Gaussian Spearman of the target" = 124)) +
labs(x = "achieved correlation (mean and 90% range of 100 samples)", y = NULL,
colour = NULL, shape = NULL, title = "Achieved against target correlation") +
theme(legend.position = "top")Every value of Table 8.3 is inside these 90% ranges. Two results are not sampling error:
-
The rank correlation is the Gaussian rank correlation of the
target. Iman-Conover copies the ranks of reference scores that
have exactly the target correlation, so Spearman’s rho is near
(6/pi) asin(r/2), the rank correlation of a bivariate normal with correlationr. - The linear correlation is less than the target. Pearson’s correlation depends on the marginals: skewed marginals cannot reach a high linear correlation even when their ranks agree. The maximum is the correlation of the two samples sorted together:
bounds <- function(a, b) {
# The largest and smallest Pearson correlation any pairing of a and b can have.
c(cor(sort(a), sort(b)), cor(sort(a), rev(sort(b))))
}
b <- bounds(X[, 2], X[, 3])
cat(sprintf("GL-Property: at most %.3f, at least %.3f\n", b[1], b[2]))## GL-Property: at most 0.997, at least -0.779
## Auto-GL: at most 0.963, at least -0.890
So a request for a very high Pearson correlation can disappoint. Set the input a little above the output you need, or use the rank correlation, which Iman-Conover controls directly.
4. The output’s row order
Item 6 of section 8.2.5 warns that some implementations return an Iman-Conover sample in a systematic row order. prospicio does: the first column of its reference holds the scores in increasing order, so the first unit comes out sorted:
## Auto sorted ascending: TRUE
cat(sprintf("mean of the first 100 years: Auto %7.1f (all 1,000: %7.1f)\n",
mean(Y[1:100, 1]), mean(Y[, 1])))## mean of the first 100 years: Auto 2965.4 (all 1,000: 4998.8)
u <- copula_sample(gaussian_copula(IDENTITY), 1000, 99)
shuffled <- Y[order(u[, 1]), ]
cat(sprintf("after a random row order: Auto %7.1f\n", mean(shuffled[1:100, 1])))## after a random row order: Auto 4856.5
So the first 100 rows are not a random sample. Statistics over all
rows (means, quantiles, a capital_portfolio() built from
them) do not depend on the row order. Shuffle the rows, as above, before
you take a subset or pair them with another simulation.
5. The algorithm by hand
Section 8.2.8 derives the method in four steps:
- Take
nscores with mean 0 and variance 1. The monograph prefers the evenly spaced normal quantilesPhi^-1(i / (n + 1)). - Put an independently permuted copy of the scores in each of
mcolumns to makeM. ThenM'M / nis close to the identity. - Let
S = C'Cbe the Cholesky factorization of the target, andM'M / n = F'Fthat of the actual correlation ofM. ThenT = M F^-1 Chas correlation exactlyS. - Give each column of the input the rank order of the matching column
of
T.
In R, chol() returns the upper triangular factor:
iman_conover_by_hand <- function(x, target, scores, seed) {
n <- nrow(x)
m <- ncol(x)
scores <- (scores - mean(scores)) / sqrt(mean((scores - mean(scores))^2))
u <- copula_sample(gaussian_copula(diag(m)), n, seed)
M <- sapply(1:m, function(j) scores[order(u[, j])])
F <- chol(crossprod(M) / n) # upper triangular, M'M/n = F'F
C <- chol(target)
T <- M %*% solve(F) %*% C
out <- sapply(1:m, function(j) sort(x[, j])[rank(T[, j], ties.method = "first")])
list(out = out, M = M, T = T)
}
n <- 1000
normal_scores <- qnorm(seq_len(n) / (n + 1))
by_hand <- iman_conover_by_hand(X, TARGET, normal_scores, 3)
M <- by_hand$M
T <- by_hand$T
cat(sprintf("largest error of M'M/n against the identity: %.3f\n", max(abs(crossprod(M) / n - diag(3)))))## largest error of M'M/n against the identity: 0.035
## T'T/n equals the target to 1e-12: TRUE
The Spearman correlations of the by-hand result and of prospicio’s:
hand_table <- data.frame(pair = NAMES, hand = sapply(pairs_of(by_hand$out), `[`, 2),
lib = sapply(pairs_of(Y), `[`, 2))
gt(hand_table, rowname_col = "pair") |>
tab_header(title = "Spearman correlation of the reordered sample",
subtitle = "By hand and by prospicio") |>
cols_label(hand = "by hand", lib = "prospicio") |>
fmt_number(c(hand, lib), decimals = 3)| Spearman correlation of the reordered sample | ||
| By hand and by prospicio | ||
| by hand | prospicio | |
|---|---|---|
| Auto-GL | −0.281 | −0.270 |
| Auto-Property | −0.002 | 0.003 |
| GL-Property | 0.788 | 0.784 |
The F^-1 step removes the few hundredths of error that
the permutations leave in the correlation of M. The results
differ because the permutations differ.
6. Other reference distributions and copulas
Section 8.2.3 replaces the normal scores with Student t scores, which
put more weight on joint extremes. iman_conover_by_hand
takes any scores. The monograph’s extreme example is t with 2 degrees of
freedom, with quantile (2u - 1) / sqrt(2 u (1 - u)). Count
the years in which GL and Property are both in their worst 1%, out of
10,000, under each reference:
n <- 10000
draws <- draw_matrix(copula_simulate(gaussian_copula(IDENTITY), grids, n, 4, keys = KEYS))
uu <- seq_len(n) / (n + 1)
SCORES <- list(normal = qnorm(uu), "t, 2 dof" = (2 * uu - 1) / sqrt(2 * uu * (1 - uu)))
for (name in names(SCORES)) {
Z <- iman_conover_by_hand(draws, TARGET, SCORES[[name]], 5)$out
r <- ranks(Z) - 1
worst <- (r[, 2] >= 0.99 * n) & (r[, 3] >= 0.99 * n)
cat(sprintf("%-9s GL-Property Spearman %.3f, years in both worst 1%%: %d\n", name,
pairs_of(Z)[[3]][2], sum(worst)))
}## normal GL-Property Spearman 0.787, years in both worst 1%: 34
## t, 2 dof GL-Property Spearman 0.714, years in both worst 1%: 68
## if independent, about 1
With t scores the joint extremes are about twice as frequent although the rank correlation is lower (the pinched scatter of Figure 8.3). The monograph warns that this flexibility is not a reason to use it.
Section 8.2.4 asks if a copula can be the reference. A multivariate
Archimedean copula has a single parameter and cannot match a correlation
matrix. Instead, simulate directly with a prospicio copula
(copula_simulate() with gaussian_copula(),
t_copula(), archimedean_copula(),
nested_archimedean_copula() or vine_copula()).
Nested Archimedean copulas and vines avoid the single parameter: a vine
uses one bivariate copula per edge, so each pair has its own strength
and tail.
7. Iman-Conover against the normal copula
The normal copula method (section 8.2.5) draws correlated normals and maps each to its unit’s distribution through the quantile function. With normal scores, Iman-Conover does the same to an existing sample and corrects the reference to the exact correlation. Both methods, 100 times on the same units:
normal_copula <- gaussian_copula(TARGET)
spread <- list("Iman-Conover" = numeric(), "normal copula" = numeric())
for (s in 0:99) {
draw <- copula_simulate(gaussian_copula(IDENTITY), grids, 1000, 3000 + s, keys = KEYS)
spread[[1]] <- c(spread[[1]], pairs_of(draw_matrix(iman_conover(draw, TARGET, s)))[[3]][2])
copula_draw <- copula_simulate(normal_copula, grids, 1000, 5000 + s, keys = KEYS)
spread[[2]] <- c(spread[[2]], pairs_of(draw_matrix(copula_draw))[[3]][2])
}
for (name in names(spread)) {
v <- spread[[name]]
cat(sprintf("%-14s GL-Property Spearman: mean %.3f, sd %.4f\n", name, mean(v),
sqrt(mean((v - mean(v))^2))))
}## Iman-Conover GL-Property Spearman: mean 0.787, sd 0.0052
## normal copula GL-Property Spearman: mean 0.787, sd 0.0142
ggplot(data.frame(rho = unlist(spread), method = rep(names(spread), each = 100)),
aes(rho, fill = method)) +
geom_histogram(breaks = seq(0.74, 0.83, length.out = 29), alpha = 0.6, position = "identity") +
geom_vline(xintercept = 6 / pi * asin(0.4), colour = "grey75", linewidth = 1) +
labs(x = "GL-Property Spearman correlation of one sample (grey line: 0.786)",
y = "samples out of 100", fill = NULL,
title = "Iman-Conover varies less than the normal copula") +
theme(legend.position = "top")Both methods centre on 0.786, the Gaussian rank correlation. Iman-Conover varies much less, because only the small gap between the rank and linear correlations of the normal reference remains. But the normal copula makes each year independently, so you can split, subset or extend its output freely. An Iman-Conover sample is made in one piece and needs the care of section 4.
8. Example 2: block Iman-Conover
A large correlation matrix estimated from data is mostly noise. Block Iman-Conover (section 8.2.6) uses the correlations that data can estimate: between lines within each region, and between the region totals.
Example 2 (section 8.2.7) has four regions, each with Auto (AL), GL
and Property (Pr). Each line has the model of Example 1, except that the
GL severity CV is 4. The first step computes the region totals with
independent lines, by FFT (Table 8.4). capital_portfolio()
on a named list of grids convolves them (Python’s
Portfolio.from_independent):
LINES <- list(AL = c(2000, 30, 2, 0.2), GL = c(5000, 50, 4, 0.3), Pr = c(10000, 100, 5, 0.1))
REGIONS <- list(North = c(4000, 2000, 2000), East = c(3000, 1000, 3000),
South = c(5000, 2000, 7000), West = c(5000, 2000, 2000))
BOOK_84 <- list(North = c(8000, 0.298, 16237), East = c(7000, 0.347, 15920),
South = c(14000, 0.266, 25737), West = c(9000, 0.276, 17331))
region_grids <- lapply(REGIONS, function(losses) {
stats::setNames(lapply(seq_along(LINES), function(k) {
do.call(unit, as.list(c(losses[k], LINES[[k]])))
}), names(LINES))
})
table_84 <- do.call(rbind, lapply(names(REGIONS), function(r) {
total <- capital_portfolio(region_grids[[r]])
xs <- total@totals
ps <- total@probs
m <- sum(xs * ps)
data.frame(region = r, mean = m, cv = sqrt(sum((xs - m)^2 * ps)) / m,
p99 = portfolio_assets(total, 0.99), book_mean = BOOK_84[[r]][1],
book_cv = BOOK_84[[r]][2], book_p99 = BOOK_84[[r]][3])
}))
gt(table_84, rowname_col = "region") |>
tab_header(title = "Table 8.4: region totals with independent lines", subtitle = "Annual loss") |>
cols_label(p99 = "99th pct", book_mean = "book mean", book_cv = "book cv",
book_p99 = "book 99th pct") |>
fmt_number(mean, decimals = 1, use_seps = FALSE) |>
fmt_number(c(cv, book_cv), decimals = 3) |>
fmt_number(c(p99, book_p99, book_mean), decimals = 0, use_seps = FALSE)| Table 8.4: region totals with independent lines | ||||||
| Annual loss | ||||||
| mean | cv | 99th pct | book mean | book cv | book 99th pct | |
|---|---|---|---|---|---|---|
| North | 8000.0 | 0.298 | 16236 | 8000 | 0.298 | 16237 |
| East | 7000.0 | 0.347 | 15920 | 7000 | 0.347 | 15920 |
| South | 14000.0 | 0.266 | 25737 | 14000 | 0.266 | 25737 |
| West | 9000.0 | 0.276 | 17330 | 9000 | 0.276 | 17331 |
The means and CVs agree to the printed digits. The 99th percentiles differ by at most 1.5 in 16,000 to 26,000, from the discretization step: a step of 0.5 gives 16,236.5, 15,920.5, 25,737 and 17,329.5.
The block method has three steps:
- Correlate the lines within each region by ordinary Iman-Conover. Here every region has the same 3 x 3 matrix (Table 8.6 (e)), but each region can have its own matrix.
- Stack the regions into one
predictive_distribution()with aregiondimension (join_predictive()). - Correlate the region totals: move the years of each region as whole rows, which keeps the structure within the region.
reorder_groups() does the last step:
INTRA <- rbind(c(1, 0.6, 0.2), c(0.6, 1, 0.4), c(0.2, 0.4, 1))
INTER <- rbind(c(1, 0.7, 0.2, 0), c(0.7, 1, 0.4, 0.2), c(0.2, 0.4, 1, 0.8), c(0, 0.2, 0.8, 1))
parts <- list()
for (k in seq_along(region_grids)) {
r <- names(region_grids)[k]
draw <- copula_simulate(gaussian_copula(IDENTITY), region_grids[[r]], 1000, 100 + k - 1,
keys = data.frame(line = names(LINES)))
parts[[r]] <- iman_conover(draw, INTRA, k - 1)
}
stacked <- join_predictive(parts, "region")
bic <- reorder_groups(stacked, "region", INTER, 7)
keys <- bic@keys
cat(bic@dims, "|", paste0(keys$region, "/", keys$line)[1:4], "...\n")## region line | North/AL North/GL North/Pr East/AL ...
The correlations between the region totals (Table 8.5):
B <- draw_matrix(bic)
totals <- sapply(1:4, function(k) rowSums(B[, (3 * k - 2):(3 * k)]))
achieved <- cor(totals)
BOOK_85 <- rbind(c(1, 2, 0.683), c(1, 3, 0.167), c(1, 4, -0.002), c(2, 3, 0.369),
c(2, 4, 0.197), c(3, 4, 0.799))
names_r <- names(REGIONS)
table_85 <- data.frame(
pair = paste0(names_r[BOOK_85[, 1]], "-", names_r[BOOK_85[, 2]]),
target = INTER[BOOK_85[, 1:2]], achieved = achieved[BOOK_85[, 1:2]], book = BOOK_85[, 3]
)
gt(table_85, rowname_col = "pair") |>
tab_header(title = "Table 8.5: correlation of the region totals",
subtitle = "Target, achieved and the monograph's sample") |>
fmt_number(target, decimals = 1) |>
fmt_number(c(achieved, book), decimals = 3)| Table 8.5: correlation of the region totals | |||
| Target, achieved and the monograph's sample | |||
| target | achieved | book | |
|---|---|---|---|
| North-East | 0.7 | 0.684 | 0.683 |
| North-South | 0.2 | 0.199 | 0.167 |
| North-West | 0.0 | 0.004 | −0.002 |
| East-South | 0.4 | 0.376 | 0.369 |
| East-West | 0.2 | 0.187 | 0.197 |
| South-West | 0.8 | 0.786 | 0.799 |
These are close to the target and to the monograph’s values. Within a region the lines keep the first step’s correlation, because the reordering moves the three lines together (Table 8.6):
C12 <- cor(B)
BOOK_86 <- list(North = c(0.579, 0.180, 0.332), East = c(0.544, 0.191, 0.318),
South = c(0.571, 0.202, 0.354), West = c(0.580, 0.176, 0.330))
table_86 <- do.call(rbind, lapply(1:4, function(k) {
block <- C12[(3 * k - 2):(3 * k), (3 * k - 2):(3 * k)]
data.frame(region = names_r[k], al_gl = block[1, 2], al_pr = block[1, 3], gl_pr = block[2, 3],
b_al_gl = BOOK_86[[k]][1], b_al_pr = BOOK_86[[k]][2], b_gl_pr = BOOK_86[[k]][3])
}))
gt(table_86, rowname_col = "region") |>
tab_header(title = "Table 8.6: correlation between lines within a region",
subtitle = "The target is 0.6, 0.2 and 0.4") |>
cols_label(al_gl = "AL-GL", al_pr = "AL-Pr", gl_pr = "GL-Pr", b_al_gl = "AL-GL, book",
b_al_pr = "AL-Pr, book", b_gl_pr = "GL-Pr, book") |>
fmt_number(c(al_gl, al_pr, gl_pr, b_al_gl, b_al_pr, b_gl_pr), decimals = 3)| Table 8.6: correlation between lines within a region | ||||||
| The target is 0.6, 0.2 and 0.4 | ||||||
| AL-GL | AL-Pr | GL-Pr | AL-GL, book | AL-Pr, book | GL-Pr, book | |
|---|---|---|---|---|---|---|
| North | 0.567 | 0.165 | 0.299 | 0.579 | 0.180 | 0.332 |
| East | 0.512 | 0.192 | 0.331 | 0.544 | 0.191 | 0.318 |
| South | 0.576 | 0.213 | 0.385 | 0.571 | 0.202 | 0.354 |
| West | 0.557 | 0.173 | 0.317 | 0.580 | 0.176 | 0.330 |
The full 12 x 12 matrix (Table 8.7) has the block structure of Figure 8.4. Here is the North AL row against the lines of the other regions:
BOOK_87 <- c(0.32, 0.29, 0.42, 0.07, 0.04, 0.12, -0.01, -0.07, 0.01)
table_87 <- data.frame(
line = as.vector(outer(names(LINES), names_r[-1], function(l, r) paste(r, l))),
mine = C12[1, 4:12], book = BOOK_87
)
gt(table_87, rowname_col = "line") |>
tab_header(title = "Table 8.7: North AL with the lines of the other regions",
subtitle = "Correlation of annual loss") |>
cols_label(mine = "prospicio") |>
fmt_number(c(mine, book), decimals = 2)| Table 8.7: North AL with the lines of the other regions | ||
| Correlation of annual loss | ||
| prospicio | book | |
|---|---|---|
| East AL | 0.40 | 0.32 |
| East GL | 0.33 | 0.29 |
| East Pr | 0.40 | 0.42 |
| South AL | 0.11 | 0.07 |
| South GL | 0.14 | 0.04 |
| South Pr | 0.12 | 0.12 |
| West AL | −0.04 | −0.01 |
| West GL | 0.01 | −0.07 |
| West Pr | 0.05 | 0.01 |
Lines in correlated regions are correlated across regions (North and East at 0.7); lines in uncorrelated regions (North and West) are not. Nine numbers set all 66 correlations.
9. Capital by layer, if you must
Section 8.3 returns to InsCo (ten equally likely years, three units)
and its Wang distortion calibrated to a 15% return with assets of 100.
The assets divide into layers between consecutive distinct totals. In a
layer, alpha is each unit’s expected share of the total in
the years that reach the layer, and beta shares the premium
the same way under the distorted probabilities. The layer’s margin is
its premium less its loss, and its capital is the part of its width that
premium does not fund. The cost of capital in a layer,
iota = (g(S) - S) / (1 - g(S)), is the same for every unit,
so a unit’s capital there is its margin divided by iota
(equation 8.5).
ROWS <- rbind(
c(15, 7, 0), c(15, 13, 0), c(5, 20, 11), c(7, 33, 0), c(13, 20, 7),
c(5, 27, 8), c(15, 16, 9), c(26, 19, 10), c(17, 8, 40), c(16, 20, 64)
)
colnames(ROWS) <- c("A", "B", "C")
insco <- capital_portfolio(ROWS)
wang <- calibrate_portfolio(insco, "wang", assets = 100, return_on_capital = 0.15)
layers <- function(port, g) {
# Per layer: bottom, width, S, g(S), iota, and per unit alpha S, beta g(S),
# margin and capital, all per unit of width.
x <- c(0, port@totals)
p <- port@probs
nl <- length(p)
share <- sapply(port@units, function(u) portfolio_kappa(port, u) / port@totals)
S <- c(1, pmax(0, 1 - cumsum(p)))
G <- sapply(S, function(s) distortion_g(g, s))
q <- G[1:nl] - G[2:(nl + 1)]
lapply(1:nl, function(k) {
idx <- k:nl
aS <- colSums(p[idx] * share[idx, , drop = FALSE])
bG <- colSums(q[idx] * share[idx, , drop = FALSE])
margin <- bG - aS
iota <- if (G[k] < 1) (G[k] - S[k]) / (1 - G[k]) else NA
capital <- if (is.na(iota)) rep(0, length(margin)) else margin / iota
list(x = x[k], dx = x[k + 1] - x[k], S = S[k], g = G[k], iota = iota, aS = aS, bG = bG,
margin = margin, capital = capital)
})
}
wang_layers <- do.call(rbind, lapply(layers(insco, wang), function(l) {
data.frame(layer = sprintf("%.0f to %.0f", l$x, l$x + l$dx), S = l$S, gS = l$g,
iota = l$iota, mA = l$margin[1], mB = l$margin[2], mC = l$margin[3],
qA = l$capital[1], qB = l$capital[2], qC = l$capital[3])
}))
gt(wang_layers, rowname_col = "layer") |>
tab_header(title = "Table 8.10: InsCo's layers under the Wang distortion",
subtitle = "Margin and capital per unit of layer width; the bottom layer has no iota") |>
tab_spanner("margin", c(mA, mB, mC)) |>
tab_spanner("capital", c(qA, qB, qC)) |>
cols_label(gS = "g(S)", mA = "A", mB = "B", mC = "C", qA = "A", qB = "B", qC = "C") |>
fmt_number(S, decimals = 1) |>
fmt_number(c(gS, iota, mA, mB, mC, qA, qB, qC), decimals = 3) |>
sub_missing(missing_text = "-")| Table 8.10: InsCo's layers under the Wang distortion | |||||||||
| Margin and capital per unit of layer width; the bottom layer has no iota | |||||||||
| S | g(S) | iota |
margin
|
capital
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| A | B | C | A | B | C | ||||
| 0 to 22 | 1.0 | 1.000 | - | −0.030 | −0.032 | 0.061 | 0.000 | 0.000 | 0.000 |
| 22 to 28 | 0.9 | 0.948 | 0.917 | 0.003 | −0.017 | 0.061 | 0.003 | −0.018 | 0.067 |
| 28 to 36 | 0.8 | 0.882 | 0.693 | 0.021 | −0.001 | 0.061 | 0.031 | −0.001 | 0.089 |
| 36 to 40 | 0.7 | 0.807 | 0.555 | 0.025 | 0.013 | 0.069 | 0.045 | 0.024 | 0.125 |
| 40 to 55 | 0.3 | 0.428 | 0.224 | 0.030 | 0.026 | 0.072 | 0.134 | 0.115 | 0.323 |
| 55 to 65 | 0.2 | 0.309 | 0.158 | 0.021 | 0.019 | 0.069 | 0.133 | 0.121 | 0.437 |
| 65 to 100 | 0.1 | 0.174 | 0.089 | 0.012 | 0.015 | 0.047 | 0.132 | 0.165 | 0.529 |
The first three columns are the margin of A, B and C and the last
three their capital. These values agree with Table 8.10 (and
g(S) with Table 8.9) to the printed digits. The code keeps
alpha S and beta g(S), the columns of Tables
8.8 and 8.9, for section 10. Every year pays for the bottom layer, so it
needs no capital and iota is undefined; its unit margins
sum to zero (cross-subsidies). Summing each column times the layer width
gives each unit’s margin and capital:
by_unit <- function(port, g) {
ls <- layers(port, g)
list(margin = Reduce(`+`, lapply(ls, function(l) l$dx * l$margin)),
capital = Reduce(`+`, lapply(ls, function(l) l$dx * l$capital)))
}
units_only <- function(priced) priced[priced$unit != "total", ]
bu <- by_unit(insco, wang)
lifted <- units_only(natural_price(insco, wang, assets = 100, allocation = "lifted"))
by_unit_table <- data.frame(
unit = c("A", "B", "C", "total"),
margin = c(bu$margin, sum(bu$margin)), book_margin = c(0.709, 0.337, 5.919, NA),
capital = c(bu$capital, sum(bu$capital)), book_capital = c(8.411, 8.691, 29.333, NA),
lifted = c(lifted$capital, sum(lifted$capital)),
ret = c(bu$margin / bu$capital, sum(bu$margin) / sum(bu$capital)),
book_ret = c(0.084, 0.039, 0.202, 0.150)
)
gt(by_unit_table, rowname_col = "unit") |>
tab_header(title = "Margin and capital by unit",
subtitle = "Wang distortion, assets of 100; lifted = natural_price(..., allocation = 'lifted')") |>
cols_label(book_margin = "book margin", book_capital = "book capital", lifted = "lifted capital",
ret = "return", book_ret = "book return") |>
fmt_number(c(margin, book_margin, capital, book_capital, lifted), decimals = 3, use_seps = FALSE) |>
fmt_percent(c(ret, book_ret), decimals = 1) |>
sub_missing(missing_text = "")| Margin and capital by unit | |||||||
| Wang distortion, assets of 100; lifted = natural_price(..., allocation = 'lifted') | |||||||
| margin | book margin | capital | book capital | lifted capital | return | book return | |
|---|---|---|---|---|---|---|---|
| A | 0.709 | 0.709 | 8.411 | 8.411 | 8.411 | 8.4% | 8.4% |
| B | 0.337 | 0.337 | 8.691 | 8.691 | 8.691 | 3.9% | 3.9% |
| C | 5.919 | 5.919 | 29.333 | 29.333 | 29.333 | 20.2% | 20.2% |
| total | 6.965 | 46.435 | 46.435 | 15.0% | 15.0% | ||
The returns differ by unit although every layer pays every unit the same return, because the units use different layers. Low layers are expensive but mostly funded by premium. High layers are cheap but mostly capital.
For the CCoC and the proportional hazard, the numbers (Table 8.11)
depend on the treatment of the bottom layer. Equation 8.5 as written
gives it no capital. prospicio, like aggregate 1.0.1,
converts its margins at the limit of iota as S
rises to 1: r = 0.15 for the CCoC and
(1 - rho) / rho for the proportional hazard. For the Wang,
dual power and TVaR distortions the limit is infinite and the
conventions agree. The monograph’s printed capital comes from an earlier
aggregate and matches neither convention:
BOOK_Q <- list(ccoc = c(4.874, 5.288, 36.273), ph = c(7.074, 6.565, 32.796))
table_811 <- do.call(rbind, lapply(c("ccoc", "ph"), function(family) {
d <- calibrate_portfolio(insco, family, assets = 100, return_on_capital = 0.15)
data.frame(case = paste0(family, ", ", c("A", "B", "C")), eq85 = by_unit(insco, d)$capital,
lifted = units_only(natural_price(insco, d, assets = 100, allocation = "lifted"))$capital,
book = BOOK_Q[[family]])
}))
gt(table_811, rowname_col = "case") |>
tab_header(title = "Table 8.11: capital by unit under two conventions",
subtitle = "Assets of 100, 15% return") |>
cols_label(eq85 = "equation 8.5", lifted = "prospicio") |>
fmt_number(c(eq85, lifted, book), decimals = 3, use_seps = FALSE)| Table 8.11: capital by unit under two conventions | |||
| Assets of 100, 15% return | |||
| equation 8.5 | prospicio | book | |
|---|---|---|---|
| ccoc, A | 5.419 | 2.261 | 4.874 |
| ccoc, B | 6.082 | 1.478 | 5.288 |
| ccoc, C | 34.934 | 42.696 | 36.273 |
| ph, A | 7.765 | 6.481 | 7.074 |
| ph, B | 7.694 | 5.597 | 6.565 |
| ph, C | 30.975 | 34.356 | 32.796 |
All three conventions sum to the same total capital of 46.435 and differ only in how they spread the bottom layer’s cross-subsidies. Under the prospicio convention every unit earns exactly 15% under the CCoC, which is what a constant cost of capital means (see section 5 of the chapter 9 guide). The monograph advises against any allocation of capital, and this result is one more reason.
10. Bodoff’s layer allocation
Section 8.4 compares the natural allocation with the allocation of
Bodoff (2007). Bodoff shares every layer of the assets by
alpha, not only its expected loss (Table 8.12):
bodoff <- bodoff_allocation(insco, assets = 100)
first <- layers(insco, wang)[[1]]
layer_share <- as.numeric(first$dx * first$aS / first$S)
bodoff_table <- data.frame(
unit = c("A", "B", "C", "total"),
assets = c(as.numeric(bodoff), sum(bodoff)), book = c(24.159, 29.756, 46.086, 100),
first = c(layer_share, NA), book_first = c(7.152, 9.694, 5.154, NA)
)
gt(bodoff_table, rowname_col = "unit") |>
tab_header(title = "Table 8.12: Bodoff's allocation of the assets",
subtitle = "Assets of 100; the first layer is 0 to 22") |>
cols_label(assets = "Bodoff assets", book = "book", first = "layer 0 to 22",
book_first = "layer 0 to 22, book") |>
fmt_number(c(assets, book, first, book_first), decimals = 3, use_seps = FALSE) |>
sub_missing(missing_text = "")| Table 8.12: Bodoff's allocation of the assets | ||||
| Assets of 100; the first layer is 0 to 22 | ||||
| Bodoff assets | book | layer 0 to 22 | layer 0 to 22, book | |
|---|---|---|---|---|
| A | 24.159 | 24.159 | 7.152 | 7.152 |
| B | 29.756 | 29.756 | 9.694 | 9.694 |
| C | 46.086 | 46.086 | 5.154 | 5.154 |
| total | 100.000 | 100.000 | ||
Bodoff’s allocation splits the assets but not the premium. The
monograph adds a CCoC: in each layer the premium is the expected loss
plus a margin of d = r / (1 + r) on the unfunded part,
alpha (S + d (1 - S)), the CCoC g(S) shared by
the loss shares:
ccoc <- distortion("ccoc", 0.15)
ls <- Filter(function(l) l$S > 0, layers(insco, ccoc))
bodoff_premium <- Reduce(`+`, lapply(ls, function(l) l$dx * l$g * l$aS / l$S))
natural <- units_only(natural_price(insco, ccoc, assets = 100))$premium
premiums <- data.frame(unit = c("A", "B", "C", "total"),
bodoff = c(as.numeric(bodoff_premium), sum(bodoff_premium)),
natural = c(natural, sum(natural)))
gt(premiums, rowname_col = "unit") |>
tab_header(title = "Premium by unit under the CCoC", subtitle = "Assets of 100") |>
cols_label(bodoff = "Bodoff with CCoC", natural = "natural CCoC") |>
fmt_number(c(bodoff, natural), decimals = 3, use_seps = FALSE)| Premium by unit under the CCoC | ||
| Assets of 100 | ||
| Bodoff with CCoC | natural CCoC | |
|---|---|---|
| A | 14.803 | 13.739 |
| B | 19.794 | 18.522 |
| C | 18.968 | 21.304 |
| total | 53.565 | 53.565 |
premiums <- data.frame(unit = rep(c("A", "B", "C"), 2),
method = rep(c("Bodoff with CCoC", "natural CCoC"), each = 3),
premium = c(bodoff_premium, natural))
ggplot(premiums, aes(unit, premium, fill = method)) +
geom_col(position = "dodge") +
labs(x = "unit", y = "premium (assets of 100)", fill = NULL,
title = "Premium by unit: the same total of 53.565") +
theme(legend.position = "top")The totals are the same, but the splits differ. Bodoff’s shares are the expected loss shares in every layer. The natural allocation uses the distorted shares, which move premium toward unit C, which dominates the years the distortion weights more. Another distortion gives other splits. So Bodoff’s method needs one more assumption before it can price anything.