Learn R Programming

actuar (version 0.9-4)

cm: Hierarchical Credibility Models

Description

Fit a credibility model in the formulation of variance components as described in Dannenburg, Kaas and Goovaerts (1996). Models supported are part of a generalized hierarchical credibility theory as introduced in Dannenburg (1995).

Usage

cm(formula, data, ratios, weights, subset, xreg = NULL,
   method = c("Buhlmann-Gisler", "Ohlsson", "iterative"),
   tol = sqrt(.Machine$double.eps), maxit = 100, echo = FALSE)

## S3 method for class 'cm': print(x, \dots)

## S3 method for class 'cm': predict(object, levels = NULL, newdata, \dots)

## S3 method for class 'cm': summary(object, levels = NULL, newdata, \dots)

## S3 method for class 'summary.cm': print(x, \dots)

Arguments

formula
a symbolic description of the model to be fit. The details of model specification are given below.
data
a matrix or a data frame containing the portfolio structure, the ratios or claim amounts and their associated weights, if any.
ratios
expression indicating the columns of data containing the ratios or claim amounts.
weights
expression indicating the columns of data containing the weights associated with ratios.
subset
an optional logical expression indicating a subset of observations to be used in the modeling process. All observations are included by default.
xreg
an optional vector or matrix of regressors.
method
estimation method for the variance components of the model; see details below.
tol
tolerance level for the stopping criteria for iterative estimation method.
maxit
maximum number of iterations in iterative estimation method.
echo
logical; whether to echo the iterative procedure or not
x, object
an object of class "cm"
levels
character vector indicating the levels to predict or to include in the summary; if NULL all levels are included.
newdata
vector or data frame containing the variables used to predict credibility regression models.
...
additional attributes to attach to the result for the predict and summary methods; further arguments to format for the print.summary method; unused for

Value

  • Function cm computes the structure parameters estimators of the model specified in formula. The value returned is an object of class cm.

    An object of class "cm" is a list with at least the following components:

  • meansa list containing, for each level, the vector of linearly sufficient statistics.
  • weightsa list containing, for each level, the vector of total weights.
  • unbiaseda vector containing the unbiased variance components estimators, or NULL.
  • iterativea vector containing the iterative variance components estimators, or NULL.
  • credfor multi-level hierarchical models: a list containing, the vector of credibility factors for each level. For one-level models: an array or vector of credibility factors.
  • nodesa list containing, for each level, the vector of the number of nodes in the level.
  • classificationthe columns of data containing the portfolio classification structure.
  • orderinga list containing, for each level, the affiliation of a node to the node of the level above.
  • Regression fits have in addition the following component:
  • adj.modelsa list containing, for each node, the credibility adjusted regression model as obtained with lm.
  • The method of predict for objects of class "cm" computes the credibility premiums for the nodes of every level included in argument levels (all by default). Result is a list the same length as levels or the number of levels in formula, or an atomic vector for one-level models.

Hierarchical models

The credibility premium at one level is a convex combination between the linearly sufficient statistic of a node and the credibility premium of the level above. (For the first level, the complement of credibility is given to the collective premium.) The linearly sufficient statistic of a node is the credibility weighted average of the data of the node, except at the last level, where natural weights are used. The credibility factor of node $i$ is equal to $$\frac{w_i}{w_i + a/b},$$ where $w_i$ is the weight of the node used in the linearly sufficient statistic, $a$ is the average within node variance and $b$ is the average between node variance.

Regression models

The credibility premium of node $i$ is equal to $$y^\prime b_i^a,$$ where $y$ is a matrix created from newdata and $b_i^a$ is the vector of credibility adjusted regression coefficients of node $i$. The latter is given by $$b_i^a = Z_i b_i + (I - Z_I) m,$$ where $b_i$ is the vector of regression coefficients based on data of node $i$ only, $m$ is the vector of collective regression coefficients, $Z_i$ is the credibility matrix and $I$ is the identity matrix. The credibility matrix of node $i$ is equal to $$\frac{W_i}{W_i + s^2/A},$$ where $W_i$ is the unscaled regression covariance matrix of the node, $s^2$ is the average within node variance and $A$ is the within node covariance matrix.

If argument xreg is a matrix, it is strongly recommended to name the columns.

Argument newdata provides the future value of the regressors for prediction purposes. It is either as defined in predict.lm or else a vector of length one for regression models with a single regressor.

Variance components estimation

For hierarchical models, two sets of estimators of the variance components (other than the within node variance) are available: unbiased estimators and iterative estimators.

Unbiased estimators are based on sums of squares of the form $$B_i = \sum_j w_{ij} (X_{ij} - \bar{X}_i)^2 - (J - 1) a$$ and constants of the form $$c_i = w_i - \sum_j \frac{w_{ij}^2}{w_i},$$ where $X_{ij}$ is the linearly sufficient statistic of level $(ij)$; $\bar{X_{i}}$ is the weighted average of the latter using weights $w_{ij}$; $w_i = \sum_j w_{ij}$; $J$ is the effective number of nodes at level $(ij)$; $a$ is the within variance of this level. Weights $w_{ij}$ are the natural weights at the lowest level, the sum of the natural weights the next level and the sum of the credibility factors for all upper levels.

The B�hlmann{Buhlmann}-Gisler estimators (method = "Buhlmann-Gisler") are given by $$b = \frac{1}{I} \sum_i \max \left( \frac{B_i}{c_i}, 0 \right),$$ that is the average of the per node variance estimators truncated at 0.

The Ohlsson estimators (method = "Ohlsson") are given by $$b = \frac{\sum_i B_i}{\sum_i c_i},$$ that is the weighted average of the per node variance estimators without any truncation. Note that negative estimates will be truncated to zero for credibility factor calculations.

In the B�hlmann{Buhlmann}-Straub model, these estimators are equivalent.

Iterative estimators method = "iterative" are pseudo-estimators of the form $$b = \frac{1}{d} \sum_i w_i (X_i - \bar{X})^2,$$ where $X_i$ is the linearly sufficient statistic of one level, $\bar{X}$ is the linearly sufficient statistic of the level above and $d$ is the effective number of nodes at one level minus the effective number of nodes of the level above. The Ohlsson estimators are used as starting values.

For regression models, only iterative estimators are available, hence argument method is not taken into account.

Details

cm is the unified front end for credibility models fitting. Currently, the function supports hierarchical models with any number of levels (with B�hlmann{Buhlmann} and B�hlmann{Buhlmann}-Straub models as special cases) and the regression model of Hachemeister. Usage of cm is similar to lm.

The formula argument symbolically describes the structure of the portfolio in the form $~ terms$. Each term is an interaction between risk factors contributing to the total variance of the portfolio data. Terms are separated by + operators and interactions within each term by :. For a portfolio divided first into sectors, then units and finally contracts, formula would be $~ sector + sector:unit + sector:unit:contract$, where sector, unit and contract are column names in data. In general, the formula should be of the form $~ a + a:b + a:b:c + a:b:c:d + ...$.

If argument xreg is not NULL, the regression model of Hachemeister will be fit to data. Hierarchical classification structures are not supported with this model. Regression models fitting is currently less robust than hierarchical models fitting. In particular, one should avoid nodes with no data.

Arguments ratios, weights and subset are used like arguments select, select and subset, respectively, of function subset.

Data does not have to be sorted by level. Nodes with no data (complete lines of NA except for the portfolio structure) are allowed, with the restriction mentioned above.

References

B�hlmann{Buhlmann}, H. and Gisler, A. (2005), A course in credibility theory and its applications, Springer.

Goulet, V. (1998), Principles and Application of Credibility Theory, Journal of Actuarial Practice 6, ISSN 1064-6647.

Goovaerts, M. J. and Hoogstad, W. J. (1987), Credibility Theory, Surveys of Actuarial Studies, NO.4, Nationale-Nederlanden N.V.

See Also

subset, formula, lm, predict.lm.

Examples

Run this code
data(hachemeister)

## Buhlmann-Straub model
fit <- cm(~state, hachemeister,
          ratios = ratio.1:ratio.12, weights = weight.1:weight.12)
fit				# print method
predict(fit)			# credibility premiums
summary(fit)			# more details

## Two-level hierarchical model. Notice that data does not have
## to be sorted by level
X <- cbind(unit = c(1, 2, 1, 2, 2), hachemeister)
fit <- cm(~unit + unit:state, X, ratio.1:ratio.12, weight.1:weight.12)
predict(fit)
predict(fit, levels = "unit")	# unit credibility premiums only
summary(fit)
summary(fit, levels = "unit")	# unit summaries only

## Regression model
fit <- cm(~state, hachemeister, xreg = 12:1,
          ratios = ratio.1:ratio.12, weights = weight.1:weight.12)
fit
predict(fit, newdata = 0)	# future value of regressor
summary(fit, newdata = 0)

Run the code above in your browser using DataLab