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)
data
containing the ratios or claim amounts.data
containing the weights associated with ratios
."cm"
NULL
all levels are included.predict
and summary
methods; further arguments to
format
for the print.summary
method;
unused for 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:
NULL
.NULL
.data
containing the
portfolio classification structure.lm
.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.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 predict.lm
or else a vector of length one for
regression models with a single regressor.
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 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
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.
cm
is the unified front end for credibility models fitting.
Currently, the function supports hierarchical models with any number
of levels (with 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.
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.
subset
, formula
,
lm
, predict.lm
.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