Skip to contents

This function compares the expected payments with the actual payments that arose the next year per origin year.

Usage

backtesting_1y_per_origin_year(sim_result_series_old, extended_claims_data_new)

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.

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. 2,80 secs          
 3 of 10 (30%) --- remaining time approx. 2,45 secs          
 4 of 10 (40%) --- remaining time approx. 2,09 secs          
 5 of 10 (50%) --- remaining time approx. 1,77 secs          
 6 of 10 (60%) --- remaining time approx. 1,46 secs          
 7 of 10 (70%) --- remaining time approx. 1,17 secs          
 8 of 10 (80%) --- remaining time approx. 0,87 secs          
 9 of 10 (90%) --- remaining time approx. 0,57 secs          
 10 of 10 (100%) --- remaining time approx. 0,29 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_per_origin_year(sim_result_series_old = series,
                                    extended_claims_data_new = extended_claims_data_new)