Creating series of simulation results
sicr_series.RdThis function executes sicr n times and returns a result series of each realisation for the desired columns.
Usage
sicr_series(
n,
columns = c("Claim_payments"),
drop_ibnr_claims = TRUE,
large_claims_list,
first_orig_year,
last_orig_year,
pools,
indices,
history,
exposure = NULL,
years_for_ibnr_pools = NULL,
active_annuities = NULL,
age_shift = NULL,
mortality = NULL,
reinsurance = NULL,
seed = 12345,
progress = TRUE
)Arguments
- n
Integer. Desired number of realisations.
- columns
Character vector containing the names of the desired information. Valid names are the names of the matrices in the output of
sicr(), see Value. Default: c("Claim_payments")- drop_ibnr_claims
TRUE if only known claims shall appear in the output. Default: TRUE
- large_claims_list
Dataframe with one row per known large claim generated by
generate_claims_list().- first_orig_year
First origin year with complete history.
- last_orig_year
Last origin year.
- pools
List as output of
generate_pools().- indices
Dataframe for indexation, see details of
prepare_data().- history
numeric matrix with one row per claim with historic payments, generated by
generate_history_per_claim().
If generated in other ways, note that colnames must be the origin years.
This matrix is needed to calculate ibnr payments and reinsurance if desired.- exposure
Dataframe that must contain one row for each origin year between
first_orig_yearandlast_orig_yearand the columnsOrigin_yearandExposure.
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.- active_annuities
Dataframe of active annuities, see active_annuities_xmpl. Default: NULL.
Only necessary if annuities shall be considered.- age_shift
Dataframe, see description of age_shift_xmpl. Default: NULL
Only necessary if annuities shall be considered.- mortality
Dataframe, see description of mortality_xmpl. Default: NULL
Only necessary if annuities shall be considered.- reinsurance
Dataframe with reinsurance information, see details of
xl_cashflow()or reinsurance_xmpl. Default: NULL
Only necessary if reinsurance shall be considered.- seed
Default: 12345. Setting a seed makes the simulation reproducible.
- progress
Default: TRUE. Set to FALSE if no progress bar shall be shown during simulation.
Value
Numeric three-dimensional array with
one row per known claim followed by one row per expected ibnr claim if desired
250 columns for future calendar years
one matrix for each of the n desired realisations The entries contain the sum of the desired information stated in
columns.
Examples
# this example uses data provided with this package
extended_claims_data <- 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)
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 = pool_of_annuities_xmpl)
large_claims_list <- generate_claims_list(extended_claims_data = extended_claims_data,
first_orig_year = 1989,
last_orig_year = 2023)
history <- generate_history_per_claim(data = extended_claims_data,
column = "Cl_payment_cal",
first_orig_year = 1989,
last_orig_year = 2023)
series <- sicr_series(n = 3,
large_claims_list = large_claims_list,
first_orig_year = 1989,
last_orig_year = 2023,
pools = pools,
indices = indices_xmpl,
history = history)
#>
1 of 3 (33.33333%) --- remaining time approx. Inf secs
2 of 3 (66.66667%) --- remaining time approx. 0,28 secs
3 of 3 (100%) --- remaining time approx. 0,17 secs