claim_frequency: Claim Frequency

View source: R/features_01_claim_occurrence.R

claim_frequencyR Documentation

Claim Frequency


Returns the number of insurance claims occurring in each of the periods.


  I = 40,
  E = 12000,
  freq = 0.03,
  type = c("r", "p"),



number of claims development periods considered.


effective annual exposure associated with each period (vector).


expected frequency per unit exposure for each period (vector).


optional alternative sampling distribution; see Details.


the type of simfun provided. The default is a random generation function (e.g. rpois); the alternative "p" is any valid cumulative distribution function (e.g. ppois).


other arguments/parameters to be passed onto simfun.


Unless otherwise specified, claim_frequency() assumes the claim frequency follows a Poisson distribution with mean equal to the product of exposure E associated with period i and expected claim frequency freq per unit exposure for that period.

If no arguments are provided, by default claim_frequency() assumes a total of 40 development periods, constant exposure rate at 12000 per year and constant frequency at 0.03 per unit of exposure.

If one wishes to use an alternative sampling distribution for claim frequency, they could declare such specification through the simfun argument. The simfun argument takes both random generation functions (type = "r", the default) and cumulative distribution functions (type = "p"). For the latter, claim_frequency() will first search for the existence of the corresponding r-function. If it notes the existence of such an r-function (e.g. rpois for simfun = ppois), it will directly apply the r-function to optimise simulation efficiency. Otherwise, the function uses a numerical inverse transform method for simulation (see simulate_cdf), which may not be the most efficient and can potentially result in errors if an appropriate range is not specified in the optional arguments.

Pre-defined distribution functions such as ppois are supported.


no_period <- 40
exposure <- c(rep(12000, no_period))
exp_freq <- c(rep(0.03, no_period))
# returns the same result as claim_frequency()
claim_frequency(I = no_period, E = exposure, freq = exp_freq)

# use a pre-defined random generation function
claim_frequency(I = 10, simfun = rpois, lambda = 80)
# or equivalently, through a distribution function
claim_frequency(I = 10, simfun = ppois, type = "p", lambda = 80)

SynthETIC documentation built on Sept. 3, 2023, 5:06 p.m.