Title: | Statistical Methods and Models for Claims Reserving in General Insurance |
---|---|
Description: | Various statistical methods and models which are typically used for the estimation of outstanding claims reserves in general insurance, including those to estimate the claims development result as required under Solvency II. |
Authors: | Markus Gesmann [aut, cre], Daniel Murphy [aut], Yanwei (Wayne) Zhang [aut], Alessandro Carrato [aut], Giuseppe Crupi [ctb], Christophe Dutang [ctb], Arnaud Lacoume [ctb], Arthur Charpentier [ctb], Mario Wuthrich [aut], Fabio Concina [aut], Eric Dal Moro [aut], Yuriy Krvavych [ctb], Vincent Goulet [ctb], Marco De Virgilis [ctb], Marco Spina [ctb] |
Maintainer: | Markus Gesmann <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.2.20 |
Built: | 2024-11-01 11:26:08 UTC |
Source: | https://github.com/mages/chainladder |
ChainLadder provides methods and models which are typically used in insurance claims reserving.
The package grew out of presentations given at the Stochastic Reserving Seminar at the Institute of Actuaries in 2007 and 2008 and followed by talks at CAS meetings in 2008 and 2010.
More information is available on the project web site https://github.com/mages/ChainLadder
For more financial packages see also CRAN Task View 'Emperical Finance' at https://CRAN.R-project.org/view=Finance.
Maintainer: Markus Gesmann <[email protected]>
Thomas Mack. Distribution-free calculation of the standard error of chain ladder reserve estimates. Astin Bulletin. Vol. 23. No 2. 1993. pp.213:225
Thomas Mack. The standard error of chain ladder reserve estimates: Recursive calculation and inclusion of a tail factor. Astin Bulletin. Vol. 29. No 2. 1999. pp.361:366
Gerhard Quarg and Thomas Mack. Munich Chain Ladder. Blatter DGVFM 26. Munich. 2004.
England, PD and Verrall, RJ. Stochastic Claims Reserving in General Insurance (with discussion). British Actuarial Journal 8. III. 2002
B. Zehnwirth and G. Barnett. Best Estimates for Reserves. Proceedings of the CAS. Volume LXXXVII. Number 167.November 2000.
Clark, David R., "LDF Curve-Fitting and Stochastic Reserving: A Maximum Likelihood Approach," CAS Forum, Fall 2003.
Zhang Y. A general multivariate chain ladder model.Insurance: Mathematics and Economics, 46, pp. 588:599, 2010.
Zhang, Y. Likelihood-based and Bayesian Methods for Tweedie Compound Poisson Linear Mixed Models, Statistics and Computing, forthcoming.
Bardis, Majidi, Murphy. A Family of Chain-Ladder Factor Models for Selected Link Ratios. Variance. Pending. Variance 6:2, 2012, pp. 143-160.
Modelling the claims development result for solvency purposes. Michael Merz, Mario V. Wüthrich. Casualty Actuarial Society E-Forum, Fall 2008.
Claims Run-Off Uncertainty: The Full Picture. Michael Merz, Mario V. Wüthrich. Swiss Finance Institute Research Paper No. 14-69. https://www.ssrn.com/abstract=2524352. 2014
Markus Gesmann. Claims Reserving and IBNR. Computational Actuarial Science with R. Chapman and Hall/CRC. 2014
## Not run: demo(ChainLadder) ## End(Not run)
## Not run: demo(ChainLadder) ## End(Not run)
Run-off triangle of a worker's compensation portfolio of a large company
data(ABC)
data(ABC)
A matrix with 11 accident years and 11 development years.
B. Zehnwirth and G. Barnett. Best Estimates for Reserves. Proceedings of the CAS. Volume LXXXVII. Number 167. November 2000.
ABC plot(ABC) plot(ABC, lattice=TRUE)
ABC plot(ABC) plot(ABC, lattice=TRUE)
Given a Triangle in matrix ("wide") format, convert to data.frame ("long") format.
as.LongTriangle(Triangle, varnames = names(dimnames(Triangle)), value.name = "value", na.rm = TRUE)
as.LongTriangle(Triangle, varnames = names(dimnames(Triangle)), value.name = "value", na.rm = TRUE)
Triangle |
a loss "triangle". Must be a |
varnames |
|
value.name |
column name to be given to the matrix values that will be stored in the data.frame. Defaults to "value". |
na.rm |
should NA values be excluded from the data.frame? Defaults to TRUE. |
Unlike the as.data.frame.triangle method, and Unlike the 'melt' method in the 'reshape2' package, this function returns a data.frame where the rownames and colnames of Triangle are stored as factors. This can be a critical feature when the order of the levels of the columns is important. For example, when a Triangle is plotted, the order of the origin and dev dimensions is important. See Examples section.
A data.frame
.
Daniel Murphy
as.data.frame.triangle
as.LongTriangle(GenIns) ## Not run: ggplot(as.LongTriangle(GenIns), aes(x = dev, y = value, group = origin, color = origin)) + geom_line() ## End(Not run)
as.LongTriangle(GenIns) ## Not run: ggplot(as.LongTriangle(GenIns), aes(x = dev, y = value, group = origin, color = origin)) + geom_line() ## End(Not run)
Calculate the matrix of age-to-age factors
(also called "report-to-report" factors, or "link ratios")
for an object of class triangle
.
ata(Triangle, NArow.rm = TRUE, colname.sep = "-", colname.order=c("ascending","descending"))
ata(Triangle, NArow.rm = TRUE, colname.sep = "-", colname.order=c("ascending","descending"))
Triangle |
a loss "triangle". Must be a |
NArow.rm |
|
colname.sep |
a |
colname.order |
"ascending" indicates that the less mature age comes first in the column labels of the ata matrix |
ata
constructs a matrix of age-to-age (ata) factors resulting
from a loss "triangle" or a matrix
.
Simple averages and volume weighted averages are saved as
"smpl" and "vwtd" attributes, respectively.
A matrix
with "smpl" and "vwtd" attributes.
Daniel Murphy
summary.ata
, print.ata
and chainladder
ata(GenIns) # Volume weighted average age-to-age factor of the "RAA" data y <- attr(ata(RAA), "vwtd") y # "To ultimate" factors with a 10% tail y <- rev(cumprod(rev(c(y, 1.1)))) names(y) <- paste(colnames(RAA), "Ult", sep="-") y ## Label the development columns in "ratio-type" format ata(RAA, colname.sep=":", colname.order="desc")
ata(GenIns) # Volume weighted average age-to-age factor of the "RAA" data y <- attr(ata(RAA), "vwtd") y # "To ultimate" factors with a 10% tail y <- rev(cumprod(rev(c(y, 1.1)))) names(y) <- paste(colnames(RAA), "Ult", sep="-") y ## Label the development columns in "ratio-type" format ata(RAA, colname.sep=":", colname.order="desc")
Run-off triangles of Personal Auto and Commercial Auto insurance.
data(auto)
data(auto)
A list of three matrices, paid Personal Auto, incurred Personal Auto and paid Commercial Auto respectively.
Zhang (2010). A general multivariate chain ladder model. Insurance: Mathematics and Economics, 46, pp. 588-599.
data(auto) names(auto)
data(auto) names(auto)
Run-off triangles of Automobile Bodily Injury Liability.
data(AutoBI)
data(AutoBI)
Portfolio of automobile bodily injury liability for an experience period of 1969 to 1976. Paid Claims, Closed Claims and Reported Claim Counts respectively
Berquist, J.R. and Sherman, R.E., Loss Reserve Adequacy Testing: A Comprehensive, Systematic Approach, Proceedings of the Casualty Actuarial Society, LXIV, 1977, pp.123-184.
data(AutoBI) names(AutoBI) AutoBI$AutoBIPaid AutoBI$AutoBIClosed AutoBI$AutoBIReportedCounts
data(AutoBI) names(AutoBI) AutoBI$AutoBIPaid AutoBI$AutoBIClosed AutoBI$AutoBIReportedCounts
The BootChainLadder
procedure provides a predictive
distribution of reserves or IBNRs for a cumulative claims development triangle.
BootChainLadder(Triangle, R = 999, process.distr=c("gamma", "od.pois"), seed = NULL)
BootChainLadder(Triangle, R = 999, process.distr=c("gamma", "od.pois"), seed = NULL)
Triangle |
cumulative claims triangle. Assume columns are the development
period, use transpose otherwise. A (mxn)-matrix |
R |
the number of bootstrap replicates. |
process.distr |
character string indicating which process distribution to be assumed. One of "gamma" (default), or "od.pois" (over-dispersed Poisson), can be abbreviated |
seed |
optional seed for the random generator |
The BootChainLadder
function uses a two-stage
bootstrapping/simulation approach. In the first stage an ordinary
chain-ladder methods is applied to the cumulative claims triangle.
From this we calculate the scaled Pearson residuals which we bootstrap
R times to forecast future incremental claims payments via the
standard chain-ladder method.
In the second stage we simulate the process error with the bootstrap
value as the mean and using the process distribution assumed.
The set of reserves obtained in this way forms the predictive distribution,
from which summary statistics such as mean, prediction error or
quantiles can be derived.
BootChainLadder gives a list with the following elements back:
call |
matched call |
Triangle |
input triangle |
f |
chain-ladder factors |
simClaims |
array of dimension |
IBNR.ByOrigin |
array of dimension |
IBNR.Triangles |
array of dimension |
IBNR.Totals |
vector of R samples of the total IBNRs |
ChainLadder.Residuals |
adjusted Pearson chain-ladder residuals |
process.distr |
assumed process distribution |
R |
the number of bootstrap replicates |
The implementation of BootChainLadder
follows closely the
discussion of the bootstrap model in section 8 and appendix 3 of the
paper by England and Verrall (2002).
Markus Gesmann, [email protected]
England, PD and Verrall, RJ. Stochastic Claims Reserving in General Insurance (with discussion), British Actuarial Journal 8, III. 2002
Barnett and Zehnwirth. The need for diagnostic assessment of bootstrap predictive models, Insureware technical report. 2007
See also
summary.BootChainLadder
,
plot.BootChainLadder
displaying results and finally
CDR.BootChainLadder
for the one year claims development result.
# See also the example in section 8 of England & Verrall (2002) on page 55. B <- BootChainLadder(RAA, R=999, process.distr="gamma") B plot(B) # Compare to MackChainLadder MackChainLadder(RAA) quantile(B, c(0.75,0.95,0.99, 0.995)) # fit a distribution to the IBNR library(MASS) plot(ecdf(B$IBNR.Totals)) # fit a log-normal distribution fit <- fitdistr(B$IBNR.Totals[B$IBNR.Totals>0], "lognormal") fit curve(plnorm(x,fit$estimate["meanlog"], fit$estimate["sdlog"]), col="red", add=TRUE) # See also the ABC example in Barnett and Zehnwirth (2007) A <- BootChainLadder(ABC, R=999, process.distr="gamma") A plot(A, log=TRUE) ## One year claims development result CDR(A)
# See also the example in section 8 of England & Verrall (2002) on page 55. B <- BootChainLadder(RAA, R=999, process.distr="gamma") B plot(B) # Compare to MackChainLadder MackChainLadder(RAA) quantile(B, c(0.75,0.95,0.99, 0.995)) # fit a distribution to the IBNR library(MASS) plot(ecdf(B$IBNR.Totals)) # fit a log-normal distribution fit <- fitdistr(B$IBNR.Totals[B$IBNR.Totals>0], "lognormal") fit curve(plnorm(x,fit$estimate["meanlog"], fit$estimate["sdlog"]), col="red", add=TRUE) # See also the ABC example in Barnett and Zehnwirth (2007) A <- BootChainLadder(ABC, R=999, process.distr="gamma") A plot(A, log=TRUE) ## One year claims development result CDR(A)
The B-S Paid Claim Development Adjustment methods adjusts paid claims based on the underlying relation between paid and closed claims.
BS.paid.adj(Triangle.rep.counts = NULL, Triangle.closed, Triangle.paid, ult.counts = NULL, regression.type = "exponential")
BS.paid.adj(Triangle.rep.counts = NULL, Triangle.closed, Triangle.paid, ult.counts = NULL, regression.type = "exponential")
Triangle.rep.counts |
cumulative reported claim counts triangle. Assume columns are the development
period, use transpose otherwise.
A (mxn)-matrix |
Triangle.closed |
cumulative closed claim counts triangle. Assume columns are the development period, use transpose otherwise. |
Triangle.paid |
cumulative paid claims triangle. Assume columns are the development period, use transpose otherwise. |
ult.counts |
vector of ultimate claim counts. |
regression.type |
Default = "exponential". Type of regression used in the model, it can take 'exponential' or 'linear'. See also 'Details' |
The importance of recognizing the impact of shifts in the rate of settlement of claims upon historical paid loss data can materially affect the ultimate projections.
This functions adjusts the paid claims based on the numerical method described in the B-S paper.
Berquist and Sherman presented a technique to adjust the paid claim development method for changes in settlement rates. The first step of the paid claims adjustment is to determine the disposal rates by accident year and maturity.
The disposal rate is defined as as the cumulative closed claim counts for each accident year-maturity age cell divided by the selected ultimate claim count for the particular accident year.
If ultimate claim counts have been provided, they will be used to calulate the disposal rates, otherwise ultimate claim counts will be estimated from the cumulative reported claim counts triangle with a standard development method.
The disposal rates along the latest diagonal will be selected as the basis for adjusting the closed claim count triangle, The selected disposal rate for each maturity are multiplied by the ultimate number of claims to determine the adjusted triangle of closed claim counts.
Berquist and Sherman then use regression analysis to identify a mathematical formula that approximates the relationship between the cumulative
number of closed claims (X) and cumulative paid claims (Y). The algorithm gives the possibility, through the choice of the 'regression.type' field,
to fit an exponential model, , or a linear model,
.
The relation is estimated based on unadjusted closed claim counts and unadjusted paid claims. Once the regression coefficients are estimated, they will be used to adjust paid claims based on such coefficients and the adjusted closed claim counts triangle.
BS.paid.adj returns the adjusted paid claim triangle
Marco De Virgilis [email protected]
Berquist, J.R. and Sherman, R.E., Loss Reserve Adequacy Testing: A Comprehensive, Systematic Approach, Proceedings of the Casualty Actuarial Society, LXIV, 1977, pp.123-184.
See also qpaid
for dealing with non-square triangles,
inflateTriangle
to inflate a triangle based on an inflation rate,
# Adjust the Triangle of Paid Claims based on Reported Claim Counts adj_paid <- BS.paid.adj( Triangle.rep.counts = AutoBI$AutoBIReportedCounts, Triangle.closed = AutoBI$AutoBIClosed, Triangle.paid = AutoBI$AutoBIPaid, regression.type = 'exponential' ) # Calculate the IBNR from the standard unadjusted Paid Triangle std_ibnr <- summary(MackChainLadder(AutoBI$AutoBIPaid))$Totals[4, 1] # Calculate the IBNR from the adjusted Paid Triangle adj_ibnr <- summary(MackChainLadder(adj_paid))$Totals[4, 1] # Compare the two adj_ibnr std_ibnr ## For more examples see: ## Not run: demo(BS.paid.adj) ## End(Not run)
# Adjust the Triangle of Paid Claims based on Reported Claim Counts adj_paid <- BS.paid.adj( Triangle.rep.counts = AutoBI$AutoBIReportedCounts, Triangle.closed = AutoBI$AutoBIClosed, Triangle.paid = AutoBI$AutoBIPaid, regression.type = 'exponential' ) # Calculate the IBNR from the standard unadjusted Paid Triangle std_ibnr <- summary(MackChainLadder(AutoBI$AutoBIPaid))$Totals[4, 1] # Calculate the IBNR from the adjusted Paid Triangle adj_ibnr <- summary(MackChainLadder(adj_paid))$Totals[4, 1] # Compare the two adj_ibnr std_ibnr ## For more examples see: ## Not run: demo(BS.paid.adj) ## End(Not run)
Standard deviation of the claims development result after one year for the distribution-free chain-ladder model (Mack) and Bootstrap model.
CDR(x, ...) ## S3 method for class 'MackChainLadder' CDR(x, dev=1, ...) ## S3 method for class 'BootChainLadder' CDR(x, probs=c(0.75, 0.95), ...) ## Default S3 method: CDR(x, ...)
CDR(x, ...) ## S3 method for class 'MackChainLadder' CDR(x, dev=1, ...) ## S3 method for class 'BootChainLadder' CDR(x, probs=c(0.75, 0.95), ...) ## Default S3 method: CDR(x, ...)
x |
otput of either |
dev |
vector of development periods or |
probs |
only applicable for |
... |
other arguments |
Merz & Wüthrich (2008) derived analytic formulae for the mean square error of prediction of the claims development result for the Mack chain-ladder model after one year assuming:
The opening reserves were set using the pure chain-ladder model (no tail)
Claims develop in the year according to the assumptions underlying Mack's model
Reserves are set after one year using the pure chain-ladder model (no tail)
A data.frame
with various IBNR/reserves and one-year statistics of the
claims development result.
Tail factors are currently not supported.
Mario Wüthrich and Markus Gesmann
with contributions from Arthur Charpentier and Arnaud Lacoume
for CDR.MackChainLadder
and Giuseppe Crupi and
Markus Gesmann for CDR.BootChainLadder
.
Michael Merz, Mario V. Wüthrich. Modelling the claims development result for solvency purposes. Casualty Actuarial Society E-Forum, Fall 2008.
Michael Merz, Mario V. Wüthrich. Claims Run-Off Uncertainty: The Full Picture. Swiss Finance Institute Research Paper No. 14-69. https://www.ssrn.com/abstract=2524352. 2014
See also MackChainLadder
and BootChainLadder
# Example from the 2008 Merz, Wuthrich paper mentioned above MW2008 M <- MackChainLadder(MW2008, est.sigma="Mack") plot(M) CDR(M) # Return all run-off result developments CDR(M, dev="all") # Example from the 2014 Merz, Wuthrich paper mentioned above MW2014 W <- MackChainLadder(MW2014, est.sigma="Mack") plot(W) CDR(W) # Example with the BootChainLadder function, assuming overdispered Poisson model B <- BootChainLadder(MW2008, process.distr=c("od.pois")) B CDR(B)
# Example from the 2008 Merz, Wuthrich paper mentioned above MW2008 M <- MackChainLadder(MW2008, est.sigma="Mack") plot(M) CDR(M) # Return all run-off result developments CDR(M, dev="all") # Example from the 2014 Merz, Wuthrich paper mentioned above MW2014 W <- MackChainLadder(MW2014, est.sigma="Mack") plot(W) CDR(W) # Example with the BootChainLadder function, assuming overdispered Poisson model B <- BootChainLadder(MW2008, process.distr=c("od.pois")) B CDR(B)
Basic chain-ladder function to estimate age-to-age factors for a given cumulative run-off triangle. This function is used by Mack- and MunichChainLadder.
chainladder(Triangle, weights = 1, delta = 1)
chainladder(Triangle, weights = 1, delta = 1)
Triangle |
cumulative claims triangle. A (mxn)-matrix |
weights |
weights. Default: 1, which sets the weights for all
triangle entries to 1. Otherwise specify weights as a matrix of the same
dimension as |
delta |
'weighting' parameters. Default: 1;
delta=1 gives the historical chain-ladder age-to-age factors,
delta=2 gives the straight average of the
observed individual development factors and delta=0 is the result of
an ordinary regression of Please note that |
The key idea is to see the chain-ladder algorithm as a special form of a weighted linear regression through the origin, applied to each development period.
Suppose y
is the vector of cumulative claims at development period
i+1
, and x
at development period i
, weights
are
weighting factors and F
the individual age-to-age factors F=y/x
. Then
we get the various age-to-age factors:
Basic (unweighted) linear regression through the origin:
lm(y~x + 0)
Basic weighted linear regression through the origin:
lm(y~x + 0, weights=weights)
Volume weighted chain-ladder age-to-age factors:
lm(y~x + 0, weights=1/x)
Simple average of age-to-age factors:
lm(y~x + 0, weights=1/x^2)
Barnett & Zehnwirth (2000) use delta = 0, 1, 2 to distinguish between the above
three different regression approaches: lm(y~x + 0, weights=weights/x^delta)
.
Thomas Mack uses the notation alpha = 2 - delta
to achieve the same result:
sum(weights*x^alpha*F)/sum(weights*x^alpha) # Mack (1999) notation
chainladder returns a list with the following elements:
Models |
linear regression models for each development period |
Triangle |
input triangle of cumulative claims |
weights |
weights used |
delta |
deltas used |
Markus Gesmann <[email protected]>
Thomas Mack. The standard error of chain ladder reserve estimates: Recursive calculation and inclusion of a tail factor. Astin Bulletin. Vol. 29. No 2. 1999. pp.361:366
G. Barnett and B. Zehnwirth. Best Estimates for Reserves. Proceedings of the CAS. Volume LXXXVII. Number 167. November 2000.
See also
ata
,
predict.ChainLadder
MackChainLadder
,
## Concept of different chain-ladder age-to-age factors. ## Compare Mack's and Barnett & Zehnwirth's papers. x <- RAA[1:9,1] y <- RAA[1:9,2] F <- y/x ## wtd. average chain-ladder age-to-age factors alpha <- 1 ## Mack notation delta <- 2 - alpha ## Barnett & Zehnwirth notation sum(x^alpha*F)/sum(x^alpha) lm(y~x + 0 ,weights=1/x^delta) summary(chainladder(RAA, delta=delta)$Models[[1]])$coef ## straight average age-to-age factors alpha <- 0 delta <- 2 - alpha sum(x^alpha*F)/sum(x^alpha) lm(y~x + 0, weights=1/x^(2-alpha)) summary(chainladder(RAA, delta=delta)$Models[[1]])$coef ## ordinary regression age-to-age factors alpha=2 delta <- 2-alpha sum(x^alpha*F)/sum(x^alpha) lm(y~x + 0, weights=1/x^delta) summary(chainladder(RAA, delta=delta)$Models[[1]])$coef ## Compare different models CL0 <- chainladder(RAA) ## age-to-age factors sapply(CL0$Models, function(x) summary(x)$coef["x","Estimate"]) ## f.se sapply(CL0$Models, function(x) summary(x)$coef["x","Std. Error"]) ## sigma sapply(CL0$Models, function(x) summary(x)$sigma) predict(CL0) CL1 <- chainladder(RAA, delta=1) ## age-to-age factors sapply(CL1$Models, function(x) summary(x)$coef["x","Estimate"]) ## f.se sapply(CL1$Models, function(x) summary(x)$coef["x","Std. Error"]) ## sigma sapply(CL1$Models, function(x) summary(x)$sigma) predict(CL1) CL2 <- chainladder(RAA, delta=2) ## age-to-age factors sapply(CL2$Models, function(x) summary(x)$coef["x","Estimate"]) ## f.se sapply(CL2$Models, function(x) summary(x)$coef["x","Std. Error"]) ## sigma sapply(CL2$Models, function(x) summary(x)$sigma) predict(CL2) ## Set 'weights' parameter to use only the last 5 diagonals, ## i.e. the last 5 calendar years calPeriods <- (row(RAA) + col(RAA) - 1) (weights <- ifelse(calPeriods <= 5, 0, ifelse(calPeriods > 10, NA, 1))) CL3 <- chainladder(RAA, weights=weights) summary(CL3$Models[[1]])$coef predict(CL3)
## Concept of different chain-ladder age-to-age factors. ## Compare Mack's and Barnett & Zehnwirth's papers. x <- RAA[1:9,1] y <- RAA[1:9,2] F <- y/x ## wtd. average chain-ladder age-to-age factors alpha <- 1 ## Mack notation delta <- 2 - alpha ## Barnett & Zehnwirth notation sum(x^alpha*F)/sum(x^alpha) lm(y~x + 0 ,weights=1/x^delta) summary(chainladder(RAA, delta=delta)$Models[[1]])$coef ## straight average age-to-age factors alpha <- 0 delta <- 2 - alpha sum(x^alpha*F)/sum(x^alpha) lm(y~x + 0, weights=1/x^(2-alpha)) summary(chainladder(RAA, delta=delta)$Models[[1]])$coef ## ordinary regression age-to-age factors alpha=2 delta <- 2-alpha sum(x^alpha*F)/sum(x^alpha) lm(y~x + 0, weights=1/x^delta) summary(chainladder(RAA, delta=delta)$Models[[1]])$coef ## Compare different models CL0 <- chainladder(RAA) ## age-to-age factors sapply(CL0$Models, function(x) summary(x)$coef["x","Estimate"]) ## f.se sapply(CL0$Models, function(x) summary(x)$coef["x","Std. Error"]) ## sigma sapply(CL0$Models, function(x) summary(x)$sigma) predict(CL0) CL1 <- chainladder(RAA, delta=1) ## age-to-age factors sapply(CL1$Models, function(x) summary(x)$coef["x","Estimate"]) ## f.se sapply(CL1$Models, function(x) summary(x)$coef["x","Std. Error"]) ## sigma sapply(CL1$Models, function(x) summary(x)$sigma) predict(CL1) CL2 <- chainladder(RAA, delta=2) ## age-to-age factors sapply(CL2$Models, function(x) summary(x)$coef["x","Estimate"]) ## f.se sapply(CL2$Models, function(x) summary(x)$coef["x","Std. Error"]) ## sigma sapply(CL2$Models, function(x) summary(x)$sigma) predict(CL2) ## Set 'weights' parameter to use only the last 5 diagonals, ## i.e. the last 5 calendar years calPeriods <- (row(RAA) + col(RAA) - 1) (weights <- ifelse(calPeriods <= 5, 0, ifelse(calPeriods > 10, NA, 1))) CL3 <- chainladder(RAA, weights=weights) summary(CL3$Models[[1]])$coef predict(CL3)
Check for Year-on-Year Inflation rates down the columns of a run-off triangle
checkTriangleInflation(Triangle)
checkTriangleInflation(Triangle)
Triangle |
average claim amounts triangle. Assume columns are the development
period, use transpose otherwise.
A (mxn)-matrix |
The sensitivity of projections of ultimate losses based on incurred loss development factors to changes in the adequacy level of case reserves increases significantly for the long-tail lines. In particular, if the adequacy of the case reserve is changing, the estimates of ultimate losses based on reported claims could be severely distorted.
The function fits an exponential inflation model that takes the form of:
where represents the inflated claim amount,
represents the claim amount at the beginning of each period (e.g. AY=0),
is the inflation rate and
is the time (e.g. AY).
Fitting such a model on the average level of the case outstanding (or any other average claim amount) for each development period, it is possible to appreciate the inflation rate that has affected the average case reserve.
It is necessary to check the inflation on average amounts, otherwise the estimates may be distorted due to an increase in the number of claims rather than an actual increase in the inflation level.
If the level of inflation is material, it would be necessary to adjust each cell in the triangle.
This is to to have each diagonal in the triangle at the same level as the latest diagonal (i.e. latest valuation). This adjustment would prevent distortions in the estimates caused by inflation and not by actual variations in the claim experience.
checkTriangleInflation returns a list with the following elements
Triangle |
Input triangle |
summ_table |
summary table showing the inflation rate, the |
Marco De Virgilis [email protected]
Berquist, J.R. and Sherman, R.E., Loss Reserve Adequacy Testing: A Comprehensive, Systematic Approach, Proceedings of the Casualty Actuarial Society, LXIV, 1977, pp.123-184.
See also qpaid
for dealing with non-square triangles,
inflateTriangle
to inflate a triangle based on an inflation rate,
# Create a triangle of average outstanding claims as the ratio between O/S Claims # and Open Claims (i.e. the number of outstanding claims) avg <- MedMal$MedMalOutstanding / MedMal$MedMalOpen # Check the level of average inflation Y-o-Y test<-checkTriangleInflation(avg) # Plot the results # A model of exponential inflation fits quite well the level of average O/S claims # This is particularly evident for DP 1,2,3 plot(test) # Get the summary in an analytical way to observe the ratios and the number of points used summary(test) # Print the output print(test) # There is an inflation level equal to .15 at the first development period. It would be # appropriate to adjust the triangle before proceeding with any estimate method.
# Create a triangle of average outstanding claims as the ratio between O/S Claims # and Open Claims (i.e. the number of outstanding claims) avg <- MedMal$MedMalOutstanding / MedMal$MedMalOpen # Check the level of average inflation Y-o-Y test<-checkTriangleInflation(avg) # Plot the results # A model of exponential inflation fits quite well the level of average O/S claims # This is particularly evident for DP 1,2,3 plot(test) # Get the summary in an analytical way to observe the ratios and the number of points used summary(test) # Print the output print(test) # There is an inflation level equal to .15 at the first development period. It would be # appropriate to adjust the triangle before proceeding with any estimate method.
Analyze loss triangle using Clark's Cape Cod method.
ClarkCapeCod(Triangle, Premium, cumulative = TRUE, maxage = Inf, adol = TRUE, adol.age = NULL, origin.width = NULL, G = "loglogistic")
ClarkCapeCod(Triangle, Premium, cumulative = TRUE, maxage = Inf, adol = TRUE, adol.age = NULL, origin.width = NULL, G = "loglogistic")
Triangle |
A loss triangle in the form of a matrix. The number of columns must be at least four; the number of rows may be as few as 1. The column names of the matrix should be able to be interpreted as the "age" of the losses in that column. The row names of the matrix should uniquely define the year of origin of the losses in that row. Losses may be inception-to-date or incremental. |
Premium |
The vector of premium to use in the method.
If a scalar (vector of length 1) is given,
that value will be used for all origin periods.
(See "Examples" below.)
If the length is greater than 1 but
does not equal the number of rows of |
cumulative |
If |
maxage |
The "ultimate" age to which losses should be projected. |
adol |
If |
adol.age |
Only pertinent if |
origin.width |
Only pertinent if |
G |
A |
Clark's "Cape Cod" method assumes that the incremental losses across development periods in a loss triangle are independent. He assumes that the expected value of an incremental loss is equal to the theoretical expected loss ratio (ELR) times the on-level premium for the origin year times the change in the theoretical underlying growth function over the development period. Clark models the growth function, also called the percent of ultimate, by either the loglogistic function (a.k.a., "the inverse power curve") or the weibull function. Clark completes his incremental loss model by wrapping the expected values within an overdispersed poisson (ODP) process where the "scale factor" sigma^2 is assumed to be a known constant for all development periods.
The parameters of Clark's "Cape Cod" method are therefore: ELR, and omega and theta (the parameters of the loglogistic and weibull growth functions). Finally, Clark uses maximum likelihood to parameterize his model, uses the ODP process to estimate process risk, and uses the Cramer-Rao theorem and the "delta method" to estimate parameter risk.
Clark recommends inspecting the residuals to help assess the
reasonableness of the model relative to the actual data
(see plot.clark
below).
A list
of class "ClarkLDF" with the components listed below.
("Key" to naming convention: all caps represent parameters;
mixed case represent origin-level amounts;
all-lower-case represent observation-level (origin, development age) results.)
method |
"CapeCod" |
growthFunction |
name of the growth function |
Origin |
names of the rows of the triangle |
Premium |
Premium amount for each origin year |
CurrentValue |
the most mature value for each row |
CurrentAge |
the most mature "age" for each row |
CurrentAge.used |
the most mature age used; differs from "CurrentAge" when adol=TRUE |
MAXAGE |
same as 'maxage' argument |
MAXAGE.USED |
the maximum age for development from the average date of loss; differs from MAXAGE when adol=TRUE |
FutureValue |
the projected loss amounts ("Reserves" in Clark's paper) |
ProcessSE |
the process standard error of the FutureValue |
ParameterSE |
the parameter standard error of the FutureValue |
StdError |
the total standard error (process + parameter) of the FutureValue |
Total |
a |
PAR |
the estimated parameters |
ELR |
the estimated loss ratio parameter |
THETAG |
the estimated parameters of the growth function |
GrowthFunction |
value of the growth function as of the CurrentAge.used |
GrowthFunctionMAXAGE |
value of the growth function as of the MAXAGE.used |
FutureGrowthFactor |
the ("unreported" or "unpaid") percent of ultimate loss that has yet to be recorded |
SIGMA2 |
the estimate of the sigma^2 parameter |
Ldf |
the "to-ultimate" loss development factor (sometimes called the "cumulative development factor") as defined in Clark's paper for each origin year |
LdfMAXAGE |
the "to-ultimate" loss development factor as of the maximum age used in the model |
TruncatedLdf |
the "truncated" loss development factor for developing the current diagonal to the maximum age used in the model |
FutureValueGradient |
the gradient of the FutureValue function |
origin |
the origin year corresponding to each observed value of incremental loss |
age |
the age of each observed value of incremental loss |
fitted |
the expected value of each observed value of incremental loss (the "mu's" of Clark's paper) |
residuals |
the actual minus fitted value for each observed incremental loss |
stdresid |
the standardized residuals for each observed incremental loss (= residuals/sqrt(sigma2*fitted), referred to as "normalized residuals" in Clark's paper; see p. 62) |
FI |
the "Fisher Information" matrix as defined in Clark's paper (i.e., without the sigma^2 value) |
value |
the value of the loglikelihood function at the solution point |
counts |
the number of calls to the loglikelihood function and its gradient function when numerical convergence was achieved |
Daniel Murphy
Clark, David R., "LDF Curve-Fitting and Stochastic Reserving: A Maximum Likelihood Approach", Casualty Actuarial Society Forum, Fall, 2003 https://www.casact.org/sites/default/files/database/forum_03fforum_03ff041.pdf
X <- GenIns colnames(X) <- 12*as.numeric(colnames(X)) CC.loglogistic <- ClarkCapeCod(X, Premium=10000000+400000*0:9, maxage=240) CC.loglogistic # Clark's "CapeCod method" also works with triangles that have # more development periods than origin periods. The Premium # is a contrived match to the "made up" 'qincurred' Triangle. ClarkCapeCod(qincurred, Premium=1250+150*0:11, G="loglogistic") # Method also works for a "triangle" with only one row: # 1st row of GenIns; need "drop=FALSE" to avoid becoming a vector. ClarkCapeCod(GenIns[1, , drop=FALSE], Premium=1000000, maxage=20) # If one value of Premium is appropriate for all origin years # (e.g., losses are on-level and adjusted for exposure) # then only a single value for Premium need be provided. ClarkCapeCod(GenIns, Premium=1000000, maxage=20) # Use of the weibull function generates a warning that the parameter risk # approximation results in some negative variances. This may be of small # concern since it happens only for older years with near-zero # estimated reserves, but the warning should not be disregarded # if it occurs with real data. Y <- ClarkCapeCod(qincurred, Premium=1250+150*0:11, G="weibull") # The plot of the standardized residuals by age indicates that the more # mature observations are more loosely grouped than the less mature, just # the opposite of the behavior under the loglogistic curve. # This suggests that the model might be improved by analyzing the Triangle # in two different "blocks": less mature vs. more mature. # The QQ-plot shows that the tails of the empirical distribution of # standardized residuals are "fatter" than a standard normal. # The fact that the p-value is essentially zero says that there is # virtually no chance that the standardized residuals could be # considered draws from a standard normal random variable. # The overall conclusion is that Clark's ODP-based CapeCod model with # the weibull growth function does not match up well with the qincurred # triangle and these premiums. plot(Y)
X <- GenIns colnames(X) <- 12*as.numeric(colnames(X)) CC.loglogistic <- ClarkCapeCod(X, Premium=10000000+400000*0:9, maxage=240) CC.loglogistic # Clark's "CapeCod method" also works with triangles that have # more development periods than origin periods. The Premium # is a contrived match to the "made up" 'qincurred' Triangle. ClarkCapeCod(qincurred, Premium=1250+150*0:11, G="loglogistic") # Method also works for a "triangle" with only one row: # 1st row of GenIns; need "drop=FALSE" to avoid becoming a vector. ClarkCapeCod(GenIns[1, , drop=FALSE], Premium=1000000, maxage=20) # If one value of Premium is appropriate for all origin years # (e.g., losses are on-level and adjusted for exposure) # then only a single value for Premium need be provided. ClarkCapeCod(GenIns, Premium=1000000, maxage=20) # Use of the weibull function generates a warning that the parameter risk # approximation results in some negative variances. This may be of small # concern since it happens only for older years with near-zero # estimated reserves, but the warning should not be disregarded # if it occurs with real data. Y <- ClarkCapeCod(qincurred, Premium=1250+150*0:11, G="weibull") # The plot of the standardized residuals by age indicates that the more # mature observations are more loosely grouped than the less mature, just # the opposite of the behavior under the loglogistic curve. # This suggests that the model might be improved by analyzing the Triangle # in two different "blocks": less mature vs. more mature. # The QQ-plot shows that the tails of the empirical distribution of # standardized residuals are "fatter" than a standard normal. # The fact that the p-value is essentially zero says that there is # virtually no chance that the standardized residuals could be # considered draws from a standard normal random variable. # The overall conclusion is that Clark's ODP-based CapeCod model with # the weibull growth function does not match up well with the qincurred # triangle and these premiums. plot(Y)
Analyze loss triangle using Clark's LDF (loss development factor) method.
ClarkLDF(Triangle, cumulative = TRUE, maxage = Inf, adol = TRUE, adol.age = NULL, origin.width = NULL, G = "loglogistic")
ClarkLDF(Triangle, cumulative = TRUE, maxage = Inf, adol = TRUE, adol.age = NULL, origin.width = NULL, G = "loglogistic")
Triangle |
A loss triangle in the form of a matrix. The number of columns must be at least four; the number of rows may be as few as 1. The column names of the matrix should be able to be interpreted as the "age" of the losses in that column. The row names of the matrix should uniquely define the year of origin of the losses in that row. Losses may be inception-to-date or incremental. The "ages" of the triangle can be "phase shifted" –
i.e., the first age need not be as at the end of the origin period.
(See the Examples section.)
Nor need the "ages" be uniformly spaced.
However, when the ages are not uniformly spaced,
it would be prudent to specify the |
cumulative |
If |
maxage |
The "ultimate" age to which losses should be projected. |
adol |
If |
adol.age |
Only pertinent if |
origin.width |
Only pertinent if |
G |
A |
Clark's "LDF method" assumes that the incremental losses across development periods in a loss triangle are independent. He assumes that the expected value of an incremental loss is equal to the theoretical expected ultimate loss (U) (by origin year) times the change in the theoretical underlying growth function over the development period. Clark models the growth function, also called the percent of ultimate, by either the loglogistic function (a.k.a., "the inverse power curve") or the weibull function. Clark completes his incremental loss model by wrapping the expected values within an overdispersed poisson (ODP) process where the "scale factor" sigma^2 is assumed to be a known constant for all development periods.
The parameters of Clark's "LDF method" are therefore: U, and omega and theta (the parameters of the loglogistic and weibull growth functions). Finally, Clark uses maximum likelihood to parameterize his model, uses the ODP process to estimate process risk, and uses the Cramer-Rao theorem and the "delta method" to estimate parameter risk.
Clark recommends inspecting the residuals to help assess the
reasonableness of the model relative to the actual data
(see plot.clark
below).
A list
of class "ClarkLDF" with the components listed below.
("Key" to naming convention: all caps represent parameters;
mixed case represent origin-level amounts;
all-lower-case represent observation-level (origin, development age) results.)
method |
"LDF" |
growthFunction |
name of the growth function |
Origin |
names of the rows of the triangle |
CurrentValue |
the most mature value for each row |
CurrentAge |
the most mature "age" for each row |
CurrentAge.used |
the most mature age used; differs from "CurrentAge" when adol=TRUE |
MAXAGE |
same as 'maxage' argument |
MAXAGE.USED |
the maximum age for development from the average date of loss; differs from MAXAGE when adol=TRUE |
FutureValue |
the projected loss amounts ("Reserves" in Clark's paper) |
ProcessSE |
the process standard error of the FutureValue |
ParameterSE |
the parameter standard error of the FutureValue |
StdError |
the total standard error (process + parameter) of the FutureValue |
Total |
a |
PAR |
the estimated parameters |
THETAU |
the estimated parameters for the "ultimate loss" by origin year ("U" in Clark's notation) |
THETAG |
the estimated parameters of the growth function |
GrowthFunction |
value of the growth function as of the CurrentAge.used |
GrowthFunctionMAXAGE |
value of the growth function as of the MAXAGE.used |
SIGMA2 |
the estimate of the sigma^2 parameter |
Ldf |
the "to-ultimate" loss development factor (sometimes called the "cumulative development factor") as defined in Clark's paper for each origin year |
LdfMAXAGE |
the "to-ultimate" loss development factor as of the maximum age used in the model |
TruncatedLdf |
the "truncated" loss development factor for developing the current diagonal to the maximum age used in the model |
FutureValueGradient |
the gradient of the FutureValue function |
origin |
the origin year corresponding to each observed value of incremental loss |
age |
the age of each observed value of incremental loss |
fitted |
the expected value of each observed value of incremental loss (the "mu's" of Clark's paper) |
residuals |
the actual minus fitted value for each observed incremental loss |
stdresid |
the standardized residuals for each observed incremental loss (= residuals/sqrt(sigma2*fitted), referred to as "normalized residuals" in Clark's paper; see p. 62) |
FI |
the "Fisher Information" matrix as defined in Clark's paper (i.e., without the sigma^2 value) |
value |
the value of the loglikelihood function at the solution point |
counts |
the number of calls to the loglikelihood function and its gradient function when numerical convergence was achieved |
Daniel Murphy
Clark, David R., "LDF Curve-Fitting and Stochastic Reserving: A Maximum Likelihood Approach", Casualty Actuarial Society Forum, Fall, 2003 https://www.casact.org/sites/default/files/database/forum_03fforum_03ff041.pdf
X <- GenIns ClarkLDF(X, maxage=20) # Clark's "LDF method" also works with triangles that have # more development periods than origin periods ClarkLDF(qincurred, G="loglogistic") # Method also works for a "triangle" with only one row: # 1st row of GenIns; need "drop=FALSE" to avoid becoming a vector. ClarkLDF(GenIns[1, , drop=FALSE], maxage=20) # The age of the first evaluation may be prior to the end of the origin period. # Here the ages are in units of "months" and the first evaluation # is at the end of the third quarter. X <- GenIns colnames(X) <- 12 * as.numeric(colnames(X)) - 3 # The indicated liability increases from 1st example above, # but not significantly. ClarkLDF(X, maxage=240) # When maxage is infinite, the phase shift has a more noticeable impact: # a 4-5% increase of the overall CV. x <- ClarkLDF(GenIns, maxage=Inf) y <- ClarkLDF(X, maxage=Inf) # Percent change in the bottom line CV: (tail(y$Table65$TotalCV, 1) - tail(x$Table65$TotalCV, 1)) / tail(x$Table65$TotalCV, 1)
X <- GenIns ClarkLDF(X, maxage=20) # Clark's "LDF method" also works with triangles that have # more development periods than origin periods ClarkLDF(qincurred, G="loglogistic") # Method also works for a "triangle" with only one row: # 1st row of GenIns; need "drop=FALSE" to avoid becoming a vector. ClarkLDF(GenIns[1, , drop=FALSE], maxage=20) # The age of the first evaluation may be prior to the end of the origin period. # Here the ages are in units of "months" and the first evaluation # is at the end of the third quarter. X <- GenIns colnames(X) <- 12 * as.numeric(colnames(X)) - 3 # The indicated liability increases from 1st example above, # but not significantly. ClarkLDF(X, maxage=240) # When maxage is infinite, the phase shift has a more noticeable impact: # a 4-5% increase of the overall CV. x <- ClarkLDF(GenIns, maxage=Inf) y <- ClarkLDF(X, maxage=Inf) # Percent change in the bottom line CV: (tail(y$Table65$TotalCV, 1) - tail(x$Table65$TotalCV, 1)) / tail(x$Table65$TotalCV, 1)
This function finds the values of delta, one for each development period, such that the model coefficients resulting from the 'chainladder' function with delta = solution are consistent with an input vector of 'selected' development age-to-age factors.
CLFMdelta(Triangle, selected, tolerance = .0005, ...)
CLFMdelta(Triangle, selected, tolerance = .0005, ...)
Triangle |
cumulative claims triangle. A (mxn)-matrix |
selected |
a vector of selected age-to-age factors or "link ratios", one for each development period of 'Triangle' |
tolerance |
a 'tolerance' parameters. Default: .0005; for each element of 'selected' a solution 'delta' will be found – if possible – so that the chainladder model indexed by 'delta' results in a multiplicative coefficient within 'tolerance' of the 'selected' factor. |
... |
not in use |
For a given input Triangle and vector of selected factors,
a search is conducted for chainladder models that are "consistent with" the
selected factors.
By "consistent with" is meant that the coefficients of the chainladder
function are equivalent to the selected factors.
Not all vectors of selected factors can be considered consistent with a given
Triangle;
feasibility is subject to restrictions on the 'selected' factors relative to
the input 'Triangle'.
See the References.
The default average produced by the chainladder
function is the
volume weighted average and corresponds to delta = 1
in the call
to that function;
delta = 2
produces the simple average; and
delta = 0
produces the "regression average", i.e.,
the slope of a regression line fit to the data
and running through the origin.
By convention, if the selected
value corresponds to
the volume-weighted average, the simple average, or the regression average,
then the value returned will be 1, 2, and 0, respectively.
Other real-number values for delta
will produce a different average.
The point of this function is to see if there exists a model as determined
by delta whose average is consistent with the value in the
selected
vector.
That is not always possible. See the References.
It can be the case that one or more of the above three "standard averages"
will be quite close to each other
(indistinguishable within tolerance
).
In that case, the value returned will be, in the following priority order
by convention,
1 (volume weighted average),
2 (simple average), or
0 (regression average).
A vector of real numbers, say delta0, such that
coef(chainladder(Triangle, delta = delta0))
= selected
within tolerance
.
A logical
attribute 'foundSolution' indicates if a solution was
found for each element of selected
.
Dan Murphy
Bardis, Majidi, Murphy. A Family of Chain-Ladder Factor Models for Selected Link Ratios. Variance. Pending. Variance 6:2, 2012, pp. 143-160.
x <- RAA[1:9,1] y <- RAA[1:9,2] F <- y/x CLFMdelta(RAA[1:9, 1:2], selected = mean(F)) # value is 2, 'foundSolution' is TRUE CLFMdelta(RAA[1:9, 1:2], selected = sum(y) / sum(x)) # value is 1, 'foundSolution' is TRUE selected <- mean(c(mean(F), sum(y) / sum(x))) # an average of averages CLFMdelta(RAA[1:9, 1:2], selected) # about 1.725 CLFMdelta(RAA[1:9, 1:2], selected = 2) # negative solutions are possible # Demonstrating an "unreasonable" selected factor. CLFMdelta(RAA[1:9, 1:2], selected = 1.9) # NA solution, with warning
x <- RAA[1:9,1] y <- RAA[1:9,2] F <- y/x CLFMdelta(RAA[1:9, 1:2], selected = mean(F)) # value is 2, 'foundSolution' is TRUE CLFMdelta(RAA[1:9, 1:2], selected = sum(y) / sum(x)) # value is 1, 'foundSolution' is TRUE selected <- mean(c(mean(F), sum(y) / sum(x))) # an average of averages CLFMdelta(RAA[1:9, 1:2], selected) # about 1.725 CLFMdelta(RAA[1:9, 1:2], selected = 2) # negative solutions are possible # Demonstrating an "unreasonable" selected factor. CLFMdelta(RAA[1:9, 1:2], selected = 1.9) # NA solution, with warning
Extract residuals of a MackChainLadder
model by
origin-, calendar- and development period.
## S3 method for class 'ChainLadder' coef(object, ...)
## S3 method for class 'ChainLadder' coef(object, ...)
object |
output of the |
... |
optional arguments which may become named attributes of the resulting vector |
The function returns a vector of the single-parameter coefficients – also called age-to-age (ATA) or report-to-report (RTR) factors – of the models produced by running the 'chainladder' function.
Dan Murphy
See Also chainladder
coef(chainladder(RAA))
coef(chainladder(RAA))
Functions to convert between cumulative and incremental triangles
incr2cum(Triangle, na.rm=FALSE) cum2incr(Triangle)
incr2cum(Triangle, na.rm=FALSE) cum2incr(Triangle)
Triangle |
triangle. Assume columns are the development period, use transpose otherwise. |
na.rm |
logical. Should missing values be removed? |
incr2cum
transforms an incremental triangle into a cumulative
triangle, cum2incr
provides the reserve operation.
Both functions return a triangle
.
Markus Gesmann, Christophe Dutang
See also as.triangle
# See the Taylor/Ashe example in Mack's 1993 paper #original triangle GenIns #incremental triangle cum2incr(GenIns) #original triangle incr2cum(cum2incr(GenIns)) # See the example in Mack's 1999 paper #original triangle Mortgage incMortgage <- cum2incr(Mortgage) #add missing values incMortgage[1,1] <- NA incMortgage[2,1] <- NA incMortgage[1,2] <- NA #with missing values argument incr2cum(incMortgage, na.rm=TRUE) #compared to incr2cum(Mortgage)
# See the Taylor/Ashe example in Mack's 1993 paper #original triangle GenIns #incremental triangle cum2incr(GenIns) #original triangle incr2cum(cum2incr(GenIns)) # See the example in Mack's 1999 paper #original triangle Mortgage incMortgage <- cum2incr(Mortgage) #add missing values incMortgage[1,1] <- NA incMortgage[2,1] <- NA incMortgage[1,2] <- NA #with missing values argument incr2cum(incMortgage, na.rm=TRUE) #compared to incr2cum(Mortgage)
One of the three basic assumptions underlying the chain ladder method is the independence of the accident years. The function tests this assumption.
cyEffTest(Triangle, ci = 0.95)
cyEffTest(Triangle, ci = 0.95)
Triangle |
cumulative claims triangle. Assume columns are the development
period, use transpose otherwise.
A (mxn)-matrix |
ci |
confidence interval. Default: .95. A confidence interval is a type of interval estimate, computed from the statis tics of the observed data, that might contain the true value of an unknown population parameter. The interval has an associated confidence level that quantifies the level of confidence that the parameter lies in the interval. |
The main reason why this independence can be violated in practice is the fact that there could be certain calendar year effects such as major changes in claims handling or in case reserving or external influences such as substantial changes in court decisions or inflation.
As described by the Mack's 1994 paper a procedure is designed to test for calendar year influences.
The procedure returns a summary statistic which is assumed to be Normally Distributed. It is therefore possible to define a confidence interval threshold in order to evaluate the outcome of the test.
cyEffTest returns a list with the following elements
test_table |
complete table of results |
Z |
summary statistic |
E |
expected value of the resulting distribution |
Var |
variance of the resulting distribution |
Range |
vector of the range corresponding the confidence interval threshold selected |
ci |
confidence interval |
Additional references for further reading:
Thomas Mack. Distribution-free calculation of the standard error of chain ladder reserve estimates. Astin Bulletin. Vol. 23. No 2. 1993. pp.213:225
Thomas Mack. The standard error of chain ladder reserve estimates: Recursive calculation and inclusion of a tail factor. Astin Bulletin. Vol. 29. No 2. 1999. pp.361:366
Marco De Virgilis [email protected]
Mack, T., Measuring the Variability of Chain Ladder Reserve Estimates, Casualty Actuarial Society Forum, Spring 1994
See also qpaid
for dealing with non-square triangles,
dfCorTest
for the test for correlations between subsequent development factors,
chainladder
for the chain-ladder method,
summary.cyEffTest
,
plot.cyEffTest
# Before actually applying the Chain Ladder technique it is necessary to check # wether the triangle has Calendar Year Effect # Apply the function to the triangle and save the output into the variable test test <- cyEffTest(RAA) # Plot the confidence interval and the test metric plot(test) # The metric is within the confidence interval, therefore the triangle doesn't # have Calendar Year Effect # Print the summary table summary(test) # Print only the main outcomes print(test) # The test has returned a negative outcome. This means that the triangle is # not affected by Caledar Year Effect and therefore the chain ladder method # can be applied.
# Before actually applying the Chain Ladder technique it is necessary to check # wether the triangle has Calendar Year Effect # Apply the function to the triangle and save the output into the variable test test <- cyEffTest(RAA) # Plot the confidence interval and the test metric plot(test) # The metric is within the confidence interval, therefore the triangle doesn't # have Calendar Year Effect # Print the summary table summary(test) # Print only the main outcomes print(test) # The test has returned a negative outcome. This means that the triangle is # not affected by Caledar Year Effect and therefore the chain ladder method # can be applied.
One of the main assumptions underlying the chain ladder method is the uncorrelation of subsequest development factor. The function tests this assumption.
dfCorTest(Triangle, ci = .5)
dfCorTest(Triangle, ci = .5)
Triangle |
cumulative claims triangle. Assume columns are the development
period, use transpose otherwise.
A (mxn)-matrix |
ci |
confidence interval. Default: .5. A confidence interval is a type of interval estimate, computed from the statis tics of the observed data, that might contain the true value of an unknown population parameter. The interval has an associated confidence level that quantifies the level of confidence that the parameter lies in the interval. |
As described by the Mack's 1994 paper a procedure is designed to test for calendar year influences.
The usual test for uncorrelatedness requires that we have identically distributed pairs of observations which come from a Normal distribution. Both conditions are usually not fulfilled for adjacent columns of development factors. Spearman's correlation coefficient is therefore used.
The metric calulated by the procudeure described return a statistic that it is assumed to be Normally Distributed. It is therefore possible to define a confidence interval threshold in order to evaluate the outcome of the test.
dfCorTest returns a list with the following elements
T_stat |
summary statistic |
Var |
variance of the resulting distribution |
Range |
vector of the range corresponding the confidence interval threshold selected |
ci |
confidence interval |
Additional references for further reading:
Thomas Mack. Distribution-free calculation of the standard error of chain ladder reserve estimates. Astin Bulletin. Vol. 23. No 2. 1993. pp.213:225
Thomas Mack. The standard error of chain ladder reserve estimates: Recursive calculation and inclusion of a tail factor. Astin Bulletin. Vol. 29. No 2. 1999. pp.361:366
Venter, G.G., Testing the Assumptions of Age-to-Age Factors, Proceedings of the Casualty Actuarial Society LXXXV, 1998, pp. 807-847
Marco De Virgilis [email protected]
Mack, T., Measuring the Variability of Chain Ladder Reserve Estimates, Casualty Actuarial Society Forum, Spring 1994
See also qpaid
for dealing with non-square triangles,
cyEffTest
for the test for calendar year effect,
chainladder
for the chain-ladder method,
summary.dfCorTest
,
plot.dfCorTest
# Before actually applying the Chain Ladder technique it is necessary to check # whether the Development Factors are correlated # Apply the function to the triangle and save the output into the variable test test <- dfCorTest(RAA) # Plot the confidence interval and the test metric plot(test) # The metric is within the confidence interval, therefore the Development Factors are nor correlated # Print the summary table summary(test) # Print only the main outcomes print(test) # The test has returned a negative outcome. This means that the triangle is # not affected by Development Factor Correlation and therefore the chain ladder method # can be applied.
# Before actually applying the Chain Ladder technique it is necessary to check # whether the Development Factors are correlated # Apply the function to the triangle and save the output into the variable test test <- dfCorTest(RAA) # Plot the confidence interval and the test metric plot(test) # The metric is within the confidence interval, therefore the Development Factors are nor correlated # Print the summary table summary(test) # Print only the main outcomes print(test) # The test has returned a negative outcome. This means that the triangle is # not affected by Development Factor Correlation and therefore the chain ladder method # can be applied.
Run off triangle of accumulated general insurance claims
data. GenInsLong
provides the same data in a 'long' format.
GenIns
GenIns
A matrix with 10 accident years and 10 development years.
TAYLOR, G.C. and ASHE, F.R. (1983) Second Moments of Estimates of Outstanding Claims. Journal of Econometrics 23, 37-61.
See table 1 in: Distribution-free Calculation of the Standard Error of Chain Ladder Reserve Estimates, Thomas Mack, 1993, ASTIN Bulletin 23, 213 - 225
GenIns plot(GenIns) plot(GenIns, lattice=TRUE) head(GenInsLong) ## Convert long format into triangle ## Triangles are usually stored as 'long' tables in data bases as.triangle(GenInsLong, origin="accyear", dev="devyear", "incurred claims")
GenIns plot(GenIns) plot(GenIns, lattice=TRUE) head(GenInsLong) ## Convert long format into triangle ## Triangles are usually stored as 'long' tables in data bases as.triangle(GenInsLong, origin="accyear", dev="devyear", "incurred claims")
Return most recent values for all origin periods of a cumulative development triangle.
getLatestCumulative(Triangle, na.values = NULL)
getLatestCumulative(Triangle, na.values = NULL)
Triangle |
a Triangle in matrix format. |
na.values |
a vector specifying values that should be considered synonymous with NA when searching for the rightmost non-NA. |
A vector of most recent non-'NA' (and synonyms, if appropriate) values
of a triangle for all origin periods.
The names
of the vector equal the origin names of the Triangle.
The vector will have additional attributes:
"latestcol" equalling the index of the column in Triangle corresponding
to the row's rightmost entry;
"rowsname" equalling the name of the row dimension of Triangle, if any;
"colnames" equalling the corresponding column name of Triangle, if any;
"colsname" equalling the name of the column dimension of Triangle, if any.
Ben Escoto, Markus Gesmann, Dan Murphy
See also as.triangle
.
RAA getLatestCumulative(RAA) Y <- matrix(c(1, 2, 3, 4, 5, 0, 6, NA, NA), byrow=TRUE, nrow=3) getLatestCumulative(Y) # c(3, 0, 6) getLatestCumulative(Y, na.values = 0) # c(3, 5, 6)
RAA getLatestCumulative(RAA) Y <- matrix(c(1, 2, 3, 4, 5, 0, 6, NA, NA), byrow=TRUE, nrow=3) getLatestCumulative(Y) # c(3, 0, 6) getLatestCumulative(Y, na.values = 0) # c(3, 5, 6)
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 and bootstrapping methods to compute the associated prediction errors. The bootstrapping approach also generates the full predictive distribution for loss reserves.
glmReserve(triangle, var.power = 1, link.power = 0, cum = TRUE, mse.method = c("formula", "bootstrap"), nsim = 1000, nb = FALSE, ...)
glmReserve(triangle, var.power = 1, link.power = 0, cum = TRUE, mse.method = c("formula", "bootstrap"), nsim = 1000, nb = FALSE, ...)
triangle |
An object of class |
var.power |
The index (p) of the power variance function |
link.power |
The index of power link function. The default |
cum |
A logical value indicating whether the input triangle is on the
cumulative or the incremental scale. If |
mse.method |
A character indicating whether the prediction error should be computed analytically ( |
nsim |
Number of simulations to be performed in the bootstrapping, with a default value of 1000. |
nb |
Whether the negative binomial distribution is used. If |
... |
Arguments to be passed onto the function |
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, .
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.
The argument var.power
determines which specific distribution is to be used, and link.power
determines the form of the link function.
When the Tweedie compound Poisson distribution 1 < p < 2
is to be used, the user has the option to specify var.power = NULL
, where the variance power p
will be estimated from the data using the cplm
package. The bcplm
function in the cplm
package also has an example for the Bayesian compound Poisson loss reserving model.
See details in tweedie
, cpglm
and bcplm
.
glmReserve
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 original scale (no log transformations for example).
If the vector is named, make sure the names coincide with the rownames/origin of the triangle.
If the vector is unnamed, make sure the exposures are in the order consistent with the accident years, and the character rownames of the Triangle must be convertible to numeric.
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 additional 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 the first-order Taylor approximation.
The other is using bootstrapping (mse.method = "bootstrap"
) that reconstructs the triangle nsim
times by sampling with replacement from the GLM (Pearson) residuals.
Each time a new triangle is formed, GLM is fitted and corresponding loss reserves are generated.
Based on these predicted mean loss reserves, and the model assumption about the distribution forms, realizations of the predicted values are generated via the rtweedie
function.
Prediction errors as well as other uncertainty measures such as quantiles and predictive intervals can be calculated based on these samples.
The output is an object of class "glmReserve"
that has the following components:
call |
the matched call. |
summary |
A data frame containing the predicted loss reserve statistics. Similar to the summary statistics from |
Triangle |
The input triangle. |
FullTriangle |
The completed triangle, where empty cells in the original triangle are filled with model predictions. |
model |
The fitted GLM, a class of |
sims.par |
a matrix of the simulated parameter values in the bootstrapping. |
sims.reserve.mean |
a matrix of the simulated mean loss reserves (without the process variance) for each year in the bootstrapping. |
sims.par |
a matrix of the simulated realizations of the loss reserves (with the process variance) for each year in the bootstrapping. This can be used to summarize the predictive uncertainty of the loss reserves. |
The use of GLM in insurance loss reserving has many compelling aspects, e.g.,
when over-dispersed Poisson model is used, it reproduces the estimates from Chain Ladder;
it provides a more coherent modeling framework than the Mack method;
all the relevant established statistical theory can be directly applied to perform hypothesis testing and diagnostic checking;
However, the user should be cautious of some of the key assumptions that underlie the GLM model, in order to determine whether this model is appropriate for the problem considered:
the GLM model assumes no tail development, and it only projects losses to the latest time point of the observed data. To use a model that enables tail extrapolation, please consider the growth curve model ClarkLDF
or ClarkCapeCod
;
the model assumes that each incremental loss is independent of all the others. This assumption may not be valid in that cells from the same calendar year are usually correlated due to inflation or business operating factors;
the model tends to be over-parameterized, which may lead to inferior predictive performance.
To solve these potential problems, many variants of the current basic GLM model have been proposed in the actuarial literature. Some of these may be included in the future release.
Support of the negative binomial GLM was added since version 0.2.3.
Wayne Zhang [email protected]
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 glm
, glm.nb
, tweedie
, cpglm
and MackChainLadder
.
data(GenIns) GenIns <- GenIns / 1000 # over-dispersed Poisson: reproduce ChainLadder estimates (fit1 <- glmReserve(GenIns)) summary(fit1, type = "model") # extract the underlying glm # which: # 1 Original triangle # 2 Full triangle # 3 Reserve distribution # 4 Residual plot # 5 QQ-plot # plot original triangle plot(fit1, which = 1, xlab = "dev year", ylab = "cum loss") # plot residuals plot(fit1, which = 4, xlab = "fitted values", ylab = "residuals") # Gamma GLM: (fit2 <- glmReserve(GenIns, var.power = 2)) # compound Poisson GLM (variance function estimated from the data): (fit3 <- glmReserve(GenIns, var.power = NULL)) # 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) * 100 GenIns2 <- GenIns attr(GenIns2, "exposure") <- expos (fit4 <- glmReserve(GenIns2)) # If the triangle's rownames are not convertible to numeric, # supply names to the exposures GenIns3 <- GenIns2 rownames(GenIns3) <- paste0(2007:2016, "-01-01") names(expos) <- rownames(GenIns3) attr(GenIns3, "exposure") <- expos (fit4b <- glmReserve(GenIns3)) # use bootstrapping to compute prediction error ## Not run: set.seed(11) (fit5 <- glmReserve(GenIns, mse.method = "boot")) # compute the quantiles of the predicted loss reserves t(apply(fit5$sims.reserve.pred, 2, quantile, c(0.025, 0.25, 0.5, 0.75, 0.975))) # plot distribution of reserve plot(fit5, which = 3) ## End(Not run) # alternative over-dispersed Poisson: negative binomial GLM (fit6 <- glmReserve(GenIns, nb = TRUE))
data(GenIns) GenIns <- GenIns / 1000 # over-dispersed Poisson: reproduce ChainLadder estimates (fit1 <- glmReserve(GenIns)) summary(fit1, type = "model") # extract the underlying glm # which: # 1 Original triangle # 2 Full triangle # 3 Reserve distribution # 4 Residual plot # 5 QQ-plot # plot original triangle plot(fit1, which = 1, xlab = "dev year", ylab = "cum loss") # plot residuals plot(fit1, which = 4, xlab = "fitted values", ylab = "residuals") # Gamma GLM: (fit2 <- glmReserve(GenIns, var.power = 2)) # compound Poisson GLM (variance function estimated from the data): (fit3 <- glmReserve(GenIns, var.power = NULL)) # 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) * 100 GenIns2 <- GenIns attr(GenIns2, "exposure") <- expos (fit4 <- glmReserve(GenIns2)) # If the triangle's rownames are not convertible to numeric, # supply names to the exposures GenIns3 <- GenIns2 rownames(GenIns3) <- paste0(2007:2016, "-01-01") names(expos) <- rownames(GenIns3) attr(GenIns3, "exposure") <- expos (fit4b <- glmReserve(GenIns3)) # use bootstrapping to compute prediction error ## Not run: set.seed(11) (fit5 <- glmReserve(GenIns, mse.method = "boot")) # compute the quantiles of the predicted loss reserves t(apply(fit5$sims.reserve.pred, 2, quantile, c(0.025, 0.25, 0.5, 0.75, 0.975))) # plot distribution of reserve plot(fit5, which = 3) ## End(Not run) # alternative over-dispersed Poisson: negative binomial GLM (fit6 <- glmReserve(GenIns, nb = TRUE))
Inflate the amounts of a Triangle from the latest diagonal based on an Inflation Rate
inflateTriangle(Triangle, rate)
inflateTriangle(Triangle, rate)
Triangle |
claim triangle. Assume columns are the development
period, use transpose otherwise.
A (mxn)-matrix |
rate |
Inflation rate to be applied to the triangle according to an exponential model |
The sensitivity of projections of ultimate losses based on incurred loss development factors to changes in the adequacy level of case reserves increases significantly for the long-tail lines. In particular, if the adequacy of the case reserve is changing, the estimates of ultimate losses based on reported claims could be severely distorted. The function deflates the amounts of latest diagonal to each diagonal of the triangle according to the inflation rate provided, considering an exponential model. The purpose of restating the amounts is to have each diagonal in the triangle at the same level as the latest diagonal (i.e. latest valuation). Ideally the metrics that should be restated are average O/S or average claim paid.
inflateTriangle returns the inflated triangle according to the provided rate
Marco De Virgilis [email protected]
Berquist, J.R. and Sherman, R.E., Loss Reserve Adequacy Testing: A Comprehensive, Systematic Approach, Proceedings of the Casualty Actuarial Society, LXIV, 1977, pp.123-184.
See also qpaid
for dealing with non-square triangles,
checkTriangleInflation
to check Y-o-Y Triangle Inflation Rates,
# Create a Triangle of Average Case O/S avg <- MedMal$MedMalOutstanding / MedMal$MedMalOpen # Select a rate of 15% and inflate the average =/S Triangle inflated_tr <- inflateTriangle(Triangle = avg, rate = .15) # Multiply it by open claims and add paymnets to calulate the adjusted Reported Claims Trinagle adj_reported <- inflated_tr * MedMal$MedMalOpen + MedMal$MedMalPaid # Calculate the IBNR from the unadjusted Triangle std_ibnr <- summary(MackChainLadder(MedMal$MedMalReported))$Totals[4, 1] # Calculate the IBNR from the adjusted Triangle adj_reported_ibnr <- summary(MackChainLadder(adj_reported))$Totals[4, 1] # Compare the two std_ibnr - adj_reported_ibnr
# Create a Triangle of Average Case O/S avg <- MedMal$MedMalOutstanding / MedMal$MedMalOpen # Select a rate of 15% and inflate the average =/S Triangle inflated_tr <- inflateTriangle(Triangle = avg, rate = .15) # Multiply it by open claims and add paymnets to calulate the adjusted Reported Claims Trinagle adj_reported <- inflated_tr * MedMal$MedMalOpen + MedMal$MedMalPaid # Calculate the IBNR from the unadjusted Triangle std_ibnr <- summary(MackChainLadder(MedMal$MedMalReported))$Totals[4, 1] # Calculate the IBNR from the adjusted Triangle adj_reported_ibnr <- summary(MackChainLadder(adj_reported))$Totals[4, 1] # Compare the two std_ibnr - adj_reported_ibnr
This function is created to facilitate the fitting of the multivariate functions when specifying different models in two different development periods, especially when separate chain-ladder is used in later periods.
Join2Fits(object1, object2)
Join2Fits(object1, object2)
object1 |
An object of class "MultiChainLadder" |
object2 |
An object of class "MultiChainLadder" |
The inputs must be of class "MultiChainLadder" because this function depends on the model
slot to determine what kind of object is to be created and returned. If both objects have "MCL"
, then an object of class "MCLFit" is created; if one has "GMCL"
and one has "MCL"
, then an object of class "GMCLFit" is created, where the one with "GMCL"
is assumed to come from the first development periods; if both have "GMCL"
, then an object of class "GMCLFit" is created.
Wayne Zhang [email protected]
See also MultiChainLadder
This function combines first momoent estimation from fitted regression models and second moment estimation from Mse
method to construct an object of class "MultiChainLadder", for which a variety of methods are defined, such as summary
and plot
.
JoinFitMse(models, mse.models)
JoinFitMse(models, mse.models)
models |
fitted regression models, either of class "MCLFit" or "GMCLFit". |
mse.models |
output from a call to |
Wayne Zhang [email protected]
See also MultiChainLadder.
Run-off triangles of General Liability and Auto Liability.
data(auto)
data(auto)
A list of two matrices, General Liability and Auto Liability respectively.
Braun C (2004). The prediction error of the chain ladder method applied to correlated run off triangles. ASTIN Bulletin 34(2): 399-423
data(liab) names(liab)
data(liab) names(liab)
This calculates the link ratio function per the CLFM paper.
LRfunction(x, y, delta)
LRfunction(x, y, delta)
x |
beginning value of loss during a development period |
y |
ending value of loss during a development period |
delta |
numeric |
Calculated the link ratios resulting from a chainladder model over a development period indexed by (possibly vector valued) real number delta. See formula (5) in the References.
A vector of link ratios.
Dan Murphy
Bardis, Majidi, Murphy. A Family of Chain-Ladder Factor Models for Selected Link Ratios. Variance. Pending. 2013. pp.tbd:tbd
x <- RAA[1:9,1] y <- RAA[1:9,2] delta <- seq(-2, 2, by = .1) plot(delta, LRfunction(x, y, delta), type = "l")
x <- RAA[1:9,1] y <- RAA[1:9,2] delta <- seq(-2, 2, by = .1) plot(delta, LRfunction(x, y, delta), type = "l")
Run off triangle of simulated incremental claims data
data(M3IR5)
data(M3IR5)
A matrix with simulated incremental claims of 14 accident years and 14 development years.
Appendix A7 in B. Zehnwirth. Probabilistic Development Factor Models with Applications to Loss Reserve Variability, Prediction Intervals, and Risk Based Capital. Casualty Actuarial Science Forum. Spring 1994. Vol. 2.
M3IR5 plot(M3IR5) plot(incr2cum(M3IR5), lattice=TRUE)
M3IR5 plot(M3IR5) plot(incr2cum(M3IR5), lattice=TRUE)
The Mack chain-ladder model forecasts future claims developments based on a historical cumulative claims development triangle and estimates the standard error around those.
MackChainLadder(Triangle, weights = 1, alpha=1, est.sigma="log-linear", tail=FALSE, tail.se=NULL, tail.sigma=NULL, mse.method="Mack")
MackChainLadder(Triangle, weights = 1, alpha=1, est.sigma="log-linear", tail=FALSE, tail.se=NULL, tail.sigma=NULL, mse.method="Mack")
Triangle |
cumulative claims triangle. Assume columns are the development
period, use transpose otherwise.
A (mxn)-matrix |
weights |
weights. Default: 1, which sets the weights for all
triangle entries to 1. Otherwise specify weights as a matrix of the same
dimension as |
alpha |
'weighting' parameters.
Default: 1 for all development periods; alpha=1 gives the historical
chain-ladder age-to-age factors, alpha=0 gives the straight average of the
observed individual development factors and alpha=2 is the result of
an ordinary regression of |
est.sigma |
defines how to estimate |
tail |
can be logical or a numeric value.
If |
tail.se |
defines how the standard error of the tail factor is estimated. Only needed if
a tail factor > 1 is provided. Default is |
tail.sigma |
defines how to estimate individual tail variability. Only needed if
a tail factor > 1 is provided.
Default is |
mse.method |
method used for the recursive estimate of the parameter risk component of the mean square error. Value "Mack" (default) coincides with Mack's formula; "Independence" includes the additional cross-product term as in Murphy and BBMW. Refer to References below. |
Following Mack's 1999 paper let denote the cumulative loss
amounts of origin period (e.g. accident year)
, with losses known for development period
(e.g. development year)
.
In order to forecast the amounts
for
the Mack chain-ladder-model assumes:
with ,
.
If these assumptions hold, the Mack chain-ladder gives an
unbiased estimator for IBNR (Incurred But Not Reported) claims.
Here
The Mack chain-ladder model can be regarded as a special form of a
weighted linear regression
through the origin for each development period:
lm(y ~ x + 0, weights=weights/x^(2-alpha))
,
where y
is the vector of claims at development period
and
x
is the vector of claims at development period
.
It is necessary, before actually applying the model, to check if the main assumptions behind the model (i.e. Calendar Year Effect and Correlation between subsequent Accident Years, see dfCorTest
, cyEffTest
) are verified.
MackChainLadder returns a list with the following elements
call |
matched call |
Triangle |
input triangle of cumulative claims |
FullTriangle |
forecasted full triangle |
Models |
linear regression models for each development period |
f |
chain-ladder age-to-age factors |
f.se |
standard errors of the chain-ladder age-to-age factors f (assumption CL1) |
F.se |
standard errors of the true chain-ladder age-to-age factors
|
sigma |
sigma parameter in CL2 |
Mack.ProcessRisk |
variability in the projection of future losses not explained by the variability of the link ratio estimators (unexplained variation) |
Mack.ParameterRisk |
variability in the projection of future losses explained by the variability of the link-ratio estimators alone (explained variation) |
Mack.S.E |
total variability in the projection of future losses
by the chain-ladder method; the square root of the mean square error
of the chain-ladder estimate: |
Total.Mack.S.E |
total variability of projected loss for all origin years combined |
Total.ProcessRisk |
vector of process risk estimate of the total of projected loss for all origin years combined by development period |
Total.ParameterRisk |
vector of parameter risk estimate of the total of projected loss for all origin years combined by development period |
weights |
weights used |
alpha |
alphas used |
tail |
tail factor used. If tail was set to TRUE the output will include the linear model used to estimate the tail factor |
Additional references for further reading:
England, PD and Verrall, RJ. Stochastic Claims Reserving in General Insurance (with discussion), British Actuarial Journal 8, III. 2002
Barnett and Zehnwirth. Best estimates for reserves. Proceedings of the CAS, LXXXVI I(167), November 2000.
Markus Gesmann [email protected]
Thomas Mack. Distribution-free calculation of the standard error of chain ladder reserve estimates. Astin Bulletin. Vol. 23. No 2. 1993. pp.213:225
Thomas Mack. The standard error of chain ladder reserve estimates: Recursive calculation and inclusion of a tail factor. Astin Bulletin. Vol. 29. No 2. 1999. pp.361:366
Murphy, Daniel M. Unbiased Loss Development Factors. Proceedings of the Casualty Actuarial Society Casualty Actuarial Society - Arlington, Virginia 1994: LXXXI 154-222
Buchwalder, Bühlmann, Merz, and Wüthrich. The Mean Square Error of Prediction in the Chain Ladder Reserving Method (Mack and Murphy Revisited). Astin Bulletin Vol. 36. 2006. pp.521:542
See also qpaid
for dealing with non-square triangles,
chainladder
for the underlying chain-ladder method,
dfCorTest
to check for Calendar Year Effect,
cyEffTest
to check for Development Factor Correlation,
summary.MackChainLadder
,
quantile.MackChainLadder
,
plot.MackChainLadder
and
residuals.MackChainLadder
displaying results,
CDR.MackChainLadder
for the one year claims development result.
## See the Taylor/Ashe example in Mack's 1993 paper GenIns plot(GenIns) plot(GenIns, lattice=TRUE) GNI <- MackChainLadder(GenIns, est.sigma="Mack") GNI$f GNI$sigma^2 GNI # compare to table 2 and 3 in Mack's 1993 paper plot(GNI) plot(GNI, lattice=TRUE) ## Different weights ## Using alpha=0 will use straight average age-to-age factors MackChainLadder(GenIns, alpha=0)$f # You get the same result via: apply(GenIns[,-1]/GenIns[,-10],2, mean, na.rm=TRUE) ## Only use the last 5 diagonals, i.e. the last 5 calendar years calPeriods <- (row(GenIns) + col(GenIns) - 1) (weights <- ifelse(calPeriods <= 5, 0, ifelse(calPeriods > 10, NA, 1))) MackChainLadder(GenIns, weights=weights, est.sigma = "Mack") ## Tail ## See the example in Mack's 1999 paper Mortgage m <- MackChainLadder(Mortgage) round(summary(m)$Totals["CV(IBNR)",], 2) ## 26% in Table 6 of paper plot(Mortgage) # Specifying the tail and its associated uncertainty parameters MRT <- MackChainLadder(Mortgage, tail=1.05, tail.sigma=71, tail.se=0.02, est.sigma="Mack") MRT plot(MRT, lattice=TRUE) # Specify just the tail and the uncertainty parameters will be estimated MRT <- MackChainLadder(Mortgage, tail=1.05) MRT$f.se[9] # close to the 0.02 specified above MRT$sigma[9] # less than the 71 specified above # Note that the overall CV dropped slightly round(summary(MRT)$Totals["CV(IBNR)",], 2) ## 24% # tail parameter uncertainty equal to expected value MRT <- MackChainLadder(Mortgage, tail=1.05, tail.se = .05) round(summary(MRT)$Totals["CV(IBNR)",], 2) ## 27% ## Parameter-risk (only) estimate of the total reserve = 3142387 tail(MRT$Total.ParameterRisk, 1) # located in last (ultimate) element # Parameter-risk (only) CV is about 19% tail(MRT$Total.ParameterRisk, 1) / summary(MRT)$Totals["IBNR", ] ## Three terms in the parameter risk estimate ## First, the default (Mack) without the tail m <- MackChainLadder(RAA, mse.method = "Mack") summary(m)$Totals["Mack S.E.",] ## Then, with the third term m <- MackChainLadder(RAA, mse.method = "Independence") summary(m)$Totals["Mack S.E.",] ## Not significantly greater ## One year claims development results M <- MackChainLadder(MW2014, est.sigma="Mack") CDR(M) ## For more examples see: ## Not run: demo(MackChainLadder) ## End(Not run)
## See the Taylor/Ashe example in Mack's 1993 paper GenIns plot(GenIns) plot(GenIns, lattice=TRUE) GNI <- MackChainLadder(GenIns, est.sigma="Mack") GNI$f GNI$sigma^2 GNI # compare to table 2 and 3 in Mack's 1993 paper plot(GNI) plot(GNI, lattice=TRUE) ## Different weights ## Using alpha=0 will use straight average age-to-age factors MackChainLadder(GenIns, alpha=0)$f # You get the same result via: apply(GenIns[,-1]/GenIns[,-10],2, mean, na.rm=TRUE) ## Only use the last 5 diagonals, i.e. the last 5 calendar years calPeriods <- (row(GenIns) + col(GenIns) - 1) (weights <- ifelse(calPeriods <= 5, 0, ifelse(calPeriods > 10, NA, 1))) MackChainLadder(GenIns, weights=weights, est.sigma = "Mack") ## Tail ## See the example in Mack's 1999 paper Mortgage m <- MackChainLadder(Mortgage) round(summary(m)$Totals["CV(IBNR)",], 2) ## 26% in Table 6 of paper plot(Mortgage) # Specifying the tail and its associated uncertainty parameters MRT <- MackChainLadder(Mortgage, tail=1.05, tail.sigma=71, tail.se=0.02, est.sigma="Mack") MRT plot(MRT, lattice=TRUE) # Specify just the tail and the uncertainty parameters will be estimated MRT <- MackChainLadder(Mortgage, tail=1.05) MRT$f.se[9] # close to the 0.02 specified above MRT$sigma[9] # less than the 71 specified above # Note that the overall CV dropped slightly round(summary(MRT)$Totals["CV(IBNR)",], 2) ## 24% # tail parameter uncertainty equal to expected value MRT <- MackChainLadder(Mortgage, tail=1.05, tail.se = .05) round(summary(MRT)$Totals["CV(IBNR)",], 2) ## 27% ## Parameter-risk (only) estimate of the total reserve = 3142387 tail(MRT$Total.ParameterRisk, 1) # located in last (ultimate) element # Parameter-risk (only) CV is about 19% tail(MRT$Total.ParameterRisk, 1) / summary(MRT)$Totals["IBNR", ] ## Three terms in the parameter risk estimate ## First, the default (Mack) without the tail m <- MackChainLadder(RAA, mse.method = "Mack") summary(m)$Totals["Mack S.E.",] ## Then, with the third term m <- MackChainLadder(RAA, mse.method = "Independence") summary(m)$Totals["Mack S.E.",] ## Not significantly greater ## One year claims development results M <- MackChainLadder(MW2014, est.sigma="Mack") CDR(M) ## For more examples see: ## Not run: demo(MackChainLadder) ## End(Not run)
Run-off triangles based on a fire portfolio
data(MCLpaid) data(MCLincurred)
data(MCLpaid) data(MCLincurred)
A matrix with 7 origin years and 7 development years.
Gerhard Quarg and Thomas Mack. Munich Chain Ladder. Blatter DGVFM. 26, Munich, 2004.
MCLpaid MCLincurred op=par(mfrow=c(2,1)) plot(MCLpaid) plot(MCLincurred) par(op)
MCLpaid MCLincurred op=par(mfrow=c(2,1)) plot(MCLpaid) plot(MCLincurred) par(op)
Run-off triangles of Medical Malpractice Data insurance.
data(MedMal)
data(MedMal)
U.S. medical malpractice insurance for an experience period of 1969 to 1976. Reported Claims, Paid Claims, Case Outstanding and Open Claims (i.e. the number of outstanding claims) respectively
Berquist, J.R. and Sherman, R.E., Loss Reserve Adequacy Testing: A Comprehensive, Systematic Approach, Proceedings of the Casualty Actuarial Society, LXIV, 1977, pp.123-184.
data(MedMal) names(MedMal) MedMal$MedMalReported MedMal$MedMalPaid MedMal$MedMalOutstanding MedMal$MedMalOpen
data(MedMal) names(MedMal) MedMal$MedMalReported MedMal$MedMalPaid MedMal$MedMalOutstanding MedMal$MedMalOpen
Development triangle of a mortgage guarantee business
data(Mortgage)
data(Mortgage)
A matrix with 9 accident years and 9 development years.
Competition Presented at a London Market Actuaries Dinner, D.E.A. Sanders, 1990
See table 4 in: Distribution-free Calculation of the Standard Error of Chain Ladder Reserve Estimates, Thomas Mack, 1993, ASTIN Bulletin 23, 213 - 225
Mortgage Mortgage plot(Mortgage) plot(Mortgage, lattice=TRUE)
Mortgage Mortgage plot(Mortgage) plot(Mortgage, lattice=TRUE)
Mse
is a generic function to calculate mean square error estimations in the chain-ladder framework.
Mse(ModelFit, FullTriangles, ...) ## S4 method for signature 'GMCLFit,triangles' Mse(ModelFit, FullTriangles, ...) ## S4 method for signature 'MCLFit,triangles' Mse(ModelFit, FullTriangles, mse.method="Mack", ...)
Mse(ModelFit, FullTriangles, ...) ## S4 method for signature 'GMCLFit,triangles' Mse(ModelFit, FullTriangles, ...) ## S4 method for signature 'MCLFit,triangles' Mse(ModelFit, FullTriangles, mse.method="Mack", ...)
ModelFit |
An object of class "GMCLFit" or "MCLFit". |
FullTriangles |
An object of class "triangles". Should be the output from a call of |
mse.method |
Character strings that specify the MSE estimation method. Only works for "MCLFit". Use |
... |
Currently not used. |
These functions calculate the conditional mean square errors using the recursive formulas in Zhang (2010), which is a generalization of the Mack (1993, 1999) formulas. In the GMCL model, the conditional mean square error for single accident years and aggregated accident years are calcualted as:
In the MCL model, the conditional mean square error from Merz and Wüthrich (2008) is also available, which can be shown to be equivalent as the following:
For the Mack approach in the MCL model, the cross-product term in the above two formulas will drop out.
Mse
returns an object of class "MultiChainLadderMse" that has the following elements:
mse.ay |
condtional mse for each accdient year |
mse.ay.est |
conditional estimation mse for each accdient year |
mse.ay.proc |
conditional process mse for each accdient year |
mse.total |
condtional mse for aggregated accdient years |
mse.total.est |
conditional estimation mse for aggregated accdient years |
mse.total.proc |
conditional process mse for aggregated accdient years |
FullTriangles |
completed triangles |
Wayne Zhang [email protected]
Zhang Y (2010). A general multivariate chain ladder model.Insurance: Mathematics and Economics, 46, pp. 588-599.
Zhang Y (2010). Prediction error of the general multivariate chain ladder model.
See also MultiChainLadder.
The function MultiChainLadder
implements multivariate methods to forecast insurance loss payments based on several cumulative claims development triangles. These methods are multivariate extensions of the chain-ladder technique, which develop several correlated triangles simultaneously in a way that both contemporaneous correlations and structural relationships can be accounted for. The estimated conditional Mean Square Errors (MSE) are also produced.
MultiChainLadder(Triangles, fit.method = "SUR", delta = 1, int = NULL, restrict.regMat = NULL, extrap = TRUE, mse.method = "Mack", model = "MCL", ...) MultiChainLadder2(Triangles, mse.method = "Mack", last = 3, type = c("MCL", "MCL+int", "GMCL-int", "GMCL"), ...)
MultiChainLadder(Triangles, fit.method = "SUR", delta = 1, int = NULL, restrict.regMat = NULL, extrap = TRUE, mse.method = "Mack", model = "MCL", ...) MultiChainLadder2(Triangles, mse.method = "Mack", last = 3, type = c("MCL", "MCL+int", "GMCL-int", "GMCL"), ...)
Triangles |
a list of cumulative claims triangles of the same dimensions. |
fit.method |
the method used to fit the multivariate regression in each development period. The default is |
delta |
parameter for controlling weights. It is used to determine the covariance structure |
int |
a numeric vector that indicates which development periods have intercepts specified. This only takes effect for |
restrict.regMat |
a list of matrix specifying parameter restriction matrix for each period. This is only used for |
extrap |
a logical value indicating whether to use Mack's extrapolation method for the last period to get the residual variance estimation. It only takes effect for |
mse.method |
method to estimate the mean square error. It can be either |
model |
the structure of the model to be fitted. It is either |
last |
an integer. The |
type |
the type of the model structure to be specified for the first part of the split model in |
... |
arguments passed to |
This function implements multivariate loss reserving models within the chain-ladder framework. Two major models are included. One is the Multivariate chain-ladder (MCL) model proposed by Prohl and Schmidt (2005). This is a direct multivariate generalization of the univariate chain-ladder model in that losses from different triangles are assumed to be correlated but the mean development in one triangle only depends on its past values, not on the observed values from other triangles. In contrast, the other model, the General Multivariate chain-ladder (GMCL) model outlined in Zhang (2010), extends the MCL model by allowing development dependencies among different triangles as well as the inclusion of regression intercepts. As a result, structurally related triangles, such as the paid and incurred loss triangles or the paid loss and case reserve triangles, can be developed together while still accounting for the potential contemporaneous correlations. While the MCL model is a special case of the GMCL model, it is programmed and listed separately because: a) it is an important model for its own sake; b) different MSE methods are only available for the MCL model; c) extrapolation of the residual variance estimation can be implemented for the MCL model, which is considerably difficult for the GMCL model.
We introduce some details of the GMCL model in the following. Assume N triangles are available. Denote as an
vector of cumulative losses at accident year i and development year k, where (n) refers to the n-th triangle. The GMCL model in development period k (from development year k to year k+1) is:
where is a column of intercepts and
is the
development matrix. By default,
MultiChainLadder
sets to be zero. This behavior can be changed by appropriately specifying the
int
argument.
Assumptions for this model are:
The GMCL model structure is generally over-parameterized. Parameter restrictions are usually necessary for the estimation to be feasible, which can be specified through the restrict.regMat
argument. We refer the users to the documentation for systemfit
for details and the demo of the present function for examples.
In particular, if one restricts the development matrix to be diagonal, the GMCL model will reduce to the MCL model. When non-diagonal development matrix is used and the GMCL model is applied to paid and incurred loss triangles, it can reflect the development relationship between the two triangles, as described in Quarg and Mack (2004). The full bivariate model is identical to the "double regression" model described by Mack (2003), which is argued by him to be very similar to the Munich chain-ladder (MuCL) model. The GMCL model with intercepts can also help improve model adequacy as described in Barnett and Zehnwirth (2000).
Currently, the GMCL model only works for trapezoid data, and only implements mse.method = "Mack"
. The MCL model allows an additional mse estimation method that assumes independence among the estimated parameters. Further, the MCL model using fit.method = "OLS"
will be equivalent to running univariate chain-ladders separately on each triangle. Indeed, when only one triangle is specified (as a list), the MCL model is equivalent to MackChainLadder
.
The GMCL model allows different model structures to be specified in each development period. This is generally achieved through the combination of the int
argument, which specifies the periods that have intercepts, and the restrict.regMat
argument, which imposes parameter restrictions on the development matrix.
In using the multivariate methods, we often specify separate univariate chain-ladders for the tail periods to stabilize the estimation - there are few data points in the tail and running a multivariate model often produces extremely volatile estimates or even fails. In this case, we can use the subset operator "["
defined for class triangles
to split the input data into two parts. We can specify a multivariate model with rich structures on the first part to reflect the multivariate dependencies, and simply apply multiple univariate chain-ladders on the second part. The two models are subsequently joined together using the Join2Fits
function. We can then invoke the predict
and Mse
methods to produce loss predictions and mean square error estimations. They can further be combined via the JoinFitMse
function to construct an object of class MultiChainLadder
. See the demo for such examples.
To facilitate such a split-and-join process for most applications, we have created the function MultiChainLadder2
. This function splits the data according to the last
argument (e.g., if last = 3
, the last three periods go into the second part), and fits the first part according to the structure indicated in the type
argument. See the 'Arguments' section for details.
MultiChainLadder
returns an object of class MultiChainLadder
with the following slots:
model |
the model structure used, either |
Triangles |
input triangles of cumulative claims that are converted to class |
models |
fitted models for each development period. This is the output from the call of |
coefficients |
estimated regression coefficients or development parameters. They are put into the matrix format for the GMCL model. |
coefCov |
estimated variance-covariance matrix for the regression coefficients. |
residCov |
estimated residual covariance matrix. |
fit.method |
multivariate regression estimation method |
delta |
the value of delta |
mse.ay |
mean square error matrix for each accident year |
mse.ay.est |
estimation error matrix for each accident year |
mse.ay.proc |
process error matrix for each accident year |
mse.total |
mean square error matrix for all accident years combined |
mse.total.est |
estimation error matrix for all accident years combined |
mse.total.proc |
process error matrix for all accident years combined |
FullTriangles |
the forecasted full triangles of class |
int |
intercept indicators |
When MultiChainLadder
or MultiChainLadder2
fails, the most possible reason is that there is little or no development in the tail periods. That is, the development factor is 1
or almost equal to 1
. In this case, the systemfit
function may fail even for fit.method = "OLS"
, because the residual covariance matrix is singular. The simplest solution is to remove these columns using the
"["
operator and fit the model on the remaining part.
Also, we recommend the use of MultiChainLadder2
over MultiChainLadder
. The function MultiChainLadder2
meets the need for most applications, is relatively easy to use and produces more stable but very similar results to MultiChainLadder
. Use MultiChainLadder
only when non-standard situation arises, e.g., when different parameter restrictions are needed for different periods. See the demo for such examples.
Wayne Zhang [email protected]
Buchwalder M, Bühlmann H, Merz M, Wüthrich M.V (2006). The mean square error of prediction in the chain-ladder reserving method (Mack and Murphy revisited), ASTIN Bulletin, 36(2), 521-542.
Prohl C, Schmidt K.D (2005). Multivariate chain-ladder, Dresdner Schriften zur Versicherungsmathematik.
Mack T (1993). Distribution-free calculation of the standard error, ASTIN Bulletin, 23, No.2.
Mack T (1999). The standard error of chain-ladder reserve estimates: recursive calculation and inclusion of a tail factor, ASTIN Bulletin, 29, No.2, 361-366.
Merz M, Wüthrich M (2008). Prediction error of the multivariate chain ladder reserving method, North American Actuarial Journal, 12, No.2, 175-197.
Zhang Y (2010). A general multivariate chain-ladder model.Insurance: Mathematics and Economics, 46, pp. 588-599.
Zhang Y (2010). Prediction error of the general multivariate chain ladder model.
See also MackChainLadder
, MunichChainLadder
, triangles
, MultiChainLadder
, summary,MultiChainLadder-method
and plot,MultiChainLadder,missing-method
.
# This shows that the MCL model using "OLS" is equivalent to # the MackChainLadder when applied to one triangle data(GenIns) (U1 <- MackChainLadder(GenIns, est.sigma = "Mack")) (U2 <- MultiChainLadder(list(GenIns), fit.method = "OLS")) # show plots parold <- par(mfrow = c(2, 2)) plot(U2, which.plot = 1:4) plot(U2, which.plot = 5) par(parold) # For mse.method = "Independence", the model is equivalent # to that in Buchwalder et al. (2006) (B1 <- MultiChainLadder(list(GenIns), fit.method = "OLS", mse.method = "Independence")) # use the unbiased residual covariance estimator # in Merz and Wuthrich (2008) (W1 <- MultiChainLadder2(liab, mse.method = "Independence", control = systemfit::systemfit.control(methodResidCov = "Theil"))) ## Not run: # use the iterative residual covariance estimator for (i in 1:5){ W2 <- MultiChainLadder2(liab, mse.method = "Independence", control = systemfit::systemfit.control( methodResidCov = "Theil", maxiter = i)) print(format(summary(W2)@report.summary[[3]][15, 4:5], digits = 6, big.mark = ",")) } # The following fits an MCL model with intercepts for years 1:7 # and separate chain-ladder models for the rest periods f1 <- MultiChainLadder2(auto, type = "MCL+int") # compare with the model without intercepts through residual plots f0 <- MultiChainLadder2(auto, type = "MCL") parold <- par(mfrow = c(2, 3), mar = c(3, 3, 2, 1)) mt <- list(c("Personal Paid", "Personal Incured", "Commercial Paid")) plot(f0, which.plot = 3, main = mt) plot(f1, which.plot = 3, main = mt) par(parold) ## summary statistics summary(f1, portfolio = "1+3")@report.summary[[4]] # model for joint development of paid and incurred triangles da <- auto[1:2] # MCL with diagonal development M0 <- MultiChainLadder(da) # non-diagonal development matrix with no intercepts M1 <- MultiChainLadder2(da, type = "GMCL-int") # Munich chain-ladder M2 <- MunichChainLadder(da[[1]], da[[2]]) # compile results and compare projected paid to incurred ratios r1 <- lapply(list(M0, M1), function(x){ ult <- summary(x)@Ultimate ult[, 1] / ult[, 2] }) names(r1) <- c("MCL", "GMCL") r2 <- summary(M2)[[1]][, 6] r2 <- c(r2, summary(M2)[[2]][2, 3]) print(do.call(cbind, c(r1, list(MuCl = r2))) * 100, digits = 4) ## End(Not run) # To reproduce results in Zhang (2010) and see more examples, use: ## Not run: demo(MultiChainLadder) ## End(Not run)
# This shows that the MCL model using "OLS" is equivalent to # the MackChainLadder when applied to one triangle data(GenIns) (U1 <- MackChainLadder(GenIns, est.sigma = "Mack")) (U2 <- MultiChainLadder(list(GenIns), fit.method = "OLS")) # show plots parold <- par(mfrow = c(2, 2)) plot(U2, which.plot = 1:4) plot(U2, which.plot = 5) par(parold) # For mse.method = "Independence", the model is equivalent # to that in Buchwalder et al. (2006) (B1 <- MultiChainLadder(list(GenIns), fit.method = "OLS", mse.method = "Independence")) # use the unbiased residual covariance estimator # in Merz and Wuthrich (2008) (W1 <- MultiChainLadder2(liab, mse.method = "Independence", control = systemfit::systemfit.control(methodResidCov = "Theil"))) ## Not run: # use the iterative residual covariance estimator for (i in 1:5){ W2 <- MultiChainLadder2(liab, mse.method = "Independence", control = systemfit::systemfit.control( methodResidCov = "Theil", maxiter = i)) print(format(summary(W2)@report.summary[[3]][15, 4:5], digits = 6, big.mark = ",")) } # The following fits an MCL model with intercepts for years 1:7 # and separate chain-ladder models for the rest periods f1 <- MultiChainLadder2(auto, type = "MCL+int") # compare with the model without intercepts through residual plots f0 <- MultiChainLadder2(auto, type = "MCL") parold <- par(mfrow = c(2, 3), mar = c(3, 3, 2, 1)) mt <- list(c("Personal Paid", "Personal Incured", "Commercial Paid")) plot(f0, which.plot = 3, main = mt) plot(f1, which.plot = 3, main = mt) par(parold) ## summary statistics summary(f1, portfolio = "1+3")@report.summary[[4]] # model for joint development of paid and incurred triangles da <- auto[1:2] # MCL with diagonal development M0 <- MultiChainLadder(da) # non-diagonal development matrix with no intercepts M1 <- MultiChainLadder2(da, type = "GMCL-int") # Munich chain-ladder M2 <- MunichChainLadder(da[[1]], da[[2]]) # compile results and compare projected paid to incurred ratios r1 <- lapply(list(M0, M1), function(x){ ult <- summary(x)@Ultimate ult[, 1] / ult[, 2] }) names(r1) <- c("MCL", "GMCL") r2 <- summary(M2)[[1]][, 6] r2 <- c(r2, summary(M2)[[2]][2, 3]) print(do.call(cbind, c(r1, list(MuCl = r2))) * 100, digits = 4) ## End(Not run) # To reproduce results in Zhang (2010) and see more examples, use: ## Not run: demo(MultiChainLadder) ## End(Not run)
This class includes the first and second moment estimation result using the multivariate reserving methods in chain-ladder. Several primitive methods and statistical methods are also created to facilitate further analysis.
Objects can be created by calls of the form new("MultiChainLadder", ...)
, or they could also be a result of calls from MultiChainLadder
or JoinFitMse
.
model
:Object of class "character"
. Either "MCL" or "GMCL".
Triangles
:Object of class "triangles"
. Input triangles.
models
:Object of class "list"
. Fitted regression models using systemfit
.
coefficients
:Object of class "list"
. Estimated regression coefficients.
coefCov
:Object of class "list"
. Estimated variance-covariance matrix of coefficients.
residCov
:Object of class "list"
. Estimated residual covariance matrix.
fit.method
:Object of class "character"
. Could be values of "SUR" or "OLS".
delta
:Object of class "numeric"
. Parameter for weights.
int
:Object of class "NullNum"
. Indicator of which periods have intercepts.
mse.ay
:Object of class "matrix"
. Conditional mse for each accident year.
mse.ay.est
:Object of class "matrix"
. Conditional estimation mse for each accident year.
mse.ay.proc
:Object of class "matrix"
. Conditional process mse for each accident year.
mse.total
:Object of class "matrix"
. Conditional mse for aggregated accident years.
mse.total.est
:Object of class "matrix"
. Conditional estimation mse for aggregated accident years.
mse.total.proc
:Object of class "matrix"
. Conditional process mse for aggregated accident years.
FullTriangles
:Object of class "triangles"
. Completed triangles.
restrict.regMat
:Object of class "NullList"
Class "MultiChainLadderFit"
, directly.
Class "MultiChainLadderMse"
, directly.
signature(x = "MultiChainLadder")
: Method for primitive function "$"
. It extracts a slot of x
with a specified slot name, just as in list.
signature(x = "MultiChainLadder", i = "numeric", j = "missing")
: Method for primitive function "[["
. It extracts the i-th slot of a "MultiChainLadder"
object, just as in list. i
could be a vector.
signature(x = "MultiChainLadder", i = "character", j = "missing")
: Method for primitive function "[["
. It extracts the slots of a "MultiChainLadder"
object with names in i
, just as in list. i
could be a vector.
signature(object = "MultiChainLadder")
: Method for function coef
, to extract the estimated development matrix. The output is a list.
signature(object = "MultiChainLadder")
: Method for function fitted
, to calculate the fitted values in the original triangles. Note that the return value is a list of fitted valued based on the original scale, not the model scale which is first divided by .
signature(x = "MultiChainLadder")
: Method for function names
, which returns the slot names of a "MultiChainLadder"
object.
signature(x = "MultiChainLadder", y = "missing")
: See plot,MultiChainLadder,missing-method
.
signature(object = "MultiChainLadder")
: S4 generic function and method to extract residual covariance from a "MultiChainLadder"
object.
signature(object = "MultiChainLadder")
: S4 generic function and method to extract residual correlation from a "MultiChainLadder"
object.
signature(object = "MultiChainLadder")
: Method for function residuals
, to extract residuals from a system of regression equations. These residuals are based on model scale, and will not be equivalent to those on the original scale if is not set to be 0. One should use
rstandard
instead, which is independent of the scale.
signature(object = "MultiChainLadder")
: Same as residuals
.
signature(model = "MultiChainLadder")
: S4 generic function and method to extract standardized residuals from a "MultiChainLadder"
object.
signature(object = "MultiChainLadder")
: Method for show
.
signature(object = "MultiChainLadder")
: See summary,MultiChainLadder-method
.
signature(object = "MultiChainLadder")
: Method for function vcov
, to extract the variance-covariance matrix of a "MultiChainLadder"
object. Note that the result is a list of Bcov
, that is the variance-covariance matrix of the vectorized .
Wayne Zhang [email protected]
See also MultiChainLadder
,summary,MultiChainLadder-method
and plot,MultiChainLadder,missing-method
.
# example for class "MultiChainLadder" data(liab) fit.liab <- MultiChainLadder(Triangles = liab) fit.liab names(fit.liab) fit.liab[[1]] fit.liab$model fit.liab@model do.call("rbind",coef(fit.liab)) vcov(fit.liab)[[1]] residCov(fit.liab)[[1]] head(do.call("rbind",rstandard(fit.liab)))
# example for class "MultiChainLadder" data(liab) fit.liab <- MultiChainLadder(Triangles = liab) fit.liab names(fit.liab) fit.liab[[1]] fit.liab$model fit.liab@model do.call("rbind",coef(fit.liab)) vcov(fit.liab)[[1]] residCov(fit.liab)[[1]] head(do.call("rbind",rstandard(fit.liab)))
"MultiChainLadderFit" is a virtual class for the fitted models in the multivariate chain ladder reserving framework, "MCLFit" is a result from the interal call .FitMCL
to store results in model MCL
and "GMCLFit" is a result from the interal call .FitGMCL
to store results in model GMCL
. The two classes "MCLFit" and "GMCLFit" differ only in the presentation of and
, and different methods of
Mse
and predict
will be dispatched according to these classes.
"MultiChainLadderFit" is a virtual Class: No objects may be created from it. For "MCLFit" and "GMCLFit", objects can be created by calls of the form new("MCLFit", ...)
and new("GMCLFit", ...)
respectively.
Triangles
:Object of class "triangles"
models
:Object of class "list"
B
:Object of class "list"
Bcov
:Object of class "list"
ecov
:Object of class "list"
fit.method
:Object of class "character"
delta
:Object of class "numeric"
int
:Object of class "NullNum"
restrict.regMat
:Object of class "NullList"
"MCLFit" and "GMCLFit" extends class "MultiChainLadderFit"
, directly.
No methods defined with class "MultiChainLadderFit" in the signature.
For "MCLFit", the following methods are defined:
Mse
signature(ModelFit = "MCLFit", FullTriangles = "triangles")
: Calculate Mse estimations.
predict
signature(object = "MCLFit")
: Predict ultimate losses and complete the triangles. The output is an object of class "triangles".
For "GMCLFit", the following methods are defined:
Mse
signature(ModelFit = "GMCLFit", FullTriangles = "triangles")
: Calculate Mse estimations.
predict
signature(object = "GMCLFit")
: Predict ultimate losses and complete the triangles. The output is an object of class "triangles".
Wayne Zhang [email protected]
See also Mse
.
showClass("MultiChainLadderFit")
showClass("MultiChainLadderFit")
This class is used to define the structure in storing the MSE results.
Objects can be created by calls of the form new("MultiChainLadderMse", ...)
, or as a result of a call to Mse
.
mse.ay
:Object of class "matrix"
mse.ay.est
:Object of class "matrix"
mse.ay.proc
:Object of class "matrix"
mse.total
:Object of class "matrix"
mse.total.est
:Object of class "matrix"
mse.total.proc
:Object of class "matrix"
FullTriangles
:Object of class "triangles"
No methods defined with class "MultiChainLadderMse" in the signature.
Wayne Zhang [email protected]
See Also MultiChainLadder
and Mse
.
showClass("MultiChainLadderMse")
showClass("MultiChainLadderMse")
This class stores the summary statistics from a "MultiChainLadder" object. These summary statistics include both model summary and report summary.
Objects can be created by calls of the form new("MultiChainLadderSummary", ...)
, or a call from summary
.
Triangles
:Object of class "triangles"
FullTriangles
:Object of class "triangles"
S.E.Full
:Object of class "list"
S.E.Est.Full
:Object of class "list"
S.E.Proc.Full
:Object of class "list"
Ultimate
:Object of class "matrix"
IBNR
:Object of class "matrix"
S.E.Ult
:Object of class "matrix"
S.E.Est.Ult
:Object of class "matrix"
S.E.Proc.Ult
:Object of class "matrix"
report.summary
:Object of class "list"
coefficients
:Object of class "list"
coefCov
:Object of class "list"
residCov
:Object of class "list"
rstandard
:Object of class "matrix"
fitted.values
:Object of class "matrix"
residCor
:Object of class "matrix"
model.summary
:Object of class "matrix"
portfolio
:Object of class "NullChar"
signature(x = "MultiChainLadderSummary")
: Method for primitive function "$"
. It extracts a slot of x
with a specified slot name, just as in list.
signature(x = "MultiChainLadderSummary", i = "numeric", j = "missing")
: Method for primitive function "[["
. It extracts the i-th slot of a "MultiChainLadder"
object, just as in list. i
could be a vetor.
signature(x = "MultiChainLadderSummary", i = "character", j = "missing")
: Method for primitive function "[["
. It extracts the slots of a "MultiChainLadder"
object with names in i
, just as in list. i
could be a vetor.
signature(x = "MultiChainLadderSummary")
: Method for function names
, which returns the slot names of a "MultiChainLadder"
object.
signature(object = "MultiChainLadderSummary")
: Method for show
.
Wayne Zhang [email protected]
See also summary,MultiChainLadder-method
, MultiChainLadder-class
showClass("MultiChainLadderSummary")
showClass("MultiChainLadderSummary")
The Munich-chain-ladder model forecasts ultimate claims based on a cumulative
paid and incurred claims triangle.
The model assumes that the Mack-chain-ladder model is applicable
to the paid and incurred claims triangle, see MackChainLadder
.
MunichChainLadder(Paid, Incurred, est.sigmaP = "log-linear", est.sigmaI = "log-linear", tailP=FALSE, tailI=FALSE, weights=1)
MunichChainLadder(Paid, Incurred, est.sigmaP = "log-linear", est.sigmaI = "log-linear", tailP=FALSE, tailI=FALSE, weights=1)
Paid |
cumulative paid claims triangle. Assume columns are the development
period, use transpose otherwise. A (mxn)-matrix |
Incurred |
cumulative incurred claims triangle. Assume columns are the development
period, use transpose otherwise. A (mxn)-matrix
|
est.sigmaP |
defines how |
est.sigmaI |
defines how |
tailP |
defines how the tail of the |
tailI |
defines how the tail of the |
weights |
weights. Default: 1, which sets the weights for all triangle entries to 1. Otherwise specify weights as a matrix of the same dimension as Triangle with all weight entries in [0; 1]. Hence, any entry set to 0 or NA eliminates that age-to-age factor from inclusion in the model. See also 'Details' in MackChainladder function. The weight matrix is the same for Paid and Incurred. |
MunichChainLadder returns a list with the following elements
call |
matched call |
Paid |
input paid triangle |
Incurred |
input incurred triangle |
MCLPaid |
Munich-chain-ladder forecasted full triangle on paid data |
MCLIncurred |
Munich-chain-ladder forecasted full triangle on incurred data |
MackPaid |
Mack-chain-ladder output of the paid triangle |
MackIncurred |
Mack-chain-ladder output of the incurred triangle |
PaidResiduals |
paid residuals |
IncurredResiduals |
incurred residuals |
QResiduals |
paid/incurred residuals |
QinverseResiduals |
incurred/paid residuals |
lambdaP |
dependency coefficient between paid chain-ladder age-to-age factors and incurred/paid age-to-age factors |
lambdaI |
dependency coefficient between incurred chain-ladder ratios and paid/incurred ratios |
qinverse.f |
chain-ladder-link age-to-age factors of the incurred/paid triangle |
rhoP.sigma |
estimated conditional deviation around the paid/incurred age-to-age factors |
q.f |
chain-ladder age-to-age factors of the paid/incurred triangle |
rhoI.sigma |
estimated conditional deviation around the incurred/paid age-to-age factors |
Markus Gesmann [email protected]
Gerhard Quarg and Thomas Mack. Munich Chain Ladder. Blatter DGVFM 26, Munich, 2004.
See also
summary.MunichChainLadder
,
plot.MunichChainLadder
,
MackChainLadder
MCLpaid MCLincurred op <- par(mfrow=c(1,2)) plot(MCLpaid) plot(MCLincurred) par(op) # Following the example in Quarg's (2004) paper: MCL <- MunichChainLadder(MCLpaid, MCLincurred, est.sigmaP=0.1, est.sigmaI=0.1) MCL plot(MCL) # You can access the standard chain-ladder (Mack) output via MCL$MackPaid MCL$MackIncurred # Input triangles section 3.3.1 MCL$Paid MCL$Incurred # Parameters from section 3.3.2 # Standard chain-ladder age-to-age factors MCL$MackPaid$f MCL$MackIncurred$f MCL$MackPaid$sigma MCL$MackIncurred$sigma # Check Mack's assumptions graphically plot(MCL$MackPaid) plot(MCL$MackIncurred) MCL$q.f MCL$rhoP.sigma MCL$rhoI.sigma MCL$PaidResiduals MCL$IncurredResiduals MCL$QinverseResiduals MCL$QResiduals MCL$lambdaP MCL$lambdaI # Section 3.3.3 Results MCL$MCLPaid MCL$MCLIncurred
MCLpaid MCLincurred op <- par(mfrow=c(1,2)) plot(MCLpaid) plot(MCLincurred) par(op) # Following the example in Quarg's (2004) paper: MCL <- MunichChainLadder(MCLpaid, MCLincurred, est.sigmaP=0.1, est.sigmaI=0.1) MCL plot(MCL) # You can access the standard chain-ladder (Mack) output via MCL$MackPaid MCL$MackIncurred # Input triangles section 3.3.1 MCL$Paid MCL$Incurred # Parameters from section 3.3.2 # Standard chain-ladder age-to-age factors MCL$MackPaid$f MCL$MackIncurred$f MCL$MackPaid$sigma MCL$MackIncurred$sigma # Check Mack's assumptions graphically plot(MCL$MackPaid) plot(MCL$MackIncurred) MCL$q.f MCL$rhoP.sigma MCL$rhoI.sigma MCL$PaidResiduals MCL$IncurredResiduals MCL$QinverseResiduals MCL$QResiduals MCL$lambdaP MCL$lambdaI # Section 3.3.3 Results MCL$MCLPaid MCL$MCLIncurred
Cumulative claims development triangle
A matrix with 9 accident years and 9 development years.
Modelling the claims development result for solvency purposes. Michael Merz, Mario V. Wüthrich. Casualty Actuarial Society E-Forum, Fall 2008.
MW2008 plot(MW2008, lattice=TRUE)
MW2008 plot(MW2008, lattice=TRUE)
Cumulative claims development triangle
A matrix with 17 accident years and 17 development years.
Claims Run-Off Uncertainty: The Full Picture. Michael Merz, Mario V. Wüthrich. Swiss Finance Institute Research Paper No. 14-69. https://www.ssrn.com/abstract=2524352. 2014
MW2014 plot(MW2014, lattice=TRUE)
MW2014 plot(MW2014, lattice=TRUE)
Virtual class for c("null", "numeric")
, c("null","character"
and c("null","list"
A virtual Class: No objects may be created from it.
No methods defined with class "NullNum" in the signature.
The Paid-incurred Chain model (Merz, Wuthrich (2010)) combines claims payments and incurred losses information to get a unified ultimate loss prediction.
PaidIncurredChain(triangleP, triangleI)
PaidIncurredChain(triangleP, triangleI)
triangleP |
Cumulative claims payments triangle |
triangleI |
Incurred losses triangle. |
The method uses some basic properties of multivariate Gaussian distributions to obtain a mathematically rigorous and consistent model for the combination of the two information channels.
We assume as usual that I=J. The model assumptions for the Log-Normal PIC Model are the following:
Conditionally, given
we have
the random vector has multivariate Gaussian distribution
with uncorrelated components given by
cumulative payments are given by the recursion
with initial value ;
incurred losses are given by the backwards
recursion
with initial value .
The components of are independent and
for all j.
Parameters in the model are in general not known and need to be
estimated from observations. They are estimated in a Bayesian framework.
In the Bayesian PIC model they assume that the previous assumptions
hold true with deterministic
and
and
This is not a full Bayesian approach but has the advantage to give analytical expressions for the posterior distributions and the prediction uncertainty.
The function returns:
Ult.Loss.Origin Ultimate losses for different origin years.
Ult.Loss Total ultimate loss.
Res.Origin Claims reserves for different origin years.
Res.Tot Total reserve.
s.e. Square root of mean square error of prediction for the total ultimate loss.
The model is implemented in the special case of non-informative priors.
Fabio Concina, [email protected]
Merz, M., Wuthrich, M. (2010). Paid-incurred chain claims reserving method. Insurance: Mathematics and Economics, 46(3), 568-579.
MackChainLadder
,MunichChainLadder
PaidIncurredChain(USAApaid, USAAincurred)
PaidIncurredChain(USAApaid, USAAincurred)
Methods for function plot
to produce different diagonostic plots for an object of class "MultiChainLadder".
## S4 method for signature 'MultiChainLadder,missing' plot(x, y, which.plot=1:4, which.triangle=NULL, main=NULL, portfolio=NULL, lowess=TRUE, legend.cex=0.75,...)
## S4 method for signature 'MultiChainLadder,missing' plot(x, y, which.plot=1:4, which.triangle=NULL, main=NULL, portfolio=NULL, lowess=TRUE, legend.cex=0.75,...)
x |
An object of class "MultiChainLadder". |
y |
"missing" |
which.plot |
This specifies which type of plot is desired. Its range is 1:5, but defaults to 1:4. "1" is the barplot of observed losses and predicted IBNR stacked and MSE predictions as error bars; "2" is a trajectory plot of the development pattern; "3" is the residual plot of standardized residuals against the fitted values; "4" is the Normal-QQ plot of the standardized residuals. "5" is the "xyplot" of development with confidence intervals for each accident year. Note that "3" and "4" are not available for portfolio. |
which.triangle |
This specifies which triangles are to be plotted. Default value is NULL, where all triangles plus the portfolio result will be plotted. |
main |
It should be a list of titles for each plot. If not supplied, use default titles. |
portfolio |
It specifies which triangles are to be summed as the portfolio, to be passed on to |
lowess |
Logical. If |
legend.cex |
plotting parameter to be passes on to |
... |
optional graphical arguments. |
See also MultiChainLadder
## Not run: data(liab) fit.liab <- MultiChainLadder(liab) # generate diagonostic plots par(mfcol=(c(3,2))) plot(fit.liab,which.plot=1:2) par(mfrow=(c(2,2))) plot(fit.liab,which.plot=3:4) plot(fit.liab,which.triangle=1,which.plot=5) graphics.off() ## End(Not run)
## Not run: data(liab) fit.liab <- MultiChainLadder(liab) # generate diagonostic plots par(mfcol=(c(3,2))) plot(fit.liab,which.plot=1:2) par(mfrow=(c(2,2))) plot(fit.liab,which.plot=3:4) plot(fit.liab,which.triangle=1,which.plot=5) graphics.off() ## End(Not run)
plot.BootChainLadder
, a method to plot the output of
BootChainLadder
. It is designed to give a quick overview
of a BootChainLadder
object and to check the model assumptions.
## S3 method for class 'BootChainLadder' plot(x, mfrow=NULL, title=NULL, log=FALSE, which=1:4, ...)
## S3 method for class 'BootChainLadder' plot(x, mfrow=NULL, title=NULL, log=FALSE, which=1:4, ...)
x |
output from |
mfrow |
see |
title |
see |
log |
logical. If |
which |
if a subset of the plots is required, specify a subset of the numbers 1:4. |
... |
optional arguments. See |
plot.BootChainLadder
shows four graphs, starting with a histogram
of the total simulated IBNRs over all origin periods, including a rug
plot; a plot of the empirical cumulative distribution of the total
IBNRs over all origin periods; a box-whisker plot of simulated ultimate
claims costs against origin periods; and a box-whisker plot of
simulated incremental claims cost for the latest available calendar period
against actual incremental claims of the same period. In the last plot
the simulated data should follow the same trend as the actual data,
otherwise the original data might have some intrinsic trends which are
not reflected in the model.
The box-whisker plot of latest actual incremental claims against simulated claims follows is based on ideas from Barnett and Zehnwirth in: Barnett and Zehnwirth. The need for diagnostic assessment of bootstrap predictive models, Insureware technical report. 2007
Markus Gesmann
See also BootChainLadder
B <- BootChainLadder(RAA) plot(B) plot(B, log=TRUE)
B <- BootChainLadder(RAA) plot(B) plot(B, log=TRUE)
plot.checkTriangleInflation
, a method to plot the output of
checkTriangleInflation
. It is designed to give a quick overview
of a checkTriangleInflation
object and to check the inflation regression curves.
## S3 method for class 'checkTriangleInflation' plot(x, col.line = "black", type = "b", xlab = "dev. period", ylab = NULL, ...)
## S3 method for class 'checkTriangleInflation' plot(x, col.line = "black", type = "b", xlab = "dev. period", ylab = NULL, ...)
x |
output from |
col.line |
Default: "black". Line color |
type |
Default: "b". What type of plot should be drawn |
xlab |
Default: "dev. period". X axis label |
ylab |
Default: NULL. Y axis label |
... |
optional arguments. See |
plot.cyeff.test
plots all the columns of the triangle (Development Periods) against the regression curves.
Marco De Virgilis [email protected]
See Also checkTriangleInflation
,
summary.checkTriangleInflation
test <- checkTriangleInflation(MedMal$MedMalOutstanding / MedMal$MedMalOpen) plot(test)
test <- checkTriangleInflation(MedMal$MedMalOutstanding / MedMal$MedMalOpen) plot(test)
Function to plot the residuals of the Clark LDF and Cape Cod methods.
## S3 method for class 'clark' plot(x, ...)
## S3 method for class 'clark' plot(x, ...)
x |
object resulting from a run of the ClarkLDF or ClarkCapeCod functions. |
... |
not used. |
If Clark's model is appropriate for the actual data, then the standardized residuals should appear as independent standard normal random variables. This function creates four plots of standardized residuals on a single page:
By origin
By age
By fitted value
Normal Q-Q plot with results of Shapiro-Wilk test
If the model is appropriate then there should not appear to be any trend in the standardized residuals or any systematic differences in the spread about the line y = 0. The Shapiro-Wilk p-value shown in the fourth plot gives an indication of how closely the standardized residuals can be considered "draws" from a standard normal random variable.
Daniel Murphy
Clark, David R., "LDF Curve-Fitting and Stochastic Reserving: A Maximum Likelihood Approach", Casualty Actuarial Society Forum, Fall, 2003
X <- GenIns Y <- ClarkLDF(GenIns, maxage=Inf, G="weibull") plot(Y) # One obvious outlier, shapiro test flunked X[4,4] <- NA # remove the outlier Z <- ClarkLDF(GenIns, maxage=Inf, G="weibull") plot(Z) # Q-Q plot looks good
X <- GenIns Y <- ClarkLDF(GenIns, maxage=Inf, G="weibull") plot(Y) # One obvious outlier, shapiro test flunked X[4,4] <- NA # remove the outlier Z <- ClarkLDF(GenIns, maxage=Inf, G="weibull") plot(Z) # Q-Q plot looks good
plot.cyEffTest
, a method to plot the output of
cyEffTest
. It is designed to give a quick overview
of a cyEffTest
object and to check the assumption of independece between calendar years.
## S3 method for class 'cyEffTest' plot(x, type = "l", xlab = "Z", ylab = "Density", main = "Calendar Year Effect", col.area = "gray", border = NA, ...)
## S3 method for class 'cyEffTest' plot(x, type = "l", xlab = "Z", ylab = "Density", main = "Calendar Year Effect", col.area = "gray", border = NA, ...)
x |
output from |
type |
Default: "l". What type of plot should be drawn |
xlab |
Default: "Z". X axis label |
ylab |
Default: "Density". Y axis label |
main |
Default: "Calendar Year Effect". Plot title |
col.area |
Default: "gray". Color of the shaded area. |
border |
Default: NULL, the color to draw the border. Use |
... |
optional arguments. See |
plot.cyEffTest
shows the underlying distribution, the test statistic and the relative Confidence Interval.
If the test statistic
is within the highlighted region the hypothesis of dependence between calendar years could be rejected.
Marco De Virgilis [email protected]
See Also cyEffTest
,
summary.cyEffTest
plot(cyEffTest(RAA))
plot(cyEffTest(RAA))
plot.dfCorTest
, a method to plot the output of
dfCorTest
. It is designed to give a quick overview
of a dfCorTest
object and to check the assumption of independece between development factors.
## S3 method for class 'dfCorTest' plot(x, type = "l", xlab = "T", ylab = "Density", main = "Development Factor Correlation", col.area = "gray", border = NA, ...)
## S3 method for class 'dfCorTest' plot(x, type = "l", xlab = "T", ylab = "Density", main = "Development Factor Correlation", col.area = "gray", border = NA, ...)
x |
output from |
type |
Default: "l". What type of plot should be drawn |
xlab |
Default: "Z". X axis label |
ylab |
Default: "Density". Y axis label |
main |
Default: "Development Factor Correlation". Plot title |
col.area |
Default: "gray". Color of the shaded area. |
border |
Default: NULL, the color to draw the border. Use |
... |
optional arguments. See |
plot.dfCorTest
shows the underlying distribution, the test statistic and the relative Confidence Interval.
If the test statistic
is within the highlighted region the hypothesis of correlation between development factors could be rejected.
Marco De Virgilis [email protected]
See Also dfCorTest
,
summary.dfCorTest
plot(dfCorTest(RAA))
plot(dfCorTest(RAA))
plot.MackChainLadder
, a method to plot the output of
MackChainLadder
. It is designed to give a quick overview
of a MackChainLadder
object and to check Mack's model assumptions.
## S3 method for class 'MackChainLadder' plot(x, mfrow=NULL, title=NULL, lattice=FALSE, which=1:6, ...)
## S3 method for class 'MackChainLadder' plot(x, mfrow=NULL, title=NULL, lattice=FALSE, which=1:6, ...)
x |
output from |
mfrow |
see |
title |
see |
lattice |
logical. Default is set to |
which |
if a subset of the plots is required, specify a subset of the numbers 1:6. |
... |
optional arguments. See |
plot.MackChainLadder
shows six graphs, starting from the top left
with a stacked bar-chart of the latest claims position plus IBNR and
Mack's standard error by origin period; next right to it is a
plot of the forecasted development patterns for all origin periods
(numbered, starting with 1 for the oldest origin period),
and 4 residual plots. The residual plots
show the standardised residuals against fitted values, origin period,
calendar period and development period. All residual plot should show
no patterns or directions for Mack's method to be applicable.
Pattern in any direction can be the result of trends and should be
further investigated, see
Barnett and Zehnwirth. Best estimates for reserves. Proceedings
of the CAS, LXXXVI I(167), November 2000. for more details on trends.
Markus Gesmann
See Also MackChainLadder
,
residuals.MackChainLadder
plot(MackChainLadder(RAA))
plot(MackChainLadder(RAA))
plot.MunichChainLadder
, a method to plot the output of
MunichChainLadder
object. It is designed to give a quick
overview of a MunichChainLadder
object and to check the
correlation between the paid and incurred residuals.
## S3 method for class 'MunichChainLadder' plot(x, mfrow=c(2,2), title=NULL, ...)
## S3 method for class 'MunichChainLadder' plot(x, mfrow=c(2,2), title=NULL, ...)
x |
output from |
mfrow |
see |
title |
see |
... |
optional arguments. See |
plot.MunichChainLadder
shows four plots, starting from the top
left with a barchart of forecasted ultimate claims costs by
Munich-chain-ladder (MCL) on paid and incurred data by origin period;
the barchart next to it compares the ratio of forecasted ultimate
claims cost on paid and incurred data based on the Mack-chain-ladder and
Munich-chain-ladder methods; the two residual plots at the bottom show the
correlation of (incurred/paid)-chain-ladder factors against the
paid-chain-ladder factors and the correlation of
(paid/incurred)-chain-ladder factors against the incurred-chain-ladder
factors.
The design of the plots follows those in Quarg's (2004) paper: Gerhard Quarg and Thomas Mack. Munich Chain Ladder. Blatter DGVFM 26, Munich, 2004.
Markus Gesmann
See also MunichChainLadder
M <- MunichChainLadder(MCLpaid, MCLincurred) plot(M)
M <- MunichChainLadder(MCLpaid, MCLincurred) plot(M)
The function is internally used by MackChainLadder
to forecast future claims.
## S3 method for class 'TriangleModel' predict(object,...) ## S3 method for class 'ChainLadder' predict(object,...)
## S3 method for class 'TriangleModel' predict(object,...) ## S3 method for class 'ChainLadder' predict(object,...)
object |
a list with two items:
|
... |
not in use |
FullTriangle |
forecasted claims triangle |
Markus Gesmann
See also chainladder
, MackChainLadder
RAA CL <- chainladder(RAA) CL predict(CL)
RAA CL <- chainladder(RAA) CL predict(CL)
Function to print the results
of a call to the ata
function.
## S3 method for class 'ata' print(x, ...)
## S3 method for class 'ata' print(x, ...)
x |
object resulting from a call to the |
... |
further arguments passed to |
print.ata
simply print
s summary.ata
.
A summary.ata
matrix, invisibly.
Daniel Murphy
ata
and summary.ata
x <- ata(GenIns) ## Print ata factors rounded to 3 decimal places, the summary.ata default print(x) ## Round to 4 decimal places and print cells corresponding ## to future observations as blanks. print(summary(x, digits=4), na.print="")
x <- ata(GenIns) ## Print ata factors rounded to 3 decimal places, the summary.ata default print(x) ## Round to 4 decimal places and print cells corresponding ## to future observations as blanks. print(summary(x, digits=4), na.print="")
print
method for a checkTriangleInflation
object
## S3 method for class 'checkTriangleInflation' print(x, ...)
## S3 method for class 'checkTriangleInflation' print(x, ...)
x |
object of class |
... |
optional arguments for a |
print.checkTriangleInflation
show the print of a checkTriangleInflation
object.
print.checkTriangleInflation
displays the default information resulting from
a call of the checkTriangleInflation method
Marco De Virgilis [email protected]
See also checkTriangleInflation
,
plot.checkTriangleInflation
,
summary.checkTriangleInflation
test <- checkTriangleInflation(MedMal$MedMalOutstanding / MedMal$MedMalOpen) print(test)
test <- checkTriangleInflation(MedMal$MedMalOutstanding / MedMal$MedMalOpen) print(test)
Functions to print the results of the ClarkLDF and ClarkCapeCod methods.
## S3 method for class 'ClarkLDF' print(x, Amountdigits=0, LDFdigits=3, CVdigits=3, row.names = FALSE, ...) ## S3 method for class 'ClarkCapeCod' print(x, Amountdigits=0, ELRdigits=3, Gdigits=4, CVdigits=3, row.names = FALSE, ...)
## S3 method for class 'ClarkLDF' print(x, Amountdigits=0, LDFdigits=3, CVdigits=3, row.names = FALSE, ...) ## S3 method for class 'ClarkCapeCod' print(x, Amountdigits=0, ELRdigits=3, Gdigits=4, CVdigits=3, row.names = FALSE, ...)
x |
object resulting from a run of the ClarkLDF or ClarkCapeCod function. |
Amountdigits |
number of digits to display to the right of the decimal point for "amount" columns |
LDFdigits |
number of digits to display to the right of the decimal point for the loss development factor (LDF) column |
CVdigits |
number of digits to display to the right of the decimal point for the coefficient of variation (CV) column |
ELRdigits |
number of digits to display to the right of the decimal point for the expected loss ratio (ELR) column |
Gdigits |
number of digits to display to the right of the decimal point for the "growth function factor" column; default of 4 conforms with the table on pp. 67, 68 of Clark's paper |
row.names |
logical (or character vector),
indicating whether (or what) row names should be printed
(same as for |
... |
further arguments passed to |
Display the default information in "pretty format" resulting from a run of the "LDF Method" or "Cape Cod Method" – a "Development-type" exhibit for Clark's "LDF Method," a "Bornhuetter-Ferguson-type" exhibit for Clark's "Cape Cod Method."
As usual, typing the name of such an object at the console
invokes its print
method.
data.frame
s whose columns are the character
representation
of their respective summary.ClarkLDF
or summary.ClarkCapeCod
data.frame
s.
Daniel Murphy
Clark, David R., "LDF Curve-Fitting and Stochastic Reserving: A Maximum Likelihood Approach", Casualty Actuarial Society Forum, Fall, 2003
summary.ClarkLDF
and summary.ClarkCapeCod
X <- GenIns colnames(X) <- 12*as.numeric(colnames(X)) y <- ClarkCapeCod(X, Premium=10000000+400000*0:9, maxage=240) summary(y) print(y) # (or simply 'y') Same as summary(y) but with "pretty formats" ## Greater growth factors when projecting to infinite maximum age ClarkCapeCod(X, Premium=10000000+400000*0:9, maxage=Inf)
X <- GenIns colnames(X) <- 12*as.numeric(colnames(X)) y <- ClarkCapeCod(X, Premium=10000000+400000*0:9, maxage=240) summary(y) print(y) # (or simply 'y') Same as summary(y) but with "pretty formats" ## Greater growth factors when projecting to infinite maximum age ClarkCapeCod(X, Premium=10000000+400000*0:9, maxage=Inf)
print
method for a cyEffTest
object
## S3 method for class 'cyEffTest' print(x, ...)
## S3 method for class 'cyEffTest' print(x, ...)
x |
object of class |
... |
optional arguments for a |
print.cyEffTest
show the print of a cyEffTest
object.
print.cyEffTest
displays the default information resulting from
a call of the cyEffTest method
Marco De Virgilis [email protected]
See also cyEffTest
,
plot.cyEffTest
,
summary.cyEffTest
test <- cyEffTest(RAA) print(test)
test <- cyEffTest(RAA) print(test)
print
method for a dfCorTest
object
## S3 method for class 'dfCorTest' print(x, ...)
## S3 method for class 'dfCorTest' print(x, ...)
x |
object of class |
... |
optional arguments for a |
print.dfCorTest
show the print of a dfCorTest
object.
print.dfCorTest
displays the default information resulting from
a call of the dfCorTest method
Marco De Virgilis [email protected]
See also dfCorTest
,
plot.dfCorTest
,
summary.dfCorTest
test <- dfCorTest(RAA) print(test)
test <- dfCorTest(RAA) print(test)
Sample data to demonstrate how to work with triangles with a higher development period frequency than origin period frequency
data(qpaid); data(qincurred)
data(qpaid); data(qincurred)
A matrix with 12 accident years and 45 development quarters of claims costs.
Made up data for testing purpose
dim(qpaid) dim(qincurred) op=par(mfrow=c(1,2)) ymax <- max(c(qpaid,qincurred),na.rm=TRUE)*1.05 matplot(t(qpaid), type="l", main="Paid development", xlab="Dev. quarter", ylab="$", ylim=c(0,ymax)) matplot(t(qincurred), type="l", main="Incurred development", xlab="Dev. quarter", ylab="$", ylim=c(0,ymax)) par(op) ## MackChainLadder expects a quadratic matrix so let's expand ## the triangle to a quarterly origin period. n <- ncol(qpaid) Paid <- matrix(NA, n, n) Paid[seq(1,n,4),] <- qpaid M <- MackChainLadder(Paid) plot(M) # We expand the incurred triangle in the same way Incurred <- matrix(NA, n, n) Incurred[seq(1,n,4),] <- qincurred # With the expanded triangles we can apply MunichChainLadder MunichChainLadder(Paid, Incurred) # In the same way we can apply BootChainLadder # We reduce the size of bootstrap replicates R # from the default of 999 to 99 purely to reduce run time. BootChainLadder(Paid, R=99)
dim(qpaid) dim(qincurred) op=par(mfrow=c(1,2)) ymax <- max(c(qpaid,qincurred),na.rm=TRUE)*1.05 matplot(t(qpaid), type="l", main="Paid development", xlab="Dev. quarter", ylab="$", ylim=c(0,ymax)) matplot(t(qincurred), type="l", main="Incurred development", xlab="Dev. quarter", ylab="$", ylim=c(0,ymax)) par(op) ## MackChainLadder expects a quadratic matrix so let's expand ## the triangle to a quarterly origin period. n <- ncol(qpaid) Paid <- matrix(NA, n, n) Paid[seq(1,n,4),] <- qpaid M <- MackChainLadder(Paid) plot(M) # We expand the incurred triangle in the same way Incurred <- matrix(NA, n, n) Incurred[seq(1,n,4),] <- qincurred # With the expanded triangles we can apply MunichChainLadder MunichChainLadder(Paid, Incurred) # In the same way we can apply BootChainLadder # We reduce the size of bootstrap replicates R # from the default of 999 to 99 purely to reduce run time. BootChainLadder(Paid, R=99)
quantile
methods for a MackChainLadder
object
## S3 method for class 'MackChainLadder' quantile(x, probs=c(0.75, 0.95), na.rm = FALSE, names = TRUE, type = 7,...)
## S3 method for class 'MackChainLadder' quantile(x, probs=c(0.75, 0.95), na.rm = FALSE, names = TRUE, type = 7,...)
x |
object of class |
probs |
numeric vector of probabilities with values in [0,1],
see |
na.rm |
not used |
names |
not used |
type |
not used |
... |
not used |
Reserves at the desired quantile using the Cornish-Fisher expansion.
The Cornish-Fisher expansion relies on the first three moments of the reserve risk distribution: The Best estimate resulting from the Chain-Ladder projection, the Mack standard deviation and the skewness of the distribution (for skewness estimation, see references below).
The quantile estimation requires only that the standard Mack assumptions are met.
For details of the underlying calculations, see references below.
quantile.MackChainLadder
gives a list with two elements back:
ByOrigin |
data frame with skewness and quantile statistics by origin period |
Totals |
data frame with total skewness and quantile statistics across all origin periods |
Eric Dal Moro [email protected]
Eric Dal Moro and Yuriy Krvavych. Probability of sufficiency of Solvency II Reserve risk margins: Practical approximations. ASTIN Bulletin, 47(3), 737-785
Dal Moro, Eric, A Closed-Form Formula for the Skewness Estimation of Non-Life Reserve Risk Distribution (September 15, 2013). Available at SSRN: https://ssrn.com/abstract=2344297 or https://dx.doi.org/10.2139/ssrn.2344297
See also MackChainLadder
M <- MackChainLadder(GenIns, est.sigma="Mack") quantile(M, c(0.65, 0.75, 0.9))
M <- MackChainLadder(GenIns, est.sigma="Mack") quantile(M, c(0.65, 0.75, 0.9))
The Quantile IFRS 17 function provides an estimate of the quantile attained on the reserve risk distribution that corresponds to the booked Risk Adjustment plus the Best Estimate.
QuantileIFRS17(MCL, Correlation, RiskMargin)
QuantileIFRS17(MCL, Correlation, RiskMargin)
MCL |
a list of |
Correlation |
Correlation matrix depicting the correlations between each triangle imported. The correlation matrix is of dimension n x n, with n the number of items in the list of MackChainLadder objects. For correlation estimations between P&C risks, please refer to the article of Arbenz et al. below. |
RiskMargin |
Input the risk margin as a single number. The risk margin corresponds to the IFRS 17 risk adjustment. It is estimated outside this function and can come from e.g. Solvency 2 standard formula. See International Actuarial Association reference below for details on risk adjustment calculations. |
The IFRS 17 quantile is a mandatory disclosure when producing Financial Statements under the IFRS 17 framework: Such quantile reflects the Probability of Sufficiency of the reserves defined as Best Estimate plus Risk Adjustment i.e. the probability that the reserves will cover any negative deviations up to the disclosed quantile.
When a risk measure other than the quantile measure (Value At risk) is used for determining the Risk Adjustment, the quantile has to be estimated. The purpose of this function is to provide such an estimation on deriving the first three moments of the reserve risk distribution. These moments are estimated on the triangles input into the function. These triangles are projected using chain-ladder methods and the standard Best Estimate, Mack volatility and skewness are estimated. The resulting moments of the different triangles are then aggregated using Fleishman polynomials.
On using a Cornish-Fisher expansion based on the three aggregated moments, the Probability of Sufficiency of the reserves including the Risk Adjustment (given as an input to the function) can be easily derived.
QuantileIFRS17 returns a vector with the following elements
QuantileIFRS_17 |
Quantile attained on the reserve risk distribution with the booked Risk Adjustment |
Skewness |
Skewness of the overall aggregated risk distribution across all triangles |
CoV |
Coefficient of Variation of the overall aggregated risk distribution across all triangles |
Reserve |
Sum of reserves of the input MackChainLadder objects |
The use of Fleishman polynomials and Cornish-Fisher expansion imply that the different risks involved in the triangles inputs should be "close to normality". If the risks involved in the input triangles are far from normal distributions (e.g. extreme events, nat cats ...), the proposed framework will not apply and the quantile derived from the function will not be relevant.
Eric Dal Moro, Yuriy Krvavych
Thomas Mack. Distribution-free calculation of the standard error of chain ladder reserve estimates. Astin Bulletin. Vol. 23. No 2. 1993. pp.213:225
Thomas Mack. The standard error of chain ladder reserve estimates: Recursive calculation and inclusion of a tail factor. Astin Bulletin. Vol. 29. No 2. 1999. pp.361:366
Dal Moro, Krvavych. Probability of sufficiency of Solvency II Reserve risk margins: Practical approximations. ASTIN Bulletin, 47(3), 737-785
P. Arbenz, D. Canestraro (2012) Estimating Copulas for Insurance from Scarce Observations, Expert Opinion and Prior Information: A Bayesian Approach, Astin Bulletin, vol. 42(1), pages 271-290.
International Actuarial Association (2018) Risk Adjustments for Insurance Contracts under IFRS 17
See also MackChainLadder
,
quantile.MackChainLadder
QuantileIFRS17(MCL=list(M1=MackChainLadder(RAA, est.sigma = "Mack"), M2=MackChainLadder(GenIns/1000, est.sigma = "Mack")), Correlation=matrix(c(1,0.3, 0.3, 1), ncol=2), RiskMargin = 20000)
QuantileIFRS17(MCL=list(M1=MackChainLadder(RAA, est.sigma = "Mack"), M2=MackChainLadder(GenIns/1000, est.sigma = "Mack")), Correlation=matrix(c(1,0.3, 0.3, 1), ncol=2), RiskMargin = 20000)
Run-off triangle of Automatic Factultative business in General Liability
data(RAA)
data(RAA)
A matrix with 10 accident years and 10 development years.
Historical Loss Development, Reinsurance Association of Ammerica (RAA), 1991, p.96
See Also: Which Stochastic Model is Underlying the Chain Ladder Method?, Thomas Mack, Insurance Mathematics and Economics, 15, 2/3, pp133-138, 1994
P.D.England and R.J.Verrall, Stochastic Claims Reserving in General Insurance, British Actuarial Journal, Vol. 8, pp443-544, 2002
RAA plot(RAA) plot(RAA, lattice=TRUE)
RAA plot(RAA) plot(RAA, lattice=TRUE)
residCov
and residCov
are a generic functions to extract residual covariance and residual correlation from a system of fitted regressions respectively.
residCov(object,...) residCor(object,...) ## S4 method for signature 'MultiChainLadder' residCov(object,...) ## S4 method for signature 'MultiChainLadder' residCor(object,...)
residCov(object,...) residCor(object,...) ## S4 method for signature 'MultiChainLadder' residCov(object,...) ## S4 method for signature 'MultiChainLadder' residCor(object,...)
object |
An object of class "MultiChainLadder". |
... |
Currently not used. |
Wayne Zhang [email protected]
See also MultiChainLadder
.
Extract residuals of a MackChainLadder
model by
origin-, calendar- and development period.
## S3 method for class 'MackChainLadder' residuals(object, ...)
## S3 method for class 'MackChainLadder' residuals(object, ...)
object |
output of |
... |
not in use |
The function returns a data.frame
of residuals and standardised residuals
by origin-, calendar- and development period.
Markus Gesmann
See Also MackChainLadder
RAA MCL=MackChainLadder(RAA) MCL residuals(MCL)
RAA MCL=MackChainLadder(RAA) MCL residuals(MCL)
Methods for function summary
to calculate summary statistics from a "MultiChainLadder" object.
## S4 method for signature 'MultiChainLadder' summary(object, portfolio=NULL,...)
## S4 method for signature 'MultiChainLadder' summary(object, portfolio=NULL,...)
object |
object of class |
portfolio |
character strings specifying which triangles to be summed up as portfolio. |
... |
optional arguments to |
summary
calculations the summary statistics for each triangle and the whole portfolio from portfolio
. portfolio
defaults to the sum of all input triangles. It can also be specified as "i+j" format, which means the sum of the i-th and j-th triangle as portfolio. For example, "1+3"
means the sum of the first and third triangle as portfolio.
The summary
function returns an object of class "MultiChainLadderSummary" that has the following slots:
Triangles |
input triangles |
FullTriangles |
predicted triangles |
S.E.Full |
a list of prediction errors for each cell |
S.E.Est.Full |
a list of estimation errors for each cell |
S.E.Proc.Full |
a list of process errors for each cell |
Ultimate |
predicted ultimate losses for each triangle and portfolio |
Latest |
latest observed losses for each triangle and portfolio |
IBNR |
predicted IBNR for each triangle and portfolio |
S.E.Ult |
a matrix of prediction errors of ultimate losses for each triangle and portfolio |
S.E.Est.Ult |
a matrix of estimation errors of ultimate losses for each triangle and portfolio |
S.E.Proc.Ult |
a matrix of process errors of ultimate losses for each triangle and portfolio |
report.summary |
summary statistics for each triangle and portfolio |
coefficients |
estimated coefficients from |
coefCov |
estimated variance-covariance matrix returned by |
residCov |
estimated residual covariance matrix returned by |
rstandard |
standardized residuals |
fitted.values |
fitted.values |
residCor |
residual correlation |
model.summary |
summary statistics for the cofficients including p-values |
portfolio |
how portfolio is calculated |
Wayne Zhang [email protected]
See Also MultiChainLadder
data(GenIns) fit.bbmw=MultiChainLadder(list(GenIns),fit.method="OLS", mse.method="Independence") summary(fit.bbmw)
data(GenIns) fit.bbmw=MultiChainLadder(list(GenIns),fit.method="OLS", mse.method="Independence") summary(fit.bbmw)
Summarize the age-to-age factors resulting from a
call to the ata
function.
## S3 method for class 'ata' summary(object, digits=3, ...)
## S3 method for class 'ata' summary(object, digits=3, ...)
object |
object resulting from a call to |
digits |
integer indicating the number of decimal places
for rounding the factors.
The default is 3.
|
... |
not used |
A call to ata
produces a matrix of age-to-age factors
with two attributes –
the simple and volume weighted averages.
summary.ata
creates a new matrix with the averages appended
as rows at the bottom.
A matrix
.
Dan Murphy
y <- ata(RAA) summary(y, digits=4)
y <- ata(RAA) summary(y, digits=4)
summary
, print
, mean
, and quantile
methods for BootChainLadder
objects
## S3 method for class 'BootChainLadder' summary(object, probs=c(0.75,0.95), ...) ## S3 method for class 'BootChainLadder' print(x, probs=c(0.75,0.95), ...) ## S3 method for class 'BootChainLadder' quantile(x, probs=c(0.75, 0.95), na.rm = FALSE, names = TRUE, type = 7,...) ## S3 method for class 'BootChainLadder' mean(x, ...) ## S3 method for class 'BootChainLadder' residuals(object, ...)
## S3 method for class 'BootChainLadder' summary(object, probs=c(0.75,0.95), ...) ## S3 method for class 'BootChainLadder' print(x, probs=c(0.75,0.95), ...) ## S3 method for class 'BootChainLadder' quantile(x, probs=c(0.75, 0.95), na.rm = FALSE, names = TRUE, type = 7,...) ## S3 method for class 'BootChainLadder' mean(x, ...) ## S3 method for class 'BootChainLadder' residuals(object, ...)
x , object
|
output from |
probs |
numeric vector of probabilities with values in [0,1],
see |
na.rm |
logical; if true, any |
names |
logical; if true, the result has a |
type |
an integer between 1 and 9 selecting one of the nine quantile
algorithms detailed below to be used, see |
... |
further arguments passed to or from other methods |
print.BootChainLadder
calls summary.BootChainLadder
and
prints a formatted version of the summary.
residuals.BootChainLadder
gives the residual triangle of
the expected chain-ladder minus the actual triangle back.
summary.BootChainLadder
, mean.BootChainLadder
, and
quantile.BootChainLadder
, give a list with two elements back:
ByOrigin |
data frame with summary/mean/quantile statistics by origin period |
Totals |
data frame with total summary/mean/quantile statistics for all origin period |
Markus Gesmann
See also BootChainLadder
B <- BootChainLadder(RAA, R=999, process.distr="gamma") B summary(B) mean(B) quantile(B, c(0.75,0.95,0.99, 0.995))
B <- BootChainLadder(RAA, R=999, process.distr="gamma") B summary(B) mean(B) quantile(B, c(0.75,0.95,0.99, 0.995))
summary
method for a checkTriangleInflation
object
## S3 method for class 'checkTriangleInflation' summary(object, ...)
## S3 method for class 'checkTriangleInflation' summary(object, ...)
object |
object of class |
... |
optional arguments for a |
summary.checkTriangleInflation
shows the summary of a checkTriangleInflation
object.
summary.checkTriangleInflation
gives a named numeric array of three rows.
rate |
Inflation rate for the specific development period |
R2 |
|
points |
Number of points used |
Marco De Virgilis [email protected]
See also checkTriangleInflation
,
plot.checkTriangleInflation
test <- checkTriangleInflation( MedMal$MedMalOutstanding / MedMal$MedMalOpen ) summary(test)
test <- checkTriangleInflation( MedMal$MedMalOutstanding / MedMal$MedMalOpen ) summary(test)
summary
methods for ClarkLDF
and ClarkCapeCod
objects
## S3 method for class 'ClarkLDF' summary(object, ...) ## S3 method for class 'ClarkCapeCod' summary(object, ...)
## S3 method for class 'ClarkLDF' summary(object, ...) ## S3 method for class 'ClarkCapeCod' summary(object, ...)
object |
object resulting from a run of the |
... |
not currently used |
summary.ClarkLDF
returns a data.frame
that holds the columns of a
typical "Development-type" exhibit.
summary.ClarkCapeCod
returns a data.frame
that holds the columns of a
typical "Bornhuetter-Ferguson-type" exhibit.
summary.ClarkLDF
and summary.ClarkCapeCod
return
data.frame
s whose columns are objects of the appropriate mode
(i.e., character
for "Origin", otherwise numeric
)
Dan Murphy
See also ClarkLDF
y <- ClarkLDF(RAA) summary(y)
y <- ClarkLDF(RAA) summary(y)
summary
method for a cyEffTest
object
## S3 method for class 'cyEffTest' summary(object, ...)
## S3 method for class 'cyEffTest' summary(object, ...)
object |
object of class |
... |
optional arguments for a |
summary.cyEffTest
shows the summary of a cyEffTest
object.
summary.cyEffTest
gives a list of three elements back
Table |
data frame containing the statistics for each calendar year |
Totals |
data frame of totals of the main statistics from the dataframe |
Range |
data frame containing the upper and lower limits of the confidence interval range |
Marco De Virgilis [email protected]
See also cyEffTest
,
plot.cyEffTest
test <- cyEffTest(RAA) summary(test)
test <- cyEffTest(RAA) summary(test)
summary
method for a dfCorTest
object
## S3 method for class 'dfCorTest' summary(object, ...)
## S3 method for class 'dfCorTest' summary(object, ...)
object |
object of class |
... |
optional arguments for a |
summary.dfCorTest
shows the summary of a dfCorTest
object.
summary.dfCorTest
gives a list of two elements back
Results |
data frame containing the summary statistics |
Range |
data frame containing the upper and lower limits of the confidence interval range |
Marco De Virgilis [email protected]
See also dfCorTest
,
plot.dfCorTest
test <- dfCorTest(RAA) summary(test)
test <- dfCorTest(RAA) summary(test)
summary
and print
methods for a MackChainLadder
object
## S3 method for class 'MackChainLadder' summary(object, ...) ## S3 method for class 'MackChainLadder' print(x, ...)
## S3 method for class 'MackChainLadder' summary(object, ...) ## S3 method for class 'MackChainLadder' print(x, ...)
x , object
|
object of class |
... |
optional arguments to |
print.MackChainLadder
calls summary.MackChainLadder
and
prints a formatted version of the summary.
summary.MackChainLadder
gives a list of two elements back
ByOrigin |
data frame with |
Totals |
data frame of totals over all origin periods. The items
follow the same naming convention as in |
Markus Gesmann
See also MackChainLadder
,
plot.MackChainLadder
R <- MackChainLadder(RAA) R summary(R) summary(R)$ByOrigin$Ultimate
R <- MackChainLadder(RAA) R summary(R) summary(R)$ByOrigin$Ultimate
summary
and print
methods for a MunichChainLadder
object
## S3 method for class 'MunichChainLadder' summary(object, ...) ## S3 method for class 'MunichChainLadder' print(x, ...)
## S3 method for class 'MunichChainLadder' summary(object, ...) ## S3 method for class 'MunichChainLadder' print(x, ...)
x , object
|
object of class |
... |
optional arguments to |
print.MunichChainLadder
calls summary.MunichChainLadder
and
prints a formatted version of the summary.
summary.MunichChainLadder
gives a list of two elements back
ByOrigin |
data frame with Latest Paid (latest actual paid claims costs), Latest Incurred (latest actual incurred claims position), Latest P/I Ratio (ratio of latest paid/incurred claims), Ult. Paid (estimate ultimate claims cost based on the paid triangle), Ult. Incurred (estimate ultimate claims cost based on the incurred triangle),Ult. P/I Ratio (ratio of ultimate paid forecast / ultimate incurred forecast) |
Totals |
data frame of totals over all origin periods. The items
follow the same naming convention as in |
Markus Gesmann
See also MunichChainLadder
,
plot.MunichChainLadder
M <- MunichChainLadder(MCLpaid, MCLincurred) M summary(M) summary(M)$ByOrigin
M <- MunichChainLadder(MCLpaid, MCLincurred) M summary(M) summary(M)$ByOrigin
Print the tables on pages 64, 65, and 68 of Clark's paper.
Table64(x) Table65(x) Table68(x)
Table64(x) Table65(x) Table68(x)
x |
an object resulting from |
These exhibits give some of the details behind the calculations producing the estimates of future values (a.k.a. "Reserves" in Clark's paper). Table65 works for both the "LDF" and the "CapeCod" methods. Table64 is specific to "LDF", Table68 to "CapeCod".
A data.frame
.
Daniel Murphy
Clark, David R., "LDF Curve-Fitting and Stochastic Reserving: A Maximum Likelihood Approach", Casualty Actuarial Society Forum, Fall, 2003 https://www.casact.org/sites/default/files/database/forum_03fforum_03ff041.pdf
Table65(ClarkLDF(GenIns, maxage=20)) Table64(ClarkLDF(GenIns, maxage=20)) X <- GenIns colnames(X) <- 12*as.numeric(colnames(X)) Table65(ClarkCapeCod(X, Premium=10000000+400000*0:9, maxage=Inf)) Table68(ClarkCapeCod(X, Premium=10000000+400000*0:9, maxage=Inf))
Table65(ClarkLDF(GenIns, maxage=20)) Table64(ClarkLDF(GenIns, maxage=20)) X <- GenIns colnames(X) <- 12*as.numeric(colnames(X)) Table65(ClarkCapeCod(X, Premium=10000000+400000*0:9, maxage=Inf)) Table68(ClarkCapeCod(X, Premium=10000000+400000*0:9, maxage=Inf))
Functions to ease the work with triangle shaped matrix data. A 'triangle' is a matrix with some generic functions.
triangle
creates a triangle from the given set of vectors of
observed data.
as.triangle
attempts to turn its argument into a triangle.
Triangles are usually stored in a “long” format in data bases. The
function can transform a data.frame
into a triangle shape.
as.data.frame
turns a triangle into a data frame.
triangle(..., bycol=FALSE, origin="origin", dev="dev", value="value") ## S3 method for class 'matrix' as.triangle(Triangle, origin="origin", dev="dev", value="value", ...) ## S3 method for class 'data.frame' as.triangle(Triangle, origin="origin", dev="dev", value="value", ...) ## S3 method for class 'triangle' as.data.frame(x, row.names=NULL, optional, lob=NULL, na.rm=FALSE, ...) as.triangle(Triangle, origin="origin", dev="dev", value="value", ...) ## S3 method for class 'triangle' plot(x, type = "b", xlab = "dev. period", ylab = NULL, lattice=FALSE, ...)
triangle(..., bycol=FALSE, origin="origin", dev="dev", value="value") ## S3 method for class 'matrix' as.triangle(Triangle, origin="origin", dev="dev", value="value", ...) ## S3 method for class 'data.frame' as.triangle(Triangle, origin="origin", dev="dev", value="value", ...) ## S3 method for class 'triangle' as.data.frame(x, row.names=NULL, optional, lob=NULL, na.rm=FALSE, ...) as.triangle(Triangle, origin="origin", dev="dev", value="value", ...) ## S3 method for class 'triangle' plot(x, type = "b", xlab = "dev. period", ylab = NULL, lattice=FALSE, ...)
Triangle |
a triangle |
bycol |
logical. If |
origin |
name of the origin period, default is |
dev |
name of the development period, default is |
value |
name of the value, default is |
row.names |
default is set to |
lob |
default is |
optional |
not used |
na.rm |
logical. Remove missing values? |
x |
a matrix of class 'triangle' |
xlab |
a label for the x axis, defaults to 'dev. period' |
ylab |
a label for the y axis, defaults to NULL |
lattice |
logical. If |
type |
type, see |
... |
vectors of data in |
Function triangle
builds a triangle matrix from the vectors of
known data provided in ...
. Normally, each of these
vectors should be one shorter than the preceeding one. The length of
the first vector dictates the number of development periods or origin
periods (respectively when bycol
is FALSE
or
TRUE
). As a special case, the function will build an triangle from a single vector of
data
points.
The names of the arguments in ...
for function
triangle
(when there are more than one) are retained for
row/column names. Similarly, the names of the elements of the
first argument are used as column/row names.
Please note that for the function as.triangle
the origin and
dev. period columns have to be of type numeric or a character which can be
converted into numeric.
Also note that when converting from a data.frame to a matrix with
as.triangle
, multiple records with the same origin
and
dev
will be aggregated.
Markus Gesmann, Dan Murphy, Vincent Goulet
GenIns plot(GenIns) plot(GenIns, lattice=TRUE) ## Convert long format into triangle ## Triangles are usually stored as 'long' tables in data bases head(GenInsLong) as.triangle(GenInsLong, origin="accyear", dev="devyear", "incurred claims") X <- as.data.frame(RAA) head(X) Y <- as.data.frame(RAA, lob="General Liability") head(Y) ## Basic creation of a triangle from loss development data triangle(c(100, 150, 175, 180, 200), c(110, 168, 192, 205), c(115, 169, 202), c(125, 185), 150) ## Same, with named origin periods triangle("2012" = c(100, 150, 175, 180, 200), "2013" = c(110, 168, 192, 205), "2014" = c(115, 169, 202), "2015" = c(125, 185), "2016" = 150) ## Again, with also named development periods triangle("2012" = c("12 months" = 100, "24 months" = 150, "36 months" = 175, "48 months" = 180, "60 months" = 200), "2013" = c(110, 168, 192, 205), "2014" = c(115, 169, 202), "2015" = c(125, 185), "2016" = 150) ## Quick, simplified usage triangle(c(100, 150, 175, 110, 168, 115))
GenIns plot(GenIns) plot(GenIns, lattice=TRUE) ## Convert long format into triangle ## Triangles are usually stored as 'long' tables in data bases head(GenInsLong) as.triangle(GenInsLong, origin="accyear", dev="devyear", "incurred claims") X <- as.data.frame(RAA) head(X) Y <- as.data.frame(RAA, lob="General Liability") head(Y) ## Basic creation of a triangle from loss development data triangle(c(100, 150, 175, 180, 200), c(110, 168, 192, 205), c(115, 169, 202), c(125, 185), 150) ## Same, with named origin periods triangle("2012" = c(100, 150, 175, 180, 200), "2013" = c(110, 168, 192, 205), "2014" = c(115, 169, 202), "2015" = c(125, 185), "2016" = 150) ## Again, with also named development periods triangle("2012" = c("12 months" = 100, "24 months" = 150, "36 months" = 175, "48 months" = 180, "60 months" = 200), "2013" = c(110, 168, 192, 205), "2014" = c(115, 169, 202), "2015" = c(125, 185), "2016" = 150) ## Quick, simplified usage triangle(c(100, 150, 175, 110, 168, 115))
This is a S4 class that has "list" in the data part. This class is created to facilitate validation and extraction of data.
Objects can be created by calls of the form new("triangles", ...)
, or use as(...,"triangles")
, where ...
is a "list".
.Data
:Object of class "list"
Class "list"
, from data part.
Class "vector"
, by class "list", distance 2.
signature(ModelFit = "GMCLFit", FullTriangles = "triangles")
: See Mse
signature(ModelFit = "MCLFit", FullTriangles = "triangles")
: See Mse
signature(x = "triangles", i = "missing", j = "numeric", drop = "logical")
: Method for primitive function "[" to subset certain columns. If drop=TRUE
, rows composed of all "NA"s are removed. Dimensions are not dropped.
signature(x = "triangles", i = "missing", j = "numeric", drop = "missing")
: Method for primitive function "[" to subset certain columns, where rows composed of all "NA"s are removed. Dimensions are not dropped.
signature(x = "triangles", i = "numeric", j = "missing", drop = "logical")
: Method for primitive function "[" to subset certain rows. If drop=TRUE
, columns composed of all "NA"s are removed. Dimensions are not dropped.
signature(x = "triangles", i = "numeric", j = "missing", drop = "missing")
: Method for primitive function "[" to subset certain rows, where columns composed of all "NA"s are removed. Dimensions are not dropped.
signature(x = "triangles", i = "numeric", j = "numeric", drop = "missing")
: Method for primitive function "[" to subset certain rows and columns. Dimensions are not dropped.
signature(x = "triangles", i = "numeric", j = "numeric", value = "list")
: Method for primitive function "[<-" to replace one cell in each triangle with values specified in value
.
signature(from = "list", to = "triangles")
: Method to construct a "triangles" object from "list".
signature(x = "triangles")
: Method to get the dimensions. The return value is a vector of length 3, where the first element is the number of triangles, the sencond is the number of accident years, and the third is the number of development years.
signature(x = "triangles", y="missing")
: Method to column bind all triangles using cbind
internally.
signature(x = "triangles", y="missing")
: Method to row bind all triangles using rbind
internally.
Wayne Zhang [email protected]
See also MultiChainLadder
data(auto) # "coerce" auto <- as(auto,"triangles") # transform "list" to be "triangles" # method for "[" auto[,4:6,drop=FALSE] # rows of all NA's not dropped auto[,4:6] # drop rows of all NA's auto[8:10, ,drop=FALSE] #columns of all NA's not dropped auto[8:10, ] #columns of all NA's dropped auto[1:2,1] # replacement method auto[1:2,1] <- list(1,2,3) auto[1,2] dim(auto) cbind2(auto[1:2,1]) rbind2(auto[1:2,1])
data(auto) # "coerce" auto <- as(auto,"triangles") # transform "list" to be "triangles" # method for "[" auto[,4:6,drop=FALSE] # rows of all NA's not dropped auto[,4:6] # drop rows of all NA's auto[8:10, ,drop=FALSE] #columns of all NA's not dropped auto[8:10, ] #columns of all NA's dropped auto[1:2,1] # replacement method auto[1:2,1] <- list(1,2,3) auto[1,2] dim(auto) cbind2(auto[1:2,1]) rbind2(auto[1:2,1])
This function implements loss reserving models within the generalized linear model framework in order to generate the full predictive distribution for loss reserves. Besides, it generates also the one year risk view useful to derive the reserve risk capital in a Solvency II framework. Finally, it allows the user to validate the model error while changing different model parameters, as the regression structure and diagnostics on the Tweedie p parameter.
tweedieReserve(triangle, var.power = 1, link.power = 0, design.type = c(1, 1, 0), rereserving = FALSE, cum = TRUE, exposure = FALSE, bootstrap = 1, boot.adj = 0, nsim = 1000, proc.err = TRUE, p.optim = FALSE, p.check = c(0, seq(1.1, 2.1, by = 0.1), 3), progressBar = TRUE, ...)
tweedieReserve(triangle, var.power = 1, link.power = 0, design.type = c(1, 1, 0), rereserving = FALSE, cum = TRUE, exposure = FALSE, bootstrap = 1, boot.adj = 0, nsim = 1000, proc.err = TRUE, p.optim = FALSE, p.check = c(0, seq(1.1, 2.1, by = 0.1), 3), progressBar = TRUE, ...)
triangle |
An object of class |
var.power |
The index (p) of the power variance function |
link.power |
The index of power link function. The default |
design.type |
It's a 3 dimension array that specifies the design matrix underlying
the GLM. The dimensions represent respectively: origin period,
development and calendar period. Accepted values are: |
rereserving |
Boolean, if |
cum |
Boolean, indicating whether the input triangle is
cumulative or incremental along the development period.
If |
exposure |
Boolean, if |
bootstrap |
Integer, it specifies the type of bootstrap for parameter error.
Accepted values are: |
boot.adj |
Integer, it specified the methodology when using semi-parametric
bootstrapping. Accepted values are: |
nsim |
Integer, number of simulations to derive the loss reserve distribution.
Default to |
proc.err |
Boolean, if |
p.optim |
Boolean, if |
p.check |
If |
progressBar |
Boolean, if |
... |
Arguments to be passed onto the function |
The output is an object of class "glm"
that has the following components:
call |
the matched call. |
summary |
A data frame containing the predicted loss reserve statistics. The following items are displayed:
The following items are available if
The following items are availbale if
|
Triangle |
The input triangle. |
FullTriangle |
The completed triangle, where empty cells in the original triangle are filled with model predictions. |
model |
The fitted GLM, a class of |
scale |
The dispersion parameter phi |
bias |
The model bias, defined as |
GLMReserve |
Deterministic reserve, i.e. the MLE GLM estimate of the Reserve |
gamma_y |
When the calendar year is used, it displays the observed and fitted calendar year (usually called "gamma"") factors. |
res.diag |
It's a data frame for residual diagnostics. It contains:
|
[If boostrap>1
]
distr.res_ult |
The full distribution "Ultimate View" |
[If rereserve=TRUE
]
distr.res_1yr |
The full distribution "1yr View" |
Note that the runtime can materially increase for certain parameter setting. See above for more details.
This function was born initially as a fork of the glmReserve
by
Wayne Zhang. I would like to thank him for his work that permitted me to
speed up my coding.
Alessandro Carrato MSc FIA OA [email protected]
Gigante, Sigalotti. Model risk in claims reserving with generalized linear models. Giornale dell'Istituto Italiano degli Attuari, Volume LXVIII. 55-87. 2005
England, Verrall. Stochastic claims reserving in general insurance. B.A.J. 8, III. 443-544. 2002
England, Verrall. Predictive distributions of outstanding liabilities in general insurance. A.A.S. 1, II. 221-270. 2006
Peters, Shevchenko, Wüthrich, Model uncertainty in claims reserving within Tweedie's compound poisson models. Astin Bulletin 39(1). 1-33. 2009
Renshaw, Verrall. A stochastic model underlying the chain-ladder technique. B.A.J. 4, IV. 903-923. 1998
See also summary.tweedieReserve
.
## Not run: ## Verrall's ODP Model is a Tweedie with p=1, log link and ## origin/development periods as factors, thus c(1,1,0) res1 <- tweedieReserve(MW2008, var.power=1, link.power=0, design.type=c(1,1,0), rereserving=TRUE, progressBar=TRUE) ## To get directly ultimate view and respective one year view ## at selected percentiles summary(res1) #To get other interesting statistics res1$summary ## In order to validate the Tweedie parameter 'p', it is interesting to ## review its loglikelihood profile. Please note that, given the nature ## of our data, it is expected that we may have some fitting issues for ## given 'p' parameters, thus any results/errors should be considered ## only indicatively. Considering different regression structures is anyway ## recommended. Different 'p' values can be defined via the p.check array ## as input of the function. ## See help(tweedie.profile), p.vec parameter, for further information. ## Note: The parameters rereserving and bootstrap can be set to 0 to speed up ## the process, as they aren't needed. ## Runs a 'p' loglikelihood profile on the parameters ## p=c(0,1.1,1.2,1.3,1.4,1.5,2,3) res2 <- tweedieReserve(MW2008, p.optim=TRUE, p.check=c(0,1.1,1.2,1.3,1.4,1.5,2,3), design.type=c(1,1,0), rereserving=FALSE, bootstrap=0, progressBar=FALSE) ## As it is possible to see in this example, the MLE of p (or xi) results ## between 0 and 1, which is not possible as Tweedie models aren't ## defined for 0 < p < 1, thus the Error message. ## But, despite this, we can conclude that overall the value p=1 could be ## reasonable for this dataset, as anyway it seems to be near the MLE. ## In order to consider an inflation parameter across the origin period, ## it may be interesting to change the regression structure to c(0,1,1) ## to get the same estimates of the Arithmetic Separation Method, as ## referred in Gigante/Sigalotti. res3 <- tweedieReserve(MW2008, var.power=1, link.power=0, design.type=c(0,1,1), rereserving=TRUE, progressBar=TRUE) res3 ## An assessment on future fitted calendar year values (usually defined ## as "gamma") is recommended plot(res3$gamma_y) ## Model residuals can be plotted using the res.diag output plot(scaled.biasadj ~ dev, data=res3$res.diag) # Development year plot(scaled.biasadj ~ cy, data=res3$res.diag) # Calendar year plot(scaled.biasadj ~ origin, data=res3$res.diag) # Origin year ## End(Not run)
## Not run: ## Verrall's ODP Model is a Tweedie with p=1, log link and ## origin/development periods as factors, thus c(1,1,0) res1 <- tweedieReserve(MW2008, var.power=1, link.power=0, design.type=c(1,1,0), rereserving=TRUE, progressBar=TRUE) ## To get directly ultimate view and respective one year view ## at selected percentiles summary(res1) #To get other interesting statistics res1$summary ## In order to validate the Tweedie parameter 'p', it is interesting to ## review its loglikelihood profile. Please note that, given the nature ## of our data, it is expected that we may have some fitting issues for ## given 'p' parameters, thus any results/errors should be considered ## only indicatively. Considering different regression structures is anyway ## recommended. Different 'p' values can be defined via the p.check array ## as input of the function. ## See help(tweedie.profile), p.vec parameter, for further information. ## Note: The parameters rereserving and bootstrap can be set to 0 to speed up ## the process, as they aren't needed. ## Runs a 'p' loglikelihood profile on the parameters ## p=c(0,1.1,1.2,1.3,1.4,1.5,2,3) res2 <- tweedieReserve(MW2008, p.optim=TRUE, p.check=c(0,1.1,1.2,1.3,1.4,1.5,2,3), design.type=c(1,1,0), rereserving=FALSE, bootstrap=0, progressBar=FALSE) ## As it is possible to see in this example, the MLE of p (or xi) results ## between 0 and 1, which is not possible as Tweedie models aren't ## defined for 0 < p < 1, thus the Error message. ## But, despite this, we can conclude that overall the value p=1 could be ## reasonable for this dataset, as anyway it seems to be near the MLE. ## In order to consider an inflation parameter across the origin period, ## it may be interesting to change the regression structure to c(0,1,1) ## to get the same estimates of the Arithmetic Separation Method, as ## referred in Gigante/Sigalotti. res3 <- tweedieReserve(MW2008, var.power=1, link.power=0, design.type=c(0,1,1), rereserving=TRUE, progressBar=TRUE) res3 ## An assessment on future fitted calendar year values (usually defined ## as "gamma") is recommended plot(res3$gamma_y) ## Model residuals can be plotted using the res.diag output plot(scaled.biasadj ~ dev, data=res3$res.diag) # Development year plot(scaled.biasadj ~ cy, data=res3$res.diag) # Calendar year plot(scaled.biasadj ~ origin, data=res3$res.diag) # Origin year ## End(Not run)
Main purpose of this function is to create a report to assess the reserve risk
capital given an object of the tweedieReserve
class.
It displays both the ultimate and one year risk views at given percentiles.
## S3 method for class 'tweedieReserve' print(x, ...) ## S3 method for class 'tweedieReserve' summary(object, q = c(0.5, 0.75, 0.9, 0.95, 0.995),...)
## S3 method for class 'tweedieReserve' print(x, ...) ## S3 method for class 'tweedieReserve' summary(object, q = c(0.5, 0.75, 0.9, 0.95, 0.995),...)
x |
An object of class |
object |
An object of class |
q |
Array of percentiles to be displayed. |
... |
Not used |
A list with two items
Predicton |
a data.frame with ultimate view reserve risk and the one year view reserve risk at the given percentiles. |
Diagnostic |
Quick diagnostic to show the deterministic reserve vs ultimate view and one year view best estimate. If the model is working properly, then these three value shouldn't be much different. |
Alessandro Carrato MSc FIA OA [email protected]
See also tweedieReserve
.
## Not run: tw <- tweedieReserve(MW2008, rereserving = TRUE) summary(tw) # For comparison CDR.BootChainLadder(BootChainLadder(MW2008)) ## End(Not run)
## Not run: tw <- tweedieReserve(MW2008, rereserving = TRUE) summary(tw) # For comparison CDR.BootChainLadder(BootChainLadder(MW2008)) ## End(Not run)
Triangle of cumulative claims payments for four origin (accident) years over time (development years).
data("UKMotor")
data("UKMotor")
A matrix with 7 accident years and 7 development years.
https://www.actuaries.org.uk/system/files/documents/pdf/crm2-D5.pdf
Stavros Christofides. Regression models based on log-incremental payments. Claims Reserving Manual. Volume 2 D5. September 1997
data(UKMotor) plot(UKMotor) MackChainLadder(UKMotor, est.sigma="Mack")
data(UKMotor) plot(UKMotor) MackChainLadder(UKMotor, est.sigma="Mack")
Paid and incurred triangle data from the United Services Automobile Association company for the private passenger auto liability/medical line of business.
data("USAApaid")
data("USAApaid")
A triangle with 10 accident years and 10 development years.
The claims data comes from Schedule P - Analysis of Losses and Loss Expenses in the National Association of Insurance Commissioners (NAIC) database. CAS obtained permission from the NAIC to make this data available to all interested researchers on the CAS website. NAIC Schedule P contains information on claims for major personal and commercial lines for all property-casualty insurers that write business in US.
CAS website.
data(USAApaid)
data(USAApaid)
Function to compute the covariance matrix of the parameter estimates for the ClarkLDF and ClarkCapeCod methods.
## S3 method for class 'clark' vcov(object, ...)
## S3 method for class 'clark' vcov(object, ...)
object |
object resulting from a run of the ClarkLDF or ClarkCapeCod functions. |
... |
not used. |
The covariance matrix of the estimated parameters is estimated
by the inverse of the Information matrix (see Clark, p. 53).
This function uses the "FI" and "sigma2" values returned by
ClarkLDF and by ClarkCapeCod and calculates the matrix
-sigma2*FI^-1.
Daniel Murphy
Clark, David R., "LDF Curve-Fitting and Stochastic Reserving: A Maximum Likelihood Approach", Casualty Actuarial Society Forum, Fall, 2003
x <- GenIns colnames(x) <- 12*as.numeric(colnames(x)) Y <- ClarkCapeCod(x, Premium=10000000+400000*0:9, maxage=240) round(vcov(Y),6) ## Compare to matrix on p. 69 of Clark's paper # The estimates of the loglogistic parameters Y$THETAG # The standard errors of the estimated parameters sqrt(tail(diag(vcov(Y)), 2)) # The parameter risks of the estimated reserves are calculated # according to the formula on p. 54 of Clark's paper. For example, for # the 5th accident year, pre- and post-multiply the covariance matrix # by a matrix consisting of the gradient entries for just that accident year FVgrad5 <- matrix(Y$FutureValueGradient[, 5], ncol=1) sqrt(t(FVgrad5) %*% vcov(Y) %*% FVgrad5) ## compares to 314,829 in Clark's paper # The estimated reserves for accident year 5: Y$FutureValue[5] ## compares to 2,046,646 in the paper # Recalculate the parameter risk CV for all accident years in total (10.6% in paper): sqrt(sum(t(Y$FutureValueGradient) %*% vcov(Y) %*% Y$FutureValueGradient)) / Y$Total$FutureValue
x <- GenIns colnames(x) <- 12*as.numeric(colnames(x)) Y <- ClarkCapeCod(x, Premium=10000000+400000*0:9, maxage=240) round(vcov(Y),6) ## Compare to matrix on p. 69 of Clark's paper # The estimates of the loglogistic parameters Y$THETAG # The standard errors of the estimated parameters sqrt(tail(diag(vcov(Y)), 2)) # The parameter risks of the estimated reserves are calculated # according to the formula on p. 54 of Clark's paper. For example, for # the 5th accident year, pre- and post-multiply the covariance matrix # by a matrix consisting of the gradient entries for just that accident year FVgrad5 <- matrix(Y$FutureValueGradient[, 5], ncol=1) sqrt(t(FVgrad5) %*% vcov(Y) %*% FVgrad5) ## compares to 314,829 in Clark's paper # The estimated reserves for accident year 5: Y$FutureValue[5] ## compares to 2,046,646 in the paper # Recalculate the parameter risk CV for all accident years in total (10.6% in paper): sqrt(sum(t(Y$FutureValueGradient) %*% vcov(Y) %*% Y$FutureValueGradient)) / Y$Total$FutureValue