| Title: | Tool-Box of Chain Ladder Plus Models |
|---|---|
| Description: | Implementation of the age-period-cohort models for the claim development presented in the manuscript 'Replicating and extending chain-ladder via an age-period-cohort structure on the claim development in a run-off triangle' <doi:10.1080/10920277.2025.2496725>. |
| Authors: | Gabriele Pittarello [aut, cre, cph] (ORCID: <https://orcid.org/0000-0003-3360-5826>), Munir Hiabu [aut, cph] (ORCID: <https://orcid.org/0000-0001-5846-667X>), Andres Villegas [aut, cph] |
| Maintainer: | Gabriele Pittarello <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.1.0 |
| Built: | 2026-07-24 13:09:29 UTC |
| Source: | https://github.com/gpitt71/clmplus |
Pre-process Run-Off Triangles.
AggregateDataPP( cumulative.payments.triangle, entries.weights = NULL, eta = 1/2 )AggregateDataPP( cumulative.payments.triangle, entries.weights = NULL, eta = 1/2 )
cumulative.payments.triangle |
A square numeric matrix with at least two rows. Rows are accident periods, columns are development periods, and observed upper-triangle cells satisfy 'row + column <= J + 1'. Values are non-negative cumulative paid amounts in the source data's monetary units, non-decreasing across each row; unavailable cells may be 'NA'. Recoveries (negative incremental payments) are not supported. |
entries.weights |
Optional non-negative numeric 'J' by 'J' matrix of fitting weights in the same accident/development layout. 'NULL' gives observed cells weight one. The first development period and missing cells are always zero-weighted after conversion to calendar coordinates. |
eta |
One finite numeric value in '(0, 1]', default '0.5', describing expected within-cell payment timing (lost exposure). It is used to derive exposure and to convert fitted hazards to development factors. |
An 'AggregateDataPP' list with:
cumulative.payments.triangle |
The input 'J' by 'J' cumulative paid triangle, unchanged. |
occurrance |
A 'J' by 'J' matrix of incremental paid amounts in development-period by calendar-period coordinates. The misspelling is retained as a stable public field name. |
exposure |
A 'J' by 'J' numeric matrix in the same calendar coordinates, calculated as cumulative payments minus '(1 - eta) * occurrence'. |
incremental.payments.triangle |
A 'J' by 'J' accident/development matrix of incremental paid amounts. |
fit.w |
The 'J' by 'J' fitting-weight matrix in development/calendar coordinates. |
J |
The integer triangle dimension. |
diagonal |
A length-'J' numeric vector containing the latest observed cumulative diagonal in calendar representation. |
eta |
The supplied within-cell timing scalar. |
Pittarello, G., Hiabu, M., & Villegas, A. M. (2023). Replicating and extending chain-ladder via an age-period-cohort structure on the claim development in a run-off triangle. arXiv preprint arXiv:2301.03858.
data(sifa.mtpl) sifa.mtpl.rtt <- AggregateDataPP(cumulative.payments.triangle=sifa.mtpl)data(sifa.mtpl) sifa.mtpl.rtt <- AggregateDataPP(cumulative.payments.triangle=sifa.mtpl)
Dataset of cumulative paid claims for a small italian company in the line of business: general third party liability.
amases.gtplamases.gtpl
A 12 by 12 numeric matrix of cumulative paid claims. Rows index accident years and columns index development years; cells below the observed run-off triangle are ‘NA'. Amounts are in the source’s recorded monetary units. No additional preprocessing has been applied.
Savelli, Nino, and Clemente, Gian Paolo. "Lezioni di matematica attuariale delle assicurazioni danni." EDUCatt-Ente per il diritto allo studio universitario dell'Università Cattolica, 2014
Dataset of cumulative paid claims for a small italian company in the line of business: motor or damage.
amases.modamases.mod
A 12 by 12 numeric matrix of cumulative paid claims. Rows index accident years and columns index development years; cells below the observed run-off triangle are ‘NA'. Amounts are in the source’s recorded monetary units. No additional preprocessing has been applied.
Savelli, Nino, and Clemente, Gian Paolo. "Lezioni di matematica attuariale delle assicurazioni danni." EDUCatt-Ente per il diritto allo studio universitario dell'Università Cattolica, 2014
Dataset of cumulative paid claims for a small italian company in the line of business: motor third party liability.
amases.mtplamases.mtpl
A 12 by 12 numeric matrix of cumulative paid claims. Rows index accident years and columns index development years; cells below the observed run-off triangle are ‘NA'. Amounts are in the source’s recorded monetary units. No additional preprocessing has been applied.
Savelli, Nino, and Clemente, Gian Paolo. "Lezioni di matematica attuariale delle assicurazioni danni." EDUCatt-Ente per il diritto allo studio universitario dell'Università Cattolica, 2014
Fits one of the package's age, age-cohort, age-period, or age-period-cohort claim-development models to data prepared by [AggregateDataPP()]. Estimation is performed by [StMoMo::fit.StMoMo()].
clmplus( AggregateDataPP, hazard.model = NULL, link = c("log", "logit"), staticAgeFun = TRUE, periodAgeFun = "NP", cohortAgeFun = NULL, effect_log_scale = TRUE, verbose = FALSE, constFun = function(ax, bx, kt, b0x, gc, wxt, ages) { list(ax = ax, bx = bx, kt = kt, b0x = b0x, gc = gc) }, ... ) ## Default S3 method: clmplus( AggregateDataPP, hazard.model = NULL, link = c("log", "logit"), staticAgeFun = TRUE, periodAgeFun = "NP", cohortAgeFun = NULL, effect_log_scale = TRUE, verbose = FALSE, constFun = function(ax, bx, kt, b0x, gc, wxt, ages) { list(ax = ax, bx = bx, kt = kt, b0x = b0x, gc = gc) }, ... ) ## S3 method for class 'AggregateDataPP' clmplus( AggregateDataPP, hazard.model = NULL, link = c("log", "logit"), staticAgeFun = TRUE, periodAgeFun = "NP", cohortAgeFun = NULL, effect_log_scale = TRUE, verbose = FALSE, constFun = function(ax, bx, kt, b0x, gc, wxt, ages) { list(ax = ax, bx = bx, kt = kt, b0x = b0x, gc = gc) }, ... )clmplus( AggregateDataPP, hazard.model = NULL, link = c("log", "logit"), staticAgeFun = TRUE, periodAgeFun = "NP", cohortAgeFun = NULL, effect_log_scale = TRUE, verbose = FALSE, constFun = function(ax, bx, kt, b0x, gc, wxt, ages) { list(ax = ax, bx = bx, kt = kt, b0x = b0x, gc = gc) }, ... ) ## Default S3 method: clmplus( AggregateDataPP, hazard.model = NULL, link = c("log", "logit"), staticAgeFun = TRUE, periodAgeFun = "NP", cohortAgeFun = NULL, effect_log_scale = TRUE, verbose = FALSE, constFun = function(ax, bx, kt, b0x, gc, wxt, ages) { list(ax = ax, bx = bx, kt = kt, b0x = b0x, gc = gc) }, ... ) ## S3 method for class 'AggregateDataPP' clmplus( AggregateDataPP, hazard.model = NULL, link = c("log", "logit"), staticAgeFun = TRUE, periodAgeFun = "NP", cohortAgeFun = NULL, effect_log_scale = TRUE, verbose = FALSE, constFun = function(ax, bx, kt, b0x, gc, wxt, ages) { list(ax = ax, bx = bx, kt = kt, b0x = b0x, gc = gc) }, ... )
AggregateDataPP |
An object created by [AggregateDataPP()]. It contains a square cumulative paid-claims triangle and the corresponding development-calendar occurrence, exposure, and weight matrices. |
hazard.model |
A required character scalar selecting '"a"' (age only, equivalent to chain ladder), '"ac"' (age-cohort), '"ap"' (age-period), or '"apc"' (age-period-cohort). |
link, staticAgeFun, periodAgeFun, cohortAgeFun, constFun
|
Compatibility arguments retained from the original interface. The package's four built-in model definitions determine these settings, so these arguments are currently ignored. |
effect_log_scale |
A logical scalar. If 'TRUE' (the default), fitted effects are returned on the linear-predictor/log scale; if 'FALSE', they are exponentiated. |
verbose |
A logical scalar passed to [StMoMo::fit.StMoMo()]. The default 'FALSE' hides StMoMo fitting progress. 'TRUE' displays progress, including zero-weighted ages, years, and cohorts and the start/finish of the gnm fit. |
... |
Reserved for future extensions; no arguments are currently forwarded. |
Incremental payment amounts can be non-integer even though the StMoMo fit uses a Poisson quasi-likelihood. Warnings whose messages begin exactly with 'non-integer x =' are therefore expected and are selectively muffled. All other warnings, including convergence and numerical warnings, remain visible.
A 'clmplusmodel' list with:
The underlying 'fitStMoMo' object. Its fitted 'ax', 'kt', and 'gc' fields contain the selected age, period, and cohort effects; inapplicable effects are 'NULL'. Other fields are supplied by StMoMo and should be treated as implementation details.
A list containing 'J' (triangle dimension), 'eta' (within-cell exposure timing), 'hazard.model', 'diagonal' (latest observed cumulative payments by calendar representation), and the original 'cumulative.payments.triangle'.
A 'J' by 'J' numeric matrix in accident-year by development-year triangle orientation. Unobserved cells are 'NA'.
A 'J' by 'J' numeric matrix of fitted multiplicative cumulative development factors; unavailable cells are 'NA'.
A list with 'fitted_development_effect', 'fitted_calendar_effect', and 'fitted_accident_effect'. Components not included in the selected model are 'NULL'.
The default method always raises an informative error because 'AggregateDataPP' does not inherit from '"AggregateDataPP"'.
[AggregateDataPP()], [predict.clmplusmodel()], [predictReserve.clmplusmodel()], [plot.clmplusmodel()]
data(sifa.mtpl) prepared <- AggregateDataPP(sifa.mtpl) age_fit <- clmplus(prepared, hazard.model = "a", verbose = FALSE) age_fit$fitted_effects apc_fit <- clmplus(prepared, hazard.model = "apc", verbose = FALSE) plot(apc_fit)data(sifa.mtpl) prepared <- AggregateDataPP(sifa.mtpl) age_fit <- clmplus(prepared, hazard.model = "a", verbose = FALSE) age_fit$fitted_effects apc_fit <- clmplus(prepared, hazard.model = "apc", verbose = FALSE) plot(apc_fit)
This function allows to define the behavior of the triangle payments.
## S3 method for class 'AggregateDataPP' plot(x, ...)## S3 method for class 'AggregateDataPP' plot(x, ...)
x |
An 'AggregateDataPP' object. |
... |
Reserved; currently ignored. |
A 'gtable' containing two ggplot panels (incremental and cumulative paid amounts), returned visibly after being drawn.
Pittarello, Gabriele, Munir Hiabu, and Andrés M. Villegas. "Replicating and extending chain ladder via an age-period-cohort structure on the claim development in a run-off triangle." arXiv preprint arXiv:2301.03858 (2023).
data(sifa.mtpl) sifa.mtpl.pp <- AggregateDataPP(cumulative.payments.triangle=sifa.mtpl) plot(sifa.mtpl.pp)data(sifa.mtpl) sifa.mtpl.pp <- AggregateDataPP(cumulative.payments.triangle=sifa.mtpl) plot(sifa.mtpl.pp)
This function allows to plot the hazard model residuals on the triangle payments.
## S3 method for class 'clmplusmodel' plot(x, heat.lim = c(-2.5, 2.5), ...)## S3 method for class 'clmplusmodel' plot(x, heat.lim = c(-2.5, 2.5), ...)
x |
A fitted 'clmplusmodel' object. |
heat.lim |
A length-two numeric vector giving the lower and upper fill scale limits for scaled deviance residuals. |
... |
Reserved; currently ignored. |
A 'ggplot' object showing scaled deviance residuals in accident-year by development-year triangle form.
Pittarello, Gabriele, Munir Hiabu, and Andrés M. Villegas. "Replicating and extending chain ladder via an age-period-cohort structure on the claim development in a run-off triangle." arXiv preprint arXiv:2301.03858 (2023).
data(sifa.mtpl) sifa.mtpl.rtt <- AggregateDataPP(cumulative.payments.triangle=sifa.mtpl) clm.fit<-clmplus(sifa.mtpl.rtt, 'a') plot(clm.fit)data(sifa.mtpl) sifa.mtpl.rtt <- AggregateDataPP(cumulative.payments.triangle=sifa.mtpl) clm.fit<-clmplus(sifa.mtpl.rtt, 'a') plot(clm.fit)
This function allows to define the behavior of the triangle payments.
## S3 method for class 'clmpluspredictions' plot(x, cy.type = "fe", ...)## S3 method for class 'clmpluspredictions' plot(x, cy.type = "fe", ...)
x |
A 'clmpluspredictions' object returned by [predict.clmplusmodel()]. |
cy.type |
Either '"fe"' (the default) to include extrapolated calendar effects or '"f"' to show only fitted calendar effects. |
... |
Reserved; currently ignored. |
A 'gtable' containing one ggplot panel for each effect included in the fitted model. The table is returned visibly after being drawn.
Pittarello, G., Hiabu, M., & Villegas, A. M. (2023). Replicating and extending chain-ladder via an age-period-cohort structure on the claim development in a run-off triangle. arXiv preprint arXiv:2301.03858.
data(sifa.mtpl) sifa.mtpl.rtt <- AggregateDataPP(cumulative.payments.triangle=sifa.mtpl) clm.fit<-clmplus(sifa.mtpl.rtt, 'a') clm <- predict(clm.fit) plot(clm)data(sifa.mtpl) sifa.mtpl.rtt <- AggregateDataPP(cumulative.payments.triangle=sifa.mtpl) clm.fit<-clmplus(sifa.mtpl.rtt, 'a') clm <- predict(clm.fit) plot(clm)
Predict the lower triangle with a clmplus model.
## S3 method for class 'clmplusmodel' predict( object, gk.fc.model = "a", ckj.fc.model = "a", gk.order = c(1, 1, 0), ckj.order = c(0, 1, 0), forecasting_horizon = NULL, constrained_development_factors = FALSE, ... )## S3 method for class 'clmplusmodel' predict( object, gk.fc.model = "a", ckj.fc.model = "a", gk.order = c(1, 1, 0), ckj.order = c(0, 1, 0), forecasting_horizon = NULL, constrained_development_factors = FALSE, ... )
object |
|
gk.fc.model |
|
ckj.fc.model |
|
gk.order |
|
ckj.order |
|
forecasting_horizon |
|
constrained_development_factors |
|
... |
Extra arguments to be passed to the predict function. |
Returns the following output:
reserve |
|
ultimate_cost |
|
full_triangle |
|
lower_triangle |
|
development_factors_predicted |
|
apc_output |
|
Pittarello, Gabriele, Munir Hiabu, and Andrés M. Villegas. "Replicating and extending chain ladder via an age-period-cohort structure on the claim development in a run-off triangle." arXiv preprint arXiv:2301.03858 (2023).
Dataset of cumulative paid claims for a medium italian company in the line of business: general third party liability.
sifa.gtplsifa.gtpl
A 12 by 12 numeric matrix of cumulative paid claims. Rows index accident years and columns index development years; cells below the observed run-off triangle are ‘NA'. Amounts are in the source’s recorded monetary units. No additional preprocessing has been applied.
Savelli, Nino, and Clemente, Gian Paolo. "Lezioni di matematica attuariale delle assicurazioni danni." EDUCatt-Ente per il diritto allo studio universitario dell'Università Cattolica, 2014
Dataset of cumulative paid claims for a medium italian company in the line of business: motor or damage.
sifa.modsifa.mod
A 12 by 12 numeric matrix of cumulative paid claims. Rows index accident years and columns index development years; cells below the observed run-off triangle are ‘NA'. Amounts are in the source’s recorded monetary units. No additional preprocessing has been applied.
Savelli, Nino, and Clemente, Gian Paolo. "Lezioni di matematica attuariale delle assicurazioni danni." EDUCatt-Ente per il diritto allo studio universitario dell'Università Cattolica, 2014
Dataset of cumulative paid claims for a medium italian company in the line of business: motor third party liability.
sifa.mtplsifa.mtpl
A 12 by 12 numeric matrix of cumulative paid claims. Rows index accident years and columns index development years; cells below the observed run-off triangle are ‘NA'. Amounts are in the source’s recorded monetary units. No additional preprocessing has been applied.
Savelli, Nino, and Clemente, Gian Paolo. "Lezioni di matematica attuariale delle assicurazioni danni." EDUCatt-Ente per il diritto allo studio universitario dell'Università Cattolica, 2014