Skip to contents

Fit a credibility model using the Buhlmann-Straub model.

Usage

buhlmannStraub(
  Yijt,
  wijt,
  MLFj,
  data,
  muHat = NULL,
  type = c("additive", "multiplicative"),
  returnData = FALSE
)

Arguments

Yijt

variable name of the response variable.

wijt

variable name of the exposure weight.

MLFj

variable name of the risk class or cluster.

data

an object that is coercible by as.data.table, containing the variables in the model.

muHat

estimate for the collective premium (portfolio mean). Default is NULL and in this case, the credibility-weighted estimator is used.

type

specifies whether the additive or multiplicative formulation of the credibility model is used. Default is additive.

returnData

Logical, indicates whether the data object has to be returned. Default is FALSE.

Value

An object of type buhlmannStraub with the following slots:

call

the matched call

type

Whether additive or multiplicative credibility model is used.

Variances

The estimated variance components. Sigma is the estimated within-group variance, and Tau is the estimate of the between-group variance.

Means

The estimated averages at the portfolio level (collective premium \(\hat{\mu}\)) and at the cluster level (weighted average \(\bar{Y}_j\)).

Weights

The total weights \(w_j\) for each cluster.

Credibility

The credibility factors \(z_j\) for each cluster.

Premiums

The collective premium \(\hat{\mu}\) and individual premiums \(\hat{V}_j\) for each cluster.

Relativity

The estimated random effects \(\hat{U}_j\) of each cluster.

RawResults

Object of type data.table with all intermediate results.

fitted.values

the fitted mean values, resulting from the model fit.

References

Buhlmann, H. and Straub, E. (1970). Glaubwurdigkeit fur Schadensatze. Mitteilungen der Vereinigung schweizerischer Versicherungsmathematiker, 70, 111-133.

Buhlmann, H. and Gisler, A. (2005). A Course in Credibility Theory and its Applications. Springer.

Examples

library(actuar)
#> 
#> Attaching package: 'actuar'
#> The following objects are masked from 'package:statmod':
#> 
#>     dinvgauss, pinvgauss, qinvgauss, rinvgauss
#> The following objects are masked from 'package:stats':
#> 
#>     sd, var
#> The following object is masked from 'package:grDevices':
#> 
#>     cm
library(actuaRE)
data("hachemeister", package = "actuar")
# Prepare data
X = as.data.frame(hachemeister)
Df = reshape(X, idvar = "state",
             varying = list(paste0("ratio.", 1:12), paste0("weight.", 1:12)),
             direction = "long")
# Fit Buhlmann-Straub model
fitBS = buhlmannStraub(ratio.1, weight.1, state, Df)
summary(fitBS)
#> Call:
#> buhlmannStraub(Yijt = ratio.1, wijt = weight.1, MLFj = state, 
#>     data = Df)
#> 
#> 
#> Additive Buhlmann-Straub credibility model
#> 
#> Estimated variance parameters:
#>   Sigma (within-group variance): 139120026 
#>   Tau (between-group variance): 89638.73 
#> Unique number of state: 5 
#> 
#> Estimates at the state level:
#> 
#> Key: <state>
#>    state   Yj_Bar     wj    nj        zj       Vj         Uj
#>    <num>    <num>  <num> <int>     <num>    <num>      <num>
#> 1:     1 2060.921 100155    12 0.9847404 2055.165  371.45191
#> 2:     2 1511.224  19895    12 0.9276352 1523.706 -160.00716
#> 3:     3 1805.843  13735    12 0.8984754 1793.444  109.73017
#> 4:     4 1352.976   4152    12 0.7279092 1442.967 -240.74689
#> 5:     5 1599.829  36110    12 0.9587911 1603.285  -80.42803
# Compare with actuar package
fit <- cm(~state, hachemeister, ratios = ratio.1:ratio.12,
          weights = weight.1:weight.12)
summary(fit)
#> Call:
#> cm(formula = ~state, data = hachemeister, ratios = ratio.1:ratio.12, 
#>     weights = weight.1:weight.12)
#> 
#> Structure Parameters Estimators
#> 
#>   Collective premium: 1683.713 
#> 
#>   Between state variance: 89638.73 
#>   Within state variance: 139120026 
#> 
#> Detailed premiums
#> 
#>     state Indiv. mean Weight Cred. factor Cred. premium
#>     1     2060.921    100155 0.9847404    2055.165     
#>     2     1511.224     19895 0.9276352    1523.706     
#>     3     1805.843     13735 0.8984754    1793.444     
#>     4     1352.976      4152 0.7279092    1442.967     
#>     5     1599.829     36110 0.9587911    1603.285     
#>