cm(formula, data, ratios, weights, subset, TOL = 1E-6, echo = FALSE)## S3 method for class 'cm':
print(x, \dots)
## S3 method for class 'cm':
predict(object, levels = NULL, \dots)
## S3 method for class 'cm':
summary(object, levels = NULL, \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 the following
components:
data containing the portfolio
structure.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 always a list the
same length as levels or the number of levels in
formula.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. At the moment, cm can only handle hierarchical
interactions, with any given number of levels. The B�hlmann-Straub
model is a special case with only one level. 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 +
...$.
Arguments ratios, weights and subset are used
like arguments select, select and subset 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.
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
the credibility is given to the collective premium.) The linearly
sufficient statistic one 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 + B/W},$$
where $w_i$ is the weight of the node used in the linearly
sufficient statistic, $B$ is the average between node variance and
$W$ is the average within node variance.
Estimators of the variance structure parameters are pseudo-estimators of the form $$\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.
bstraub for faster calculations of simple B�hlmann or
B�hlmann-Straub models; subset,
formula.data(hachemeister)
## Simple B�hlmann-Straub model
cm(~state, hachemeister,
ratios = ratio.1:ratio.12, weights = weight.1:weight.12)
bstraub(hachemeister[, 2:13], hachemeister[, 14:25]) # same, faster
## 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)
fit # print method
summary(fit) # more details
predict(fit) # credibility premiumsRun the code above in your browser using DataLab