ReSurv {ReSurv} | R Documentation |
Fit ReSurv
models on the individual data.
Description
This function fits and computes the reserves for the ReSurv
models
Usage
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 |
hazard_model |
|
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 |
|
hparameters |
|
percentage_data_training |
|
grouping_method |
Default is |
check_value |
|
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
: startingIndividualDataPP
object.
References
Munir, H., Emil, H., & Gabriele, P. (2023). A machine learning approach based on survival analysis for IBNR frequencies in non-life reserving. arXiv preprint arXiv:2312.14549.
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")