Package 'clmplus'

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.48550/arXiv.2301.03858>.
Authors: Gabriele Pittarello [aut, cre, cph] , Munir Hiabu [aut, cph] , Andres Villegas [aut, cph]
Maintainer: Gabriele Pittarello <[email protected]>
License: GPL (>= 2)
Version: 1.0.0
Built: 2024-10-24 11:35:27 UTC
Source: https://github.com/gpitt71/clmplus

Help Index


Pre-process Run-Off Triangles

Description

Pre-process Run-Off Triangles.

Usage

AggregateDataPP(
  cumulative.payments.triangle,
  entries.weights = NULL,
  eta = 1/2
)

Arguments

cumulative.payments.triangle

triangle matrix or matrix array object, input triangle of cumulative payments.

entries.weights

triangle matrix or matrix array model entries weights.

eta

numeric, individual claims exposure in the cell, also known as lost exposure. It must be in the interval (0,1].

Value

An object of class AggregateDataPP. Lists the following elements:

cumulative.payments.triangle

triangle matrix object, input triangle of cumulative payments.

occurrance

matrix array object, the occurrence derived from the input triangle.

exposure

matrix array object, the exposure derived from the input triangle, under the eta claims arrival assumption.

incremental.payments.triangle

triangle matrix object, incremental payments derived from the input.

fit.w

matrix array object, the weights used during estimation.

J

integer, Run-off triangle dimension.

diagonal

numeric, cumulative payments last diagonal.

eta

numeric, Expected time-to-event in the cell. I.e., lost exposure.

References

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.

Examples

data(sifa.mtpl)
sifa.mtpl.rtt <- AggregateDataPP(cumulative.payments.triangle=sifa.mtpl)

Amases GTPL

Description

Dataset of cumulative paid claims for a small italian company in the line of business: general third party liability.

Usage

amases.gtpl

Format

Run-off triangle with 12 development periods.

References

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


Amases MOD

Description

Dataset of cumulative paid claims for a small italian company in the line of business: motor or damage.

Usage

amases.mod

Format

Run-off triangle with 12 development periods.

References

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


Amases MTPL

Description

Dataset of cumulative paid claims for a small italian company in the line of business: motor third party liability.

Usage

amases.mtpl

Format

Run-off triangle with 12 development periods.

References

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


Fit Chain Ladder plus on Run-off Triangles.

Description

Method to Estimate Chain Ladder plus models.

Usage

clmplus(
  AggregateDataPP,
  hazard.model = NULL,
  link = c("log", "logit"),
  staticAgeFun = TRUE,
  periodAgeFun = "NP",
  cohortAgeFun = NULL,
  effect_log_scale = TRUE,
  constFun = function(ax, bx, kt, b0x, gc, wxt, ages) list(ax = ax, bx = bx, kt = kt, b0x
    = b0x, gc = gc),
  ...
)

Arguments

AggregateDataPP

AggregateDataPP object, reverse time triangle to be fitted.

hazard.model

character, hazard model supported from our package. The model can be chosen from:

  • 'a': Age model, this is equivalent to the Mack chain-ladder.

  • 'ac': Age and cohort effects.

  • 'ap': Age and cohort effects.

  • 'apc': Age cohort and period effects.

link

character, defines the link function and random component associated with the mortality model. "log" would assume that deaths follow a Poisson distribution and use a log link while "logit" would assume that deaths follow a Binomial distribution and a logit link. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

staticAgeFun

logical, indicates if a static age function αx\alpha_x is to be included. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

periodAgeFun

list, a list of length NN with the definitions of the period age modulating parameters βx(i)\beta_x^{(i)}. Each entry can take values: "NP" for non-parametric age terms, "1" for βx(i)=1\beta_x^{(i)}=1 or a predefined parametric function of age (see details). Set this to NULL if there are no period terms in the model. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

cohortAgeFun

character or function, defines the cohort age modulating parameter βx(0)\beta_x^{(0)}. It can take values: "NP" for non-parametric age terms, "1" for βx(0)=1\beta_x^{(0)}=1, a predefined parametric function of age (see details) or NULL if there is no cohort effect. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

effect_log_scale

logical, whether effects should be on the logarithmic scale. By default, TRUE.

constFun

function, it defines the identifiability constraints of the model. It must be a function of the form constFun <- function(ax, bx, kt, b0x, gc, wxt, ages) taking a set of fitted model parameters and returning a list list(ax = ax, bx = bx, kt = kt, b0x = b0x, gc = gc) of the model parameters with the identifiability constraints applied. If omitted no identifiability constraints are applied to the model. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

...

parameters to be passed to clmplus.

Value

No return value, called to pass method clmplus.AggregateDataPP. See clmplus.AggregateDataPP documentation.

References

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).

Examples

data(sifa.mtpl)
sifa.mtpl.rtt <- AggregateDataPP(cumulative.payments.triangle=sifa.mtpl)
hz.chl=clmplus(sifa.mtpl.rtt, 'a')

Fit Chain Ladder Plus to reverse time triangles.

Description

Method to fit Chain Ladder plus models to AggregateDataPP objects.

Usage

## S3 method for class 'AggregateDataPP'
clmplus(
  AggregateDataPP,
  hazard.model = NULL,
  link = c("log", "logit"),
  staticAgeFun = TRUE,
  periodAgeFun = "NP",
  cohortAgeFun = NULL,
  effect_log_scale = TRUE,
  constFun = function(ax, bx, kt, b0x, gc, wxt, ages) list(ax = ax, bx = bx, kt = kt, b0x
    = b0x, gc = gc),
  ...
)

Arguments

AggregateDataPP

AggregateDataPP object, reverse time triangle to be fitted.

hazard.model

character, hazard model supported from our package. The model can be chosen from:

  • 'a': Age model, this is equivalent to the Mack chain-ladder.

  • 'ac': Age and cohort effects.

  • 'ap': Age and cohort effects.

  • 'apc': Age cohort and period effects.

link

character, defines the link function and random component associated with the mortality model. "log" would assume that deaths follow a Poisson distribution and use a log link while "logit" would assume that deaths follow a Binomial distribution and a logit link. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

staticAgeFun

logical, indicates if a static age function αx\alpha_x is to be included. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

periodAgeFun

list, a list of length NN with the definitions of the period age modulating parameters βx(i)\beta_x^{(i)}. Each entry can take values: "NP" for non-parametric age terms, "1" for βx(i)=1\beta_x^{(i)}=1 or a predefined parametric function of age (see details). Set this to NULL if there are no period terms in the model. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

cohortAgeFun

character or function, defines the cohort age modulating parameter βx(0)\beta_x^{(0)}. It can take values: "NP" for non-parametric age terms, "1" for βx(0)=1\beta_x^{(0)}=1, a predefined parametric function of age (see details) or NULL if there is no cohort effect. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

effect_log_scale

logical, whether effects should be on the logarithmic scale. By default, TRUE.

constFun

function, it defines the identifiability constraints of the model. It must be a function of the form constFun <- function(ax, bx, kt, b0x, gc, wxt, ages) taking a set of fitted model parameters and returning a list list(ax = ax, bx = bx, kt = kt, b0x = b0x, gc = gc) of the model parameters with the identifiability constraints applied. If omitted no identifiability constraints are applied to the model. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

...

parameters to be passed to clmplus.

Value

An object of class clmplusmodel. A list with the following elements:

model.fit

fitStMoMo object, specified hazard model fit from StMoMo.

apc_input

list object. A list containing the following model inputs in age-period-cohort notation: J (integer) Run-off triangle dimension. eta (numeric) Expected time-to-event in the cell. I.e., lost exposure. diagonal (numeric) Cumulative payments last diagonal. hazard.model (character), hazard model specified from the user. Set to user.specific when a custom model is passed.

hazard_scaled_deviance_residuals

matrix array Triangle of the scaled deviance residuals.

fitted_development_factors

matrix array Triangle of the fitted development factors.

fitted_effects

list List of the development-accident-calendar effects fitted.

References

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).

Examples

data(sifa.mtpl)
sifa.mtpl.rtt <- AggregateDataPP(cumulative.payments.triangle=sifa.mtpl)
hz.chl=clmplus(sifa.mtpl.rtt, 'a')

Fit Chain Ladder Plus to reverse time triangles.

Description

Default method to fit Chain Ladder plus models.

Usage

## Default S3 method:
clmplus(
  AggregateDataPP,
  hazard.model = NULL,
  link = c("log", "logit"),
  staticAgeFun = TRUE,
  periodAgeFun = "NP",
  cohortAgeFun = NULL,
  effect_log_scale = TRUE,
  constFun = function(ax, bx, kt, b0x, gc, wxt, ages) list(ax = ax, bx = bx, kt = kt, b0x
    = b0x, gc = gc),
  ...
)

Arguments

AggregateDataPP

AggregateDataPP object, reverse time triangle to be fitted.

hazard.model

character, hazard model supported from our package. The model can be chosen from:

  • 'a': Age model, this is equivalent to the Mack chain-ladder.

  • 'ac': Age and cohort effects.

  • 'ap': Age and cohort effects.

  • 'apc': Age cohort and period effects.

link

character, defines the link function and random component associated with the mortality model. "log" would assume that deaths follow a Poisson distribution and use a log link while "logit" would assume that deaths follow a Binomial distribution and a logit link. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

staticAgeFun

logical, indicates if a static age function αx\alpha_x is to be included. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

periodAgeFun

list, a list of length NN with the definitions of the period age modulating parameters βx(i)\beta_x^{(i)}. Each entry can take values: "NP" for non-parametric age terms, "1" for βx(i)=1\beta_x^{(i)}=1 or a predefined parametric function of age (see details). Set this to NULL if there are no period terms in the model. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

cohortAgeFun

character or function, defines the cohort age modulating parameter βx(0)\beta_x^{(0)}. It can take values: "NP" for non-parametric age terms, "1" for βx(0)=1\beta_x^{(0)}=1, a predefined parametric function of age (see details) or NULL if there is no cohort effect. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

effect_log_scale

logical, whether effects should be on the logarithmic scale. By default, TRUE.

constFun

function, it defines the identifiability constraints of the model. It must be a function of the form constFun <- function(ax, bx, kt, b0x, gc, wxt, ages) taking a set of fitted model parameters and returning a list list(ax = ax, bx = bx, kt = kt, b0x = b0x, gc = gc) of the model parameters with the identifiability constraints applied. If omitted no identifiability constraints are applied to the model. To be disregarded unless the practitioner specifies his own hazard model in StMoMo.

...

parameters to be passed to clmplus.

Value

No return value, called to pass method clmplus.AggregateDataPP. See clmplus.AggregateDataPP documentation.

References

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).

Hiabu, Munir. “On the relationship between classical chain ladder and granular reserving.” Scandinavian Actuarial Journal 2017 (2017): 708 - 729.


Plot the payments behavior

Description

This function allows to define the behavior of the triangle payments.

Usage

## S3 method for class 'AggregateDataPP'
plot(x, ...)

Arguments

x

AggregateDataPP to be plotted.

...

Arguments to be passed to plot.

Value

No return value, plots the run-off triangle cumulative payments and incremental payments.

References

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).

Examples

data(sifa.mtpl)
sifa.mtpl.pp <- AggregateDataPP(cumulative.payments.triangle=sifa.mtpl)
plot(sifa.mtpl.pp)

Plot the hazard model residuals

Description

This function allows to plot the hazard model residuals on the triangle payments.

Usage

## S3 method for class 'clmplusmodel'
plot(x, heat.lim = c(-2.5, 2.5), ...)

Arguments

x

clmplusmodel object, model fit to plot.

heat.lim

limits in the residuals plot.

...

Extra arguments to be passed to the plot function.

Value

No return value, plots the hazard model residuals in triangular form.

References

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).

Examples

data(sifa.mtpl)
sifa.mtpl.rtt <- AggregateDataPP(cumulative.payments.triangle=sifa.mtpl)
clm.fit<-clmplus(sifa.mtpl.rtt, 'a')
plot(clm.fit)

Plot the hazard model fitted and forecasted parameters

Description

This function allows to define the behavior of the triangle payments.

Usage

## S3 method for class 'clmpluspredictions'
plot(x, cy.type = "fe", ...)

Arguments

x

clmpluspredictions, Model effects (fitted and extrapolated) to be plotted.

cy.type

character, whether to show fitted period effect with or without extrapolatio Default is "fe", standing for fitted and extrapolated. Alternative is to specify "f" for fitted effect.

...

Arguments to be passed to plot.

Value

No return value, plots coefficients of the hazard models.

References

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.

Examples

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 Reserve using Chain Ladder Plus Models

Description

Predict the lower triangle with a clmplus model.

Usage

## 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,
  ...
)

Arguments

object

clmplusmodel, Model to predict from.

gk.fc.model

character, model to forecast the cohort component for the last accident period. It can be either arima ('a') or linear model ('l'). Disregarded for models that do not have a cohort effect.

ckj.fc.model

character, model to forecast the calendar period effect. It can be either arima ('a') or linear model ('l'). Disregarded for models that do not have a period effect.

gk.order

integer, order of the arima model with drift for the accident year effect extrapolation. Default to (1,1,0).

ckj.order

integer, order of the arima model with drift for the calendar year effect extrapolation. Default to (0,1,0).

forecasting_horizon

integer, between 1 and the triangle width. Calendar periods ahead for the predictions. Default predictions are to run-off.

...

Extra arguments to be passed to the predict function.

Value

Returns the following output:

reserve

numeric The reserve for each accident period.

ultimate_cost

numeric The ultimate cost for each accident period.

full_triangle

matrix array The complete run-off triangle of cumulative payments, it includes the (input) upper triangle and the predicted (output) lower triangle.

lower_triangle

matrix array The predicted lower triangle of cumulative payments.

development_factors_predicted

matrix array The predicted lower triangle of the extrapolated development factors.

apc_output

list The following output from the age-period-cohort representation: model.fit (fitStMoMo) age-period-cohort model fit. alphaij (matrix array) predicted claim development. lower_triangle_apc (matrix array) predicted lower triangle of cumulative payments in age-period-cohort form. development_factors_apc (matrix array) development factors in age-period-cohort representation.

References

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).


Sifa GTPL

Description

Dataset of cumulative paid claims for a medium italian company in the line of business: general third party liability.

Usage

sifa.gtpl

Format

Run-off triangle with 12 development periods.

References

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


Sifa MOD

Description

Dataset of cumulative paid claims for a medium italian company in the line of business: motor or damage.

Usage

sifa.mod

Format

Run-off triangle with 12 development periods.

References

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


Sifa MTPL

Description

Dataset of cumulative paid claims for a medium italian company in the line of business: motor third party liability.

Usage

sifa.mtpl

Format

Run-off triangle with 12 development periods.

References

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