One-year view of the Bayesian Bornhuetter-Ferguson
bayes_bf_normalised_one_year.RdThe claims development result (CDR) over the coming year of
bayes_bf_normalised(), by Pareto smoothed importance sampling of the posterior
(decisions 16 and 17 of docs/design/reserving-bayes.md), exactly as
bayes_odp_one_year() with this model's means exp(alpha[w]) * p[d].
bayes_bf_normalised_one_year() fits the posterior and the lifetime reserves as
bayes_bf_normalised() does with the same settings. Each simulation draws the
year's increments from a posterior draw with process error, reweights
every posterior draw by the year's quasi likelihood (the scale, the
priors and the prior ultimates unchanged), and takes each origin's CDR as
its posterior mean reserve at the opening less its payment in the year
and its weighted posterior mean reserve after it; a simulation whose
Pareto k is above k_threshold is moment-matched and, if that cannot
rescue it, refitted with NUTS, as refit says.
Usage
bayes_bf_normalised_one_year(
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,
k_threshold = 0.7,
refit = c("moment_match_then_refit", "refit_flagged", "reweight_only", "refit_all"),
max_refits = NULL,
one_year_sims = NULL,
common_cv = 0,
pattern_prior = NULL
)Arguments
- 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.
- k_threshold
The Pareto k above which a simulation's importance weights are not trusted (the threshold of Vehtari et al. 2024 for a few thousand draws).
- refit
What happens to a flagged simulation:
"moment_match_then_refit"(the default) moves the posterior draws by affine maps to the moments the weights estimate (moment matching, asloo::loo_moment_match()), refitting only a simulation whose k stays abovek_threshold;"refit_flagged"refits it with NUTS;"reweight_only"reweights it anyway (fast, biased where k is high);"refit_all"refits every simulation, to check the reweighting.- max_refits
The most simulations refitted with NUTS: the first this many due for a refit, in simulation order; the others are reweighted as they are (as unreliable as their k says), listed in
unrefittedand warned about.NULL(the default) refits every one,0none. In the_segmentsfunctions it applies to each segment, so k segments refit at most k times this many.- one_year_sims
The number of one-year simulations, or
NULL(the default) for the model's one-year default:n_simsforbayes_odp_one_year()andbayes_bf_one_year(), andn_simscapped at 2,000 formeyers_one_year(). The lifetime reserves keepn_sims. A smaller count gives the first simulations of a larger one.- 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
The prior's strength moves the view between two limits. A flat prior
(cv = Inf) is the Bayesian chain ladder: on GenIns its CDR's
standard deviation agrees with bayes_odp_one_year()'s within Monte
Carlo error. A tighter prior holds each origin's ultimate more firmly,
so less of the year's information goes to the ultimates and the view
narrows (on GenIns with apriori = 0.5, the total's standard deviation
at cv = 0.2 is about 58% of the flat prior's, at cv = 0.05 about
32%). There is no view over segments: bayes_bf_normalised() fits one
segment.
Failed MCMC diagnostics of the fit raise one warning() listing them,
and refits that failed theirs raise another. The result is a
bayes_one_year_fit whose fit is the bayes_bf_normalised_fit; its
as.data.frame() adds each origin's exposure, prior_ultimate and
opening_ulr (the opening ultimate over the exposure).
Errors: as bayes_bf_normalised(); a k_threshold that is NaN.
This is Python's BayesBfNormalised.one_year().
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"))
view <- bayes_bf_normalised_one_year(tri, "paid", "premium", apriori = 0.85, cv = 0.1,
n_sims = 1000, seed = 1, refit = "reweight_only")
view@fit@prior_ultimate
#> [1] 170 187 204 221
c(one_year = sqrt(variance(view@cdr)), lifetime = sqrt(variance(view@fit@reserves)))
#> one_year lifetime
#> 12.81755 14.39273
as.data.frame(view)
#> origin latest opening_ultimate opening_reserve exposure prior_ultimate
#> 1 2018 170 170.0000 0.000000 200 170
#> 2 2019 180 185.6154 5.615427 220 187
#> 3 2020 175 195.0063 20.006349 240 204
#> 4 2021 130 217.7157 87.715696 260 221
#> opening_ulr cdr_mean cdr_std_dev
#> 1 0.8500000 0.00000000 0.000000
#> 2 0.8437065 -0.04836275 3.004957
#> 3 0.8125265 -0.13015253 4.667718
#> 4 0.8373681 -0.31891877 9.901753