ReSurv.default: Fit 'ReSurv' models on the individual data.

View source: R/ReSurvIndividualData.R

ReSurv.defaultR Documentation

Fit ReSurv models on the individual data.

Description

This function fits and computes the reserves for the ReSurv models

Usage

## Default S3 method:
ReSurv(
  IndividualDataPP,
  hazard_model = "COX",
  tie = "efron",
  baseline = "spline",
  continuous_features_scaling_method = "minmax",
  random_seed = 1,
  hparameters = list(),
  percentage_data_training = 0.8,
  grouping_method = "exposure",
  check_value = 1.85
)

Arguments

IndividualDataPP

IndividualDataPP object to use for the ReSurv fit.

hazard_model

character, hazard model supported from our package, must be provided as a string. The model can be chosen from:

  • "COX": Standard Cox model for the hazard.

  • "NN": Deep Survival Neural Network.

  • "XGB": eXtreme Gradient Boosting.

tie

ties handling, default is the Efron approach.

baseline

handling the baseline hazard. Default is a spline.

continuous_features_scaling_method

method to preprocess the features

random_seed

integer, random seed set for reproducibility

hparameters

list, hyperparameters for the machine learning models. It will be disregarded for the cox approach.

percentage_data_training

numeric, percentage of data used for training on the upper triangle.

grouping_method

character, use probability or exposure approach to group from input to output development factors. Choice between:

  • "exposure"

  • "probability"

Default is "exposure".

check_value

numeric, check hazard value on initial granularity, if above threshold we increase granularity to try and adjust the development factor.

Details

The model fit uses the theoretical framework of Hiabu et al. (2023), that relies on the correspondence between hazard models and development factors:

To be completed with final notation of the paper.

The ReSurv package assumes proportional hazard models. Given an i.i.d. sample \left\{y_i,x_i\right\}_{i=1, \ldots, n} the individual hazard at time t is:

\lambda_i(t)=\lambda_0(t)e^{y_i(x_i)}

Composed of a baseline \lambda_0(t) and a proportional effect e^{y_i(x_i)}.

Currently, the implementation allows to optimize the partial likelihood (concerning the proportional effects) using one of the following statistical learning approaches:

Value

ReSurv fit. A list containing

  • model.out: list containing the pre-processed covariates data for the fit (data) and the basic model output (model.out;COX, XGB or NN).

  • is_lkh: numeric Training negative log likelihood.

  • os_lkh: numeric Validation negative log likelihood. Not available for COX.

  • hazard_frame: data.frame containing the fitted hazard model with the corresponding covariates. It contains:

    • expg: fitted risk score.

    • baseline: fitted baseline.

    • hazard: fitted hazard rate (expg*baseline).

    • f_i: fitted development factors.

    • cum_f_i: fitted cumulative development factors.

    • S_i:fitted survival function.

    • S_i_lag:fitted survival function (lag version, for further information see ?dplyr::lag).

    • S_i_lead:fitted survival function (lead version, for further information see ?dplyr::lead).

  • hazard_model: string chosen hazard model (COX, NN or XGB)

  • IndividualDataPP: starting IndividualDataPP object.

References

Pittarello, G., Hiabu, M., & Villegas, A. M. (2023). Chain Ladder Plus: a versatile approach for claims reserving. arXiv preprint arXiv:2301.03858.

Therneau, T. M., & Lumley, T. (2015). Package ‘survival’. R Top Doc, 128(10), 28-33.

Katzman, J. L., Shaham, U., Cloninger, A., Bates, J., Jiang, T., & Kluger, Y. (2018). DeepSurv: personalized treatment recommender system using a Cox proportional hazards deep neural network. BMC medical research methodology, 18(1), 1-12.

Chen, T., He, T., Benesty, M., & Khotilovich, V. (2019). Package ‘xgboost’. R version, 90, 1-66.

Examples


input_data_0 <- data_generator(
random_seed = 1964,
scenario = "alpha",
time_unit = 1,
years = 4,
period_exposure = 100)

individual_data <- IndividualDataPP(data = input_data_0,
categorical_features = "claim_type",
continuous_features = "AP",
accident_period = "AP",
calendar_period = "RP",
input_time_granularity = "years",
output_time_granularity = "years",
years=4)


resurv_fit_cox <- ReSurv(individual_data,
hazard_model = "COX")






ReSurv documentation built on April 4, 2025, 1:39 a.m.