Learn R Programming

ChainLadder (version 0.1.5-0)

glmReserve: GLM-based Reserving Model

Description

This function implements loss reserving models within the generalized linear model framework. It takes accident year and development lag as mean predictors in estimating the ultimate loss reserves, and provides both analytical formula and bootstrapping method to compute the associated prediction errors.

Usage

glmReserve(triangle, var.power = 1, link.power = 0, cum = TRUE, 
      mse.method = "formula", nsim = 1000, ...)

Arguments

triangle
A object of class triangle.
var.power
The index (p) of the power variance function $V(\mu)=\mu^p$. Default to p=1, which is the over-dispersed Poisson model. See tweedie.
link.power
The index of power link function. The default link.power=0 produces a log-link. See tweedie.
cum
A logical value indicating whether the input triangle is on the cumulative or the incremental scale. If TRUE, then triangle is assumed to be on the cumulative scale, and it will be converted to incremental losses internally befor
mse.method
A character indicating whether the prediction error should be computed analytically (mse.method="formula") or via bootstrapping (mse.method="bootstrap")
nsim
Number of simulations to be performed in the bootstrapping, with a default value of 1000.
...
Arguments to be passed onto the function glm such as contrasts or control. It is important that offset and weight should not be specified. Otherwise, an

Value

  • The output mainly includes components of a glm object, and is thus made into the class glm. As a result, all the methods available for a glm object such as resid, coef, fitted and so on can be directly applied. Besides the slots that a typical glm object possesses (see glm), several additional slots are also returned that are of specific interest to reserving analysis:
  • summaryA data frame containing the predicted loss reserve statistics. Similar to the summary statistics from MackChainLadder.
  • TriangleThe input triangle.
  • FullTriangleThe completed triangle, where empty cells in the original triangle are filled with model predictions.
  • scaleScale parameter calculated using Pearson residuals.

Details

This function takes an insurance loss triangle, converts it to incremental losses internally if necessary, transforms it to the long format (see as.data.frame) and fits the resulting loss data with a generalized linear model where the mean structure includes both the accident year and the development lag effects. The distributions allowed are the exponential family that admits a power variance function, that is, $V(\mu)=\mu^p$. This subclass of distributions is usually called the Tweedie distribution and includes many commonly used distributions as special cases. This function does not allow the user to specify the GLM options through the usual family argument, but instead, it uses the tweedie family internally and takes two arguments var.power and link.power through which the user still has full control of the distribution forms and link functions, respectively. The argument var.power determines which specific distribution is to be used, and link.power determines the form of the link function. See details in tweedie. Also, the function allows certain measures of exposures to be used in an offset term in the underlying GLM. To do this, the user should not use the usual offset argument in glm. Instead, one specifies the exposure measure for each accident year through the exposure attribute of triangle. Make sure that these exposures are in the orignal scale (no log transformations for example), and they are in the order consistent with the accident years. If the exposure attribute is not NULL, the glmReserve function will use these exposures, link-function-transformed, in the offset term of the GLM. For example, if the link function is log, then the log of the exposure is used as the offset, not the original exposure. See the examples below. Moreover, the user MUST NOT supply the typical offset or weight as arguments in the list of additonal arguments .... offset should be specified as above, while weight is not implemented (due to prediction reasons).

Two methods are available to assess the prediction error of the estimated loss reserves. One is using the analytical formula (mse.method="formula") derived from first-order Taylor approximation. The other is using bootstrapping (mse.method="bootstrap") that reconstructs the triangle nsim times by resampling with replacement from the GLM (Pearson) residuals. Each time a new triangle is formed, GLM is fitted and corresponding loss reserves are generated. Then the nsim sets of reserves are used to compute the (sample) estimation variance, which, when adjusted by the lost degree of freedoms and combined with the process variance, will yield the prediction variance. See England and Verrall (1999) for details.

References

England P. and Verrall R. (1999). Analytic and bootstrap estimates of prediction errors in claims reserving. Insurance: Mathematics and Economics, 25, 281-293.

See Also

See also glm, tweedie and MackChainLadder.

Examples

Run this code
data(GenIns)

# over-dispersed Poisson: reproduce ChainLadder estimates
fit1 <- glmReserve(GenIns)
fit1$summary

# plot of standardized residuals
sr <- resid(fit1)/sqrt(fit1$scale)
plot(fitted(fit1),sr)
# qq plot of residuals
qqnorm(sr)
qqline(sr)

# Gamma GLM:
fit2 <- glmReserve(GenIns,var.power=2)
fit2$summary

# plot of standardized residuals
sr <- resid(fit2)/sqrt(fit2$scale)
plot(fitted(fit2),sr)
# qq plot of residuals
qqnorm(sr)
qqline(sr)

# Now suppose we have an exposure measure
# we can put it as an offset term in the model
# to do this, use the "exposure" attribute of the 'triangle'
expos <- (7 + 1:10*0.4)*1000000
GenIns2 <- GenIns
attr(GenIns2,"exposure") <- expos
fit3 <- glmReserve(GenIns2)
fit3$summary 

# use bootstrapping to compute prediction error
set.seed(11)
fit4 <- glmReserve(GenIns,mse.method="bootstrap")
fit4$summary

Run the code above in your browser using DataLab