Skip to contents

This function compares the expected payments with the actual payment that arose the next year on a single claim basis.

Usage

backtesting_1y_single_per_dev_year(
  sim_result_series_old,
  extended_claims_data_new,
  reserve_class,
  dev_years,
  label = "Claim_id"
)

Arguments

sim_result_series_old

Object created by sicr_series() containing a series of possible realisations.

extended_claims_data_new

Object created by prepare_data() at least one year later.

reserve_class

Integer. Desired reserve class.

dev_years

Integer vector for the development years (since turning large) to be included.

label

Must be one of "Claim_id" or "Origin_year". Default: "Claim_id". Note that no labels will be shown if ggrepel package is not installed.

Value

ggplot2 object

Examples

# this example uses data provided with this package
claims_data_old <- dplyr::filter(claims_data_xmpl,
                                 Calendar_year <= 2022)

historic_indices_old <- dplyr::filter(historic_indices_xmpl,
                                      Calendar_year <= 2022)

indices_old <- expand_historic_indices(historic_indices_old,
                                       first_orig_year = 1989,
                                       last_orig_year = 2022,
                                       index_gross_future = 0.03,
                                       index_re_future = 0.02)

indices_old <- add_transition_factor(indices_old, index_year = 2022)
extended_claims_data <- prepare_data(claims_data = claims_data_old,
                                     indices = indices_old,
                                     threshold = 400000,
                                     first_orig_year = 1989,
                                     last_orig_year = 2022,
                                     expected_year_of_growing_large = 3,
                                     reserve_classes = c(1, 200001, 400001, 700001, 1400001),
                                     pool_of_annuities = 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:2022,
                        start_of_tail = 17,
                        end_of_tail = 50,
                        lower_outlier_limit = -Inf,
                        upper_outlier_limit = Inf,
                        pool_of_annuities = pool_of_annuities_xmpl)

large_claims_list <- generate_claims_list(extended_claims_data = extended_claims_data,
                                          first_orig_year = 1989,
                                          last_orig_year = 2022)

history <- generate_history_per_claim(data = extended_claims_data,
                                      column = "Cl_payment_cal",
                                      first_orig_year = 1989,
                                      last_orig_year = 2022)

series <- sicr_series(n = 10,
                      large_claims_list = large_claims_list,
                      first_orig_year = 1989,
                      last_orig_year = 2022,
                      pools = pools,
                      indices = indices_old,
                      history = history)
#> 
 1 of 10 (10%) --- remaining time approx. Inf secs          
 2 of 10 (20%) --- remaining time approx. 1,39 secs          
 3 of 10 (30%) --- remaining time approx. 1,25 secs          
 4 of 10 (40%) --- remaining time approx. 1,39 secs          
 5 of 10 (50%) --- remaining time approx. 1,10 secs          
 6 of 10 (60%) --- remaining time approx. 1,01 secs          
 7 of 10 (70%) --- remaining time approx. 0,77 secs          
 8 of 10 (80%) --- remaining time approx. 0,61 secs          
 9 of 10 (90%) --- remaining time approx. 0,39 secs          
 10 of 10 (100%) --- remaining time approx. 0,19 secs          

extended_claims_data_new <- prepare_data(claims_data = 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 = pool_of_annuities_xmpl)

g <- backtesting_1y_single_per_dev_year(sim_result_series_old = series,
                                        extended_claims_data_new = extended_claims_data_new,
                                        reserve_class = 3,
                                        dev_year = 2:16)