Prepares necessary ibnr objects
prepare_ibnr.Rd
The function generates the expected future ibnr claims and the pools of historic ibnr claims from which the claim payments of the future ibnr claims will be sampled.
Usage
prepare_ibnr(
large_claims_list,
first_orig_year,
last_orig_year,
exposure = NULL,
years_for_ibnr_pools = NULL
)
Arguments
- large_claims_list
Dataframe with one row per known large claim as a result of
generate_claims_list()
- first_orig_year
Desired first origin year.
- last_orig_year
Desired last origin year.
- exposure
Dataframe that must contain one row for each origin year between
first_orig_year
andlast_orig_year
and the columnsOrigin_year
andExposure
.
Default: NULL. In this case, a constant exposure is assumed.- years_for_ibnr_pools
Vector containing the calendar years that shall be used to build the pools.
Default: NULL. In this case, all years are used for building ibnr pools.
Value
List of two objects:
Dataframe with one row per expected future ibnr large claim and columns
Origin_year
,Dev_year_of_growing_large
andDev_year_since_large
.Origin_year
is the origin year of the expected future ibnr claim.Dev_year_of_growing_large
is the expected development year in which the expected ibnr claim exceeds the threshold.Dev_year_since_large
is the "new" development year where counting starts in the calendar year the claim exceeded the threshold. As these claims are expected to exceed the threshold in the future, this column must be < 1.
List of one vector per development year with each vector containing the row numbers of the claims in
large_claims_list
that have become large in that development year and in a calendar year inyears_for_ibnr_pools
.
Details
The first object is generated in four steps with the functions get_additive_ibnr_model()
, get_expected_ibnr_numbers()
,
round_expected_ibnr_numbers()
and ibnr_transform2dataframe()
. If one are more functions shall be
replaced by own implementations, the functions may be used separately.
Examples
# prepare data
extended_claims_data_xmpl <- prepare_data(claims_data = claims_data_xmpl,
indices = indices_xmpl,
threshold = 4e5,
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)
# generate claims list
large_claims_list_xmpl <- generate_claims_list(extended_claims_data = extended_claims_data_xmpl,
first_orig_year = 1989,
last_orig_year = 2023)
# generate example exposure with 5% annual exposure increase since 1989
prepare_ibnr(large_claims_list_xmpl,
1989,
2023,
exposure_xmpl,
2014:2023)
#> [[1]]
#> Origin_year Dev_year_of_growing_large Dev_year_since_large
#> 1 2023 2 0
#> 2 2023 2 0
#> 3 2023 2 0
#> 4 2023 2 0
#> 5 2023 2 0
#> 6 2023 3 -1
#> 7 2023 3 -1
#> 8 2023 4 -2
#> 9 2023 6 -4
#> 10 2023 7 -5
#> 11 2023 10 -8
#> 12 2023 27 -25
#> 13 2022 3 0
#> 14 2022 3 0
#> 15 2022 4 -1
#> 16 2022 6 -3
#> 17 2022 7 -4
#> 18 2022 12 -9
#> 19 2022 27 -24
#> 20 2021 4 0
#> 21 2021 5 -1
#> 22 2021 7 -3
#> 23 2021 10 -6
#> 24 2021 22 -18
#> 25 2020 5 0
#> 26 2020 7 -2
#> 27 2020 10 -5
#> 28 2020 22 -17
#> 29 2019 6 0
#> 30 2019 8 -2
#> 31 2019 16 -10
#> 32 2018 8 -1
#> 33 2018 15 -8
#> 34 2017 9 -1
#> 35 2017 22 -14
#> 36 2016 12 -3
#> 37 2015 15 -5
#> 38 2014 21 -10
#> 39 2013 21 -9
#> 40 2012 22 -9
#> 41 2011 22 -8
#> 42 2010 22 -7
#> 43 2009 27 -11
#>
#> [[2]]
#> [[2]][[1]]
#> [1] 618 619 625 630 641 646 647 648 651 653 658 660 661 664 670 675 683 690 692
#> [20] 697 702 706 708 709 712 718 722 727 739 740 742 744 753 755 756 763 764 765
#> [39] 778 779 781 784
#>
#> [[2]][[2]]
#> [1] 592 604 634 668 681 717 719 730 734 743 750 758 769 772 773
#>
#> [[2]][[3]]
#> [1] 566 594 613 638 699 700 752 754 768
#>
#> [[2]][[4]]
#> [1] 572 612 632 639 687
#>
#> [[2]][[5]]
#> [1] 521 553 561 584 611 616 620 635
#>
#> [[2]][[6]]
#> [1] 527 552 576 621
#>
#> [[2]][[7]]
#> [1] 472 493 680
#>
#> [[2]][[8]]
#> [1] 530 591
#>
#> [[2]][[9]]
#> [1] 458 544
#>
#> [[2]][[10]]
#> integer(0)
#>
#> [[2]][[11]]
#> [1] 391 491
#>
#> [[2]][[12]]
#> integer(0)
#>
#> [[2]][[13]]
#> integer(0)
#>
#> [[2]][[14]]
#> [1] 480
#>
#> [[2]][[15]]
#> [1] 373
#>
#> [[2]][[16]]
#> integer(0)
#>
#> [[2]][[17]]
#> integer(0)
#>
#> [[2]][[18]]
#> integer(0)
#>
#> [[2]][[19]]
#> integer(0)
#>
#> [[2]][[20]]
#> [1] 135
#>
#> [[2]][[21]]
#> [1] 231 245
#>
#> [[2]][[22]]
#> integer(0)
#>
#> [[2]][[23]]
#> integer(0)
#>
#> [[2]][[24]]
#> integer(0)
#>
#> [[2]][[25]]
#> integer(0)
#>
#> [[2]][[26]]
#> [1] 41
#>
#> [[2]][[27]]
#> integer(0)
#>
#> [[2]][[28]]
#> integer(0)
#>
#> [[2]][[29]]
#> integer(0)
#>
#> [[2]][[30]]
#> integer(0)
#>
#> [[2]][[31]]
#> integer(0)
#>
#> [[2]][[32]]
#> integer(0)
#>
#> [[2]][[33]]
#> integer(0)
#>
#> [[2]][[34]]
#> integer(0)
#>
#>