Bayesian Bornhuetter-Ferguson with a normalised pattern
bayes_bf_normalised_fit.RdThe Bayesian Bornhuetter-Ferguson whose prior sits on the ultimate: the
over-dispersed Poisson model of a cumulative triangle's incremental
values with mean U[w] * p[d], the origin's expected ultimate U[w]
times the share p[d] of it that falls at age d, the shares summing
to 1 (p[d] = exp(beta[d]) / sum(exp(beta)) with beta[1] = 0). The
informative gamma prior is on U[w] itself, with mean apriori times
the origin's exposure and coefficient of variation cv, so apriori is
the expected ultimate loss ratio and cv says how firmly it is held, as
in the classical bornhuetter_ferguson(). The shares have a vague normal
prior on their log ratios to the first age's, and the chain ladder's
Pearson scale phi (the scale of odp_bootstrap()) is plugged in. The
posterior is sampled with NUTS, and each draw projects the future cells
up to the oldest observed age (no tail) with the process error of
process, as bayes_odp() does.
Usage
bayes_bf_normalised_fit(ptr)
bayes_bf_normalised(
triangle,
column,
exposure,
apriori = 1,
cv = 0.1,
development_sd = 10,
process = c("gamma", "none"),
chains = 4,
tune = 1000,
draws = 1000,
n_sims = 10000,
seed = 0,
target_accept = 0.95,
max_depth = 10,
common_cv = 0,
pattern_prior = NULL
)Arguments
- ptr
A
BayesBfNormalisedFitpointer; used internally.- triangle
A cumulative triangle with one segment, every origin observed from the first age up to its latest.
- column
Name of the loss column to fit.
- exposure
Name of the exposure column; each origin's latest observed value is its exposure, as for
bornhuetter_ferguson().- apriori
Prior mean of each origin's expected ultimate
U[w]per unit of exposure: the expected ultimate loss ratio.- cv
Coefficient of variation of the gamma prior on each
U[w](shape1 / cv^2);Inffor a flat prior.- development_sd
Standard deviation of the normal prior on each
beta[d](the log ratio of the share at agedto the first age's), centred on 0; ignored with apattern_prior.- process
Process error on each simulated future increment:
"gamma"(meanmu, variancephi * mu) or"none"for parameter error only.- chains, tune, draws
NUTS chains, warm-up draws per chain and kept draws per chain.
- n_sims
Number of predictive simulations, independent of the number of posterior draws; positive.
- seed
Seed of the chains and of the simulations, a non-negative whole number.
- target_accept
Target mean acceptance rate of the step-size adaptation.
- max_depth
Largest NUTS tree depth.
- pattern_prior
A
pattern_prior()on the triangle's ages, a normal prior on eachbeta[d]with its own mean and standard deviation in place ofdevelopment_sd(decision 29;industry_prior()estimates one), orNULL.
Details
bayes_bf() (England, Verrall and Wuthrich's Model 3.1) instead leaves
the pattern unnormalised and puts its prior on mu[w], which is not the
ultimate: there the level of apriori is cancelled by the pattern and
barely moves the reserve. Use this model when the a-priori loss ratio is
a judgment about the ultimate; use bayes_bf() to match England, Verrall
and Wuthrich's published results.
The prior's strength moves the reserve between two limits. With
cv = Inf (a flat prior on log U[w]) the model is the Bayesian chain
ladder, and the reserves agree with bayes_odp()'s within Monte Carlo
error. As cv falls to 0, U[w] is fixed at the prior ultimate m[w]
and the shares are S[d] / (M[d] + lambda) (S[d] the observed
increments of column d, M[d] the prior ultimates of the origins
observed there, lambda such that they sum to 1). When the prior
ultimates are the chain ladder's, lambda is 0 and the reserve is
exactly the classical bornhuetter_ferguson() reserve
(1 - 1 / cdf) * m[w]; otherwise the shares move with the ultimates,
where the classical method keeps the chain ladder's pattern.
Every development column's observed increments must sum to more than
zero, and every origin's to more than -phi / cv^2; negative cells are
allowed. The error names the age or origin, its number of observed
cells, their sum and the remedies. A column that sums to zero or less
has no log-linear mean, since every mean is an ultimate times a positive
share; chain_ladder() accepts the same triangle, and bayes_odp() and
bayes_bf() refuse it too. To drop a sparse last age, keep the ages
before it with max_age() (max_age(tri, 108) for a last age of 120
months) and carry the movement left out as a tail outside the model. A
falling first age is dropped by rebuilding the triangle without its
rows (triangle() on the rows of as.data.frame(tri) at the other
ages); a falling middle age has no remedy in this model. For an origin,
a finite cv below
the bound the error prints makes its posterior proper. One seed
replays a fit exactly, whatever the number of threads. Failed MCMC
diagnostics (R-hat above 1.01, bulk or tail ESS below 100 per chain, any
divergent transition) do not fail the fit: bayes_bf_normalised()
raises one warning() listing them, and they stay in the
fit's diagnostics.
Properties of the fit: as bayes_odp_fit's (chain_ladder, origins,
development, scale, reserves, diagnostics, summary, draws),
with exposure and prior_ultimate (apriori * exposure, the prior
mean of the expected ultimate) per origin, pattern (the posterior
mean of each age's share of the ultimate) and expected_ultimate (the
posterior mean of each origin's U[w]);
the posterior draws are of alpha[1], ..., alpha[n] (log U[w])
and beta[2], ..., beta[m] (the log ratios of the shares to the first
age's). bayes_loo() gives the
PSIS-LOO of the observed increments, comparable with bayes_odp()'s on
the same column. as.data.frame(), totals_frame(),
development_frame() and segment() work as for bayes_odp(), with the
exposure, prior_ultimate and ulr (the chain ladder's ultimate over
the exposure, a loss ratio only when the exposure is premium), and after
the mean and std_dev the ultimate_mean (latest plus mean, the
posterior mean ultimate) and ulr_mean (ultimate_mean over the
exposure).
Errors: as bayes_odp(); if an origin has no observed, finite, positive
exposure; if apriori is not positive and finite, cv is not positive
or development_sd is not positive and finite; if a development
column's increments do not sum to more than zero; or if an origin's sum
to -phi / cv^2 or less.
Examples
long <- data.frame(year = rep(2018:2021, 4:1),
age = c(12, 24, 36, 48, 12, 24, 36, 12, 24, 12),
paid = c(100, 150, 165, 170, 110, 170, 180, 120, 175, 130),
premium = rep(c(200, 220, 240, 260), 4:1))
tri <- triangle(long, "year", "age", c("paid", "premium"))
fit <- bayes_bf_normalised(tri, "paid", "premium", apriori = 0.85, cv = 0.1, n_sims = 2000,
seed = 1)
fit@prior_ultimate
#> [1] 170 187 204 221
fit@pattern
#> [1] 0.59886889 0.30000443 0.07104912 0.03007756
mean(fit@reserves)
#> [1] 113.5162
quantile(fit@reserves, 0.995)
#> [1] 152.9674