Skip to contents

The prior of bayes_bf_normalised() estimated from other companies' triangles of the same line (decision 29 of docs/design/reserving-bayes.md, #604): the mean ultimate loss ratio, its spread between companies, its spread within a company, and a pooled development pattern with its spread.

Usage

industry_prior_fit(ptr)

industry_prior(
  triangles,
  column,
  premiums = NULL,
  exposure = NULL,
  min_developed = 0.5,
  min_companies = 10,
  subtract_process = FALSE
)

industry_prior_at_age(prior, age)

bayes_bf_industry(triangle, column, exposure, prior, ...)

bayes_bf_industry_one_year(triangle, column, exposure, prior, ...)

Arguments

ptr

An IndustryPriorFit pointer; used internally.

triangles

A list of cumulative triangles, one per company, or a triangle with one segment per company.

column

Name of the loss column.

premiums

With a list of triangles: a list of numeric vectors, each company's premium per origin.

exposure

With one triangle of segments: the name of its premium column.

min_developed

Least percent developed, by the industry pattern, of an origin that counts in the loss ratio moments.

min_companies

Number of companies below which the report warns.

subtract_process

Whether cv is the within spread less the process part.

prior

An industry_prior.

age

The last age, in months, of the triangle the cut prior is for.

triangle

A cumulative triangle of the program to fit.

...

The other arguments of bayes_bf_normalised() (or bayes_bf_normalised_one_year()).

Value

industry_prior() and industry_prior_at_age() an industry_prior; bayes_bf_industry() a bayes_bf_normalised_fit; bayes_bf_industry_one_year() a bayes_one_year_fit.

Details

Each company's chain ladder gives its pattern and each origin's ultimate loss ratio x[c, w] (ultimate over premium). Only origins at least min_developed developed by the industry pattern count. With n[c] such origins and xbar[c] their mean, the estimators are moments of a one-way random-effects decomposition on the natural scale:

  • apriori is the mean of the companies' xbar[c], and apriori_se its standard error;

  • within_cv is the origins' spread about their company's mean, as a cv: with ratio = sum((x - xbar[c])^2) / sum((n[c] - 1) * xbar[c]^2), within_cv^2 = ratio / (1 - ratio / nbar);

  • between_cv is the companies' spread about apriori less what the within spread adds to each mean of n[c] origins;

  • process_cv is the part of the within spread that the chain ladder's ODP scale explains (each company's Pearson scale over its ultimates).

cv is the prior's cv of an origin's expected ultimate given its company: within_cv, or with subtract_process = TRUE the within spread less the process part, sqrt(within_cv^2 - process_cv^2). On the Schedule P panel the process part is often larger than the within spread (the Pearson scale is inflated by the chain ladder's misfit), which leaves no structural spread, so the default keeps the whole within spread. common_cv is between_cv, the cv of bayes_bf_normalised()'s common multiplier: the program is one more company, so its level is uncertain by the companies' spread and its origins share that error.

The pattern prior is the mean and standard deviation over companies of each company's log share ratio at each age; a spread below 0.01 is set to 0.01 with a warning, and an age only one company reaches has the vague standard deviation 10. percent_developed is the percent developed at each age at the pattern prior's means and percent_developed_sd the standard deviation over the companies of their own percent developed there.

A panel of fewer than min_companies companies raises a warning in the report, whose other entries are n_companies, n_companies_used, n_origins_used, origins_used (per company), companies_by_age (the number of companies observed at each age after the first) and excluded (the companies left out and why).

  • industry_prior() estimates the prior from a list of triangles, one per company, with premiums a list of one numeric vector of premium per origin for each; or from one triangle with a segment per company (keys such as the NAIC code) and an exposure column.

  • industry_prior_at_age() cuts the prior to a triangle whose last age is age: apriori becomes the loss ratio developed to age, the pattern prior keeps the ages up to it and tail_factor is the factor from it to ultimate, which the user applies outside the model.

  • bayes_bf_industry() fits bayes_bf_normalised() with the prior's apriori, cv, common_cv and pattern prior; the other arguments are those of bayes_bf_normalised(). bayes_bf_industry_one_year() is its one-year view, as bayes_bf_normalised_one_year().

Errors: fewer than two companies with an origin developed far enough; a premium list whose length is not the number of triangles, or a company's premium that is not one per origin; a min_developed outside [0, 1]; a company whose chain ladder cannot be fitted.

This is Python's IndustryPrior.

Examples

company <- function(level) {
  long <- data.frame(year = rep(2018:2021, 4:1),
                     age = c(12, 24, 36, 48, 12, 24, 36, 12, 24, 12))
  share <- c(0.4, 0.3, 0.2, 0.1)[long$age / 12]
  long$paid <- ave(100 * level * share, long$year, FUN = cumsum)
  triangle(long, "year", "age", "paid")
}
prior <- industry_prior(lapply(c(0.6, 0.8, 0.7, 0.9), company), "paid",
                        premiums = rep(list(rep(100, 4)), 4), min_developed = 0)
c(prior@apriori, prior@between_cv, prior@within_cv)
#> [1] 7.500000e-01 1.721326e-01 1.336551e-16
prior@pattern@shares
#> [1] 0.4 0.3 0.2 0.1
prior@report$warnings
#> [1] "the companies' log share ratios at 24 months differ by an sd of 0.000e0: set to 0.01"                                                                        
#> [2] "the companies' log share ratios at 36 months differ by an sd of 0.000e0: set to 0.01"                                                                        
#> [3] "the companies' log share ratios at 48 months differ by an sd of 0.000e0: set to 0.01"                                                                        
#> [4] "only 4 companies: the between-company cv rests on 3 degrees of freedom (its relative standard error is about 41%); a prior from at least 10 is more reliable"
#> [5] "the origins' loss ratios hardly spread within a company (within cv 0.0000): cv set to 0.01"