Attach future annuities to extended_claims_data
attach_future_annuities.Rd
The columns New_annuity_1
to New_annuity_5
are added to the dataframe. If new annuities have been agreed on
in the calendar year and the claim of the row, these columns contain the row number of these annuities in the corresponding
dataframe pool_of_annuities
. These columns are needed for the pool as the sampling shall consider claim payments and
new reserve classes as well as new annuities.
The function always adds five columns for new annuities which is sufficient for the rare case that five new annuities are agreed on
for one single claim in one calendar year. Each further new annuity in one year will be ignored, which could lead to a slight underestimation
of the best estimate. To avoid this, data may be manually adjusted, for example by moving further annuities to another calendar year or
by aggregating annuities.
This function resembles only step 7 of the data preparation process, see description in details of prepare_data()
Arguments
- extended_claims_data
dataframe after step 6, see details of
prepare_data()
.- pool_of_annuities
dataframe containing one row for each annuity that has ever been agreed on, see details of
prepare_data()
.
Examples
# this example uses data provided with this package
library(dplyr)
new_data <- minimal_claims_data_xmpl %>%
reduce_data(indices_xmpl, 400000) %>%
add_missing_years(2023) %>%
add_columns() %>%
add_indexed_columns(indices_xmpl) %>%
filter_large_claims(400000, 1989, 3) %>%
add_classes(c(1, 200001, 400001, 700001, 1400001)) %>%
attach_future_annuities(minimal_pool_of_annuities_xmpl)
head(new_data)
#> Claim_id Origin_year Calendar_year Cl_payment_cal Cl_reserve An_payment_cal
#> 1 Claim#1 1976 1976 0 0 0
#> 2 Claim#1 1976 1977 0 0 0
#> 3 Claim#1 1976 1978 0 0 0
#> 4 Claim#1 1976 1979 0 0 0
#> 5 Claim#1 1976 1980 0 0 0
#> 6 Claim#1 1976 1981 0 0 0
#> An_reserve Development_year Payment_cal Reserve Cl_payment_cum An_payment_cum
#> 1 0 1 0 0 0 0
#> 2 0 2 0 0 0 0
#> 3 0 3 0 0 0 0
#> 4 0 4 0 0 0 0
#> 5 0 5 0 0 0 0
#> 6 0 6 0 0 0 0
#> Payment_cum Cl_incurred An_incurred Incurred Entry_cl_reserve
#> 1 0 0 0 0 0
#> 2 0 0 0 0 0
#> 3 0 0 0 0 0
#> 4 0 0 0 0 0
#> 5 0 0 0 0 0
#> 6 0 0 0 0 0
#> Entry_an_reserve Entry_reserve Ind_cl_payment_cal Ind_an_payment_cal
#> 1 0 0 0 0
#> 2 0 0 0 0
#> 3 0 0 0 0
#> 4 0 0 0 0
#> 5 0 0 0 0
#> 6 0 0 0 0
#> Ind_payment_cal Ind_cl_reserve Ind_an_reserve Ind_entry_cl_reserve
#> 1 0 0 0 0
#> 2 0 0 0 0
#> 3 0 0 0 0
#> 4 0 0 0 0
#> 5 0 0 0 0
#> 6 0 0 0 0
#> Ind_entry_an_reserve Ind_entry_reserve Ind_reserve Ind_cl_payment_cum
#> 1 0 0 0 0
#> 2 0 0 0 0
#> 3 0 0 0 0
#> 4 0 0 0 0
#> 5 0 0 0 0
#> 6 0 0 0 0
#> Ind_an_payment_cum Ind_payment_cum Ind_cl_incurred Ind_an_incurred
#> 1 0 0 0 0
#> 2 0 0 0 0
#> 3 0 0 0 0
#> 4 0 0 0 0
#> 5 0 0 0 0
#> 6 0 0 0 0
#> Ind_incurred Large_since Dev_year_of_growing_large Dev_year_since_large
#> 1 0 1978 3 -1
#> 2 0 1978 3 0
#> 3 0 1978 3 1
#> 4 0 1978 3 2
#> 5 0 1978 3 3
#> 6 0 1978 3 4
#> Entry_reserve_class Exit_reserve_class New_annuity_1 New_annuity_2
#> 1 0 0 0 0
#> 2 0 0 0 0
#> 3 0 0 0 0
#> 4 0 0 0 0
#> 5 0 0 0 0
#> 6 0 0 0 0
#> New_annuity_3 New_annuity_4 New_annuity_5
#> 1 0 0 0
#> 2 0 0 0
#> 3 0 0 0
#> 4 0 0 0
#> 5 0 0 0
#> 6 0 0 0