View source: R/features_07_claim_payment_time.R
claim_payment_delay  R Documentation 
Simulates and returns the interpartial delays (i.e. the delay of one partial payment relative to the previous) of each payment for each of the claims occurring in each of the periods.
claim_payment_delay(
frequency_vector,
claim_size_list,
no_payments_list,
settlement_list,
rfun,
paramfun,
...
)
frequency_vector 
a vector of claim frequencies for all the periods. 
claim_size_list 
list of claim sizes. 
no_payments_list 
list of number of partial payments. 
settlement_list 
list of settlement delays. 
rfun 
optional alternative random sampling function; see Details for default. 
paramfun 
parameters for the random sampling function, as a function of

... 
other arguments/parameters to be passed onto 
Returns a compound list structure such that the j
th component
of the i
th sublist gives the payment delay pattern (as a vector) for
the j
th claim of occurrence period i
.
The default rfun
is split into 2 cases.
Case 1: claims with at least 4 partial payments. The simulation takes
2 steps.
First we sample the last payment delay from a Weibull distribution with
mean = 1 quarter (automatically converted to the relevant time_unit
, a
global variable that the user is required to define at the top of their code)
and CoV = 20%. Then we sample the remaining payment delays from a second
Weibull distribution with CoV at 35% and mean = target mean settlement delay
(see claim_closure
) divided by the number of payments.
Case 2: claims with less than 4 partial payments. Proceed as in Case 1 but without separating out the simulation of the last payment delay (i.e. ignore step 1).
# set up
n_vector < claim_frequency(I = 10)
claim_sizes < claim_size(n_vector)
no_payments < claim_payment_no(n_vector, claim_sizes)
setldel < claim_closure(n_vector, claim_sizes)
# with default setting
pmtdel < claim_payment_delay(n_vector, claim_sizes, no_payments, setldel)
pmtdel[[1]][[1]] # payment delays for claim 1 of occurrence period 1
# with some custom rfun
# simplistic case: payments times are uniformly distributed
my_func < function(n, setldel) {
prop < runif(n)
prop < prop / sum(prop)
setldel * prop
}
mypayments < claim_payment_delay(n_vector, claim_sizes, no_payments, setldel,
rfun = my_func)
# interpartial delays for claim 1 of occurrence period 1
mypayments[[1]][[1]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.