Helper function to create a matrix with indices per claim stemming from reinsurance treaty clause
generate_xl_indices_per_claim.Rd
This helper function converts the dataframes reinsurance
and indices
into a matrix with
one row per claim and one column for each past year from first_orig_year
to last_orig_year
and
for 250 future calendar years.
This matrix will be used to properly calculate the reinsurance payments.
Usage
generate_xl_indices_per_claim(
claims_list,
reinsurance,
indices,
first_orig_year,
last_orig_year
)
Arguments
- claims_list
dataframe of claims generated with
generate_claims_list()
.- reinsurance
dataframe of reinsurance structures, see details of
xl_cashflow()
.- indices
dataframe for indexation, see details of
prepare_data()
.- first_orig_year
integer value for the first origin year, will be treated as the first observed calendar year.
- last_orig_year
integer value for the last origin year which will also be treated as the last calendar year, usually the calendar year that just ended.
Value
numeric matrix with one row per claim and one column for each past and 250 future calendar years. Entries for years before the claim origin year are set to 1. The other entries are indexation factors.
Examples
# this example uses data provided with this package
# Create large claims list
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)
large_claims_list <- generate_claims_list(extended_claims_data = extended_claims_data,
first_orig_year = 1989,
last_orig_year = 2023)
print(reinsurance_xmpl)
#> Origin_year Priority Limit Base_year Margin_type Margin Quota_share
#> 1 1989 500000 1500000 1988 FIC 0.0 0.5
#> 2 1990 500000 1500000 1988 FIC 0.0 0.5
#> 3 1991 500000 1500000 1988 FIC 0.0 0.5
#> 4 1992 500000 1500000 1988 FIC 0.0 0.5
#> 5 1993 500000 1500000 1988 FIC 0.0 0.5
#> 6 1994 0 0 0 none 0.0 0.7
#> 7 1995 0 0 0 none 0.0 0.7
#> 8 1996 0 0 0 none 0.0 0.7
#> 9 1997 0 0 0 none 0.0 0.7
#> 10 1998 0 0 0 none 0.0 0.7
#> 11 1999 1000000 3000000 1998 APK 0.1 0.3
#> 12 2000 1000000 3000000 1998 APK 0.1 0.3
#> 13 2001 1000000 3000000 1998 APK 0.1 0.3
#> 14 2002 1000000 3000000 1998 APK 0.1 0.3
#> 15 2003 1000000 3000000 1998 APK 0.1 0.3
#> 16 2004 1000000 3000000 1998 APK 0.1 0.3
#> 17 2005 1000000 3000000 1998 APK 0.1 0.3
#> 18 2006 1000000 3000000 1998 APK 0.1 0.3
#> 19 2007 1000000 3000000 1998 APK 0.1 0.3
#> 20 2008 1000000 3000000 1998 APK 0.1 0.3
#> 21 2009 1000000 3000000 1998 SIC 0.3 0.3
#> 22 2010 1000000 3000000 1998 SIC 0.3 0.3
#> 23 2011 1000000 3000000 1998 SIC 0.3 0.3
#> 24 2012 1000000 3000000 1998 SIC 0.3 0.3
#> 25 2013 1000000 3000000 1998 SIC 0.3 0.3
#> 26 2014 1000000 3000000 1998 SIC 0.3 0.3
#> 27 2015 1000000 3000000 1998 SIC 0.2 0.3
#> 28 2016 1000000 3000000 1998 SIC 0.2 0.3
#> 29 2017 1000000 3000000 1998 SIC 0.2 0.3
#> 30 2018 1000000 3000000 1998 SIC 0.2 0.3
#> 31 2019 1500000 3500000 2019 SIC 0.2 0.2
#> 32 2020 1500000 3500000 2019 SIC 0.2 0.2
#> 33 2021 1500000 3500000 2019 SIC 0.2 0.2
#> 34 2022 1500000 3500000 2019 SIC 0.2 0.2
#> 35 2023 1500000 3500000 2019 SIC 0.2 0.2
# show only first 20 columns
generate_xl_indices_per_claim(claims_list = large_claims_list,
reinsurance = reinsurance_xmpl,
indices = indices_xmpl,
first_orig_year = 1989,
last_orig_year = 2023)[,1:20]
#> 1989 1990 1991 1992 1993 1994 1995 1996
#> Claim#10 1.040901 1.068969 1.11223 1.168475 1.22076 1.253636 1.275025 1.293509
#> Claim#13 1.040901 1.068969 1.11223 1.168475 1.22076 1.253636 1.275025 1.293509
#> Claim#16 1.040901 1.068969 1.11223 1.168475 1.22076 1.253636 1.275025 1.293509
#> Claim#22 1.000000 1.000000 1.00000 1.000000 1.00000 1.000000 1.000000 1.000000
#> Claim#32 1.000000 1.000000 1.00000 1.000000 1.00000 1.000000 1.000000 1.000000
#> Claim#37 1.000000 1.000000 1.00000 1.000000 1.00000 1.000000 1.000000 1.000000
#> Claim#41 1.000000 1.000000 1.00000 1.000000 1.00000 1.000000 1.000000 1.000000
#> Claim#43 1.000000 1.000000 1.00000 1.000000 1.00000 1.000000 1.000000 1.000000
#> Claim#44 1.000000 1.000000 1.00000 1.000000 1.00000 1.000000 1.000000 1.000000
#> Claim#45 1.000000 1.000000 1.00000 1.000000 1.00000 1.000000 1.000000 1.000000
#> Claim#49 1.000000 1.000000 1.00000 1.000000 1.00000 1.000000 1.000000 1.000000
#> Claim#51 1.000000 1.000000 1.00000 1.000000 1.00000 1.000000 1.000000 1.000000
#> Claim#52 1.000000 1.000000 1.00000 1.000000 1.00000 1.000000 1.000000 1.000000
#> Claim#60 1.000000 1.000000 1.00000 1.000000 1.00000 1.000000 1.000000 1.000000
#> Claim#68 1.000000 1.000000 1.00000 1.000000 1.00000 1.000000 1.000000 1.000000
#> 1997 1998 1999 2000 2001 2002 2003 2004
#> Claim#10 1.318595 1.33061 1.3384 1.357676 1.38461 1.404283 1.418807 1.44244
#> Claim#13 1.318595 1.33061 1.3384 1.357676 1.38461 1.404283 1.418807 1.44244
#> Claim#16 1.318595 1.33061 1.3384 1.357676 1.38461 1.404283 1.418807 1.44244
#> Claim#22 1.000000 1.00000 1.0000 1.000000 1.00000 1.000000 1.000000 1.00000
#> Claim#32 1.000000 1.00000 1.0000 1.000000 1.00000 1.000000 1.000000 1.00000
#> Claim#37 1.000000 1.00000 1.0000 1.000000 1.00000 1.000000 1.000000 1.00000
#> Claim#41 1.000000 1.00000 1.0000 1.000000 1.00000 1.000000 1.000000 1.00000
#> Claim#43 1.000000 1.00000 1.0000 1.000000 1.00000 1.000000 1.000000 1.00000
#> Claim#44 1.000000 1.00000 1.0000 1.000000 1.00000 1.000000 1.000000 1.00000
#> Claim#45 1.000000 1.00000 1.0000 1.000000 1.00000 1.000000 1.000000 1.00000
#> Claim#49 1.000000 1.00000 1.0000 1.000000 1.00000 1.000000 1.000000 1.00000
#> Claim#51 1.000000 1.00000 1.0000 1.000000 1.00000 1.000000 1.000000 1.00000
#> Claim#52 1.000000 1.00000 1.0000 1.000000 1.00000 1.000000 1.000000 1.00000
#> Claim#60 1.000000 1.00000 1.0000 1.000000 1.00000 1.000000 1.000000 1.00000
#> Claim#68 1.000000 1.00000 1.0000 1.000000 1.00000 1.000000 1.000000 1.00000
#> 2005 2006 2007 2008
#> Claim#10 1.464753 1.487859 1.522055 1.56206
#> Claim#13 1.464753 1.487859 1.522055 1.56206
#> Claim#16 1.464753 1.487859 1.522055 1.56206
#> Claim#22 1.000000 1.000000 1.000000 1.00000
#> Claim#32 1.110844 1.128367 1.154301 1.18464
#> Claim#37 1.110844 1.128367 1.154301 1.18464
#> Claim#41 1.110844 1.128367 1.154301 1.18464
#> Claim#43 1.110844 1.128367 1.154301 1.18464
#> Claim#44 1.110844 1.128367 1.154301 1.18464
#> Claim#45 1.110844 1.128367 1.154301 1.18464
#> Claim#49 1.000000 1.000000 1.000000 1.00000
#> Claim#51 1.000000 1.000000 1.000000 1.00000
#> Claim#52 1.000000 1.000000 1.000000 1.00000
#> Claim#60 1.000000 1.000000 1.000000 1.00000
#> Claim#68 1.000000 1.000000 1.000000 1.00000