Skip to contents

Generate pools to sample from

Usage

generate_pools(
  extended_claims_data,
  reserve_classes,
  years_for_pools,
  start_of_tail,
  end_of_tail,
  lower_outlier_limit = -Inf,
  upper_outlier_limit = Inf,
  pool_of_annuities
)

Arguments

extended_claims_data

Dataframe as output of prepare_data().

reserve_classes

Numeric vector to specify reserve classes at the niveau of index_year, see details of prepare_data().

years_for_pools

Vector containing the calendar years that shall be used to build the pools.

start_of_tail

First year to be treated as a tail year.

end_of_tail

Last development year.

lower_outlier_limit

Numeric value to specify lower outlier limit at the niveau of index_year see details of prepare_data(). Lower payments will be set to lower_outlier_limit.

upper_outlier_limit

Numeric value to specify upper outlier limit at the niveau of index_year, see details of prepare_data(). Higher payments will be set to upper_outlier_limit.

pool_of_annuities

Pool of annuities that was used to generate extended_claims_data.

Value

List of three objects, see details.

Details

The function returns a list of three objects:

  1. pretail pools
    This is a list containing one list per reserve class which contain one dataframe per development year. These dataframes are the pools of historic claims from which to sample if a newer claim has the corresponding development year and reserve class. It consists of the following columns:

    • Ind_cl_payment_cal is the indexed calendar year payment.

    • Exit_reserve_class is the "new" reserve class after the year.

    • New_annuity_1 to New_annuity_5 are the indices of new annuities in the dataframe pool_of_annuities.

    • Ind_entry_cl_reserve is the entry claim reserve which is only used for analysing purposes, for example to identify special claims.

  2. tail pools
    This is a list containing one dataframe per class. No distinction is made between development years except in the indexed calendar year payments. These are raised to the niveau of the first tail year. The columns are the same as in 1.

  3. pool of annuities
    As the first two lists refer to the index in this pool, it has to be attached to enable sampling.

Note that in the pools list the first reserve class is always reserve class 0 and the first development year is always development year 2!

Examples

# this example uses data provided with this package
extended_claims_data <- prepare_data(claims_data = minimal_claims_data_xmpl,
                                     indices = indices_xmpl,
                                     threshold = 400000,
                                     first_orig_year = 1989,
                                     last_orig_year = 2023,
                                     expected_year_of_growing_large = 3,
                                     reserve_classes = c(1, 200001, 400001, 700001, 1400001),
                                     pool_of_annuities = minimal_pool_of_annuities_xmpl)

pools <- generate_pools(extended_claims_data = extended_claims_data,
                        reserve_classes = c(1, 200001, 400001, 700001, 1400001),
                        years_for_pools = 2014:2023,
                        start_of_tail = 17,
                        end_of_tail = 50,
                        lower_outlier_limit = -Inf,
                        upper_outlier_limit = Inf,
                        pool_of_annuities = minimal_pool_of_annuities_xmpl)
# pretail pools reserve class 0 and development year 2
print(pools[[1]][[1]][[1]])
#>   Ind_cl_payment_cal Exit_reserve_class New_annuity_1 New_annuity_2
#> 1                  0                  0             0             0
#>   New_annuity_3 New_annuity_4 New_annuity_5 Ind_entry_cl_reserve
#> 1             0             0             0                    0

# tail pools reserve class 2
print(pools[[2]][[3]])
#>     Ind_cl_payment_cal Exit_reserve_class New_annuity_1 New_annuity_2
#> 160             0.0000                  2             0             0
#> 161             0.0000                  2             0             0
#> 162             0.0000                  2             0             0
#> 163        143126.8123                  1             0             0
#> 229         45648.6240                  2             0             0
#> 230             0.0000                  2             0             0
#> 231             0.0000                  2             0             0
#> 232             0.0000                  2             0             0
#> 233             0.0000                  1             0             0
#> 414             0.0000                  2             0             0
#> 415           174.7804                  2             0             0
#>     New_annuity_3 New_annuity_4 New_annuity_5 Ind_entry_cl_reserve
#> 160             0             0             0             282441.2
#> 161             0             0             0             279903.1
#> 162             0             0             0             278470.5
#> 163             0             0             0             277107.9
#> 229             0             0             0             284702.1
#> 230             0             0             0             246531.8
#> 231             0             0             0             245270.1
#> 232             0             0             0             244069.9
#> 233             0             0             0             240440.4
#> 414             0             0             0             286951.2
#> 415             0             0             0             268498.4

# pool of annuities
print(pools[[3]])
#>   Claim_id Annuity_id Origin_year Calendar_year Entering_year Annuity_start
#> 1 Claim#43          1        2006          2009          2009          2009
#> 2 Claim#51          1        2010          2013          2013          2036
#> 3 Claim#13          2        1990          2009          2009          2009
#> 4 Claim#22          1        1996          2004          2004          2004
#> 5 Claim#22          2        1996          2004          2004          2016
#>   Annuity_end Birth_year Gender Annual_payment Dynamic
#> 1           0       1939      m      12168.214       0
#> 2        2051       1986      m      12892.997       0
#> 3        2012       1988      w       7094.071       0
#> 4        2016       1960      m       5645.357       0
#> 5        2025       1960      m      41642.501       0