Learn R Programming

reinsureR (version 0.1.0)

claims: Claims: User constructor function

Description

claims defines an object of class Claims (Claims-class).

Usage

claims(claims, premiums)

Arguments

claims

Data.frame. Claims table. Contains at least 2 columns, and may contain 2 optional columns:

  • year: year associated with the considered claim;

  • portfolio: Optional. Portfolio associated with the considered claim;

  • simulId: Optional. Simulation id of the considered claim. Useful for stochastic modelling;

  • amount: amount of the considered claim.

premiums

Data.frame. Premiums table. Contains at least 2 columns, and may contain 1 optional column:

  • year: year associated with the considered premium;

  • portfolio: Optional. Portfolio associated with the considered premium;

  • amount: amount of the considered premium.

Value

An object of class Claims (Claims-class), initialized with the values given in input. Its basic methods are:

  • show

  • draw(draw): plotting function;

  • summy(summy): plotting function;

  • get_claims(get_claims): extract claim table from Claims object;

  • get_premiums(get_premiums): extract premium table from Claims object;

  • get_commissions(get_commissions): extract commissions table from Claims object;

  • get_reinstatements(get_reinstatements): extract reinstatements table from Claims object;

  • get_treaties(get_treaties): extract applied treaties list from Claims object.

Details

If portfolio or simulId are not given in the input tables, the default value is set to 0 in the Claims object.

Consistency needs to be insured between claims and premiums. For every year where a claim is entered, a premium must be registered. The same goes for the portfolios.

Portfolios differenciation is used to apply reinsurance treaties to different part of claims.

Simulation Ids are used in the case of stochastic simulations, in order to apply reinsurance treaties over simulated claims. Simulations Id are not used for premiums, which are mapped through year and portfolio. Be careful to have a unique premium for each couple year/portfolio.

For a unique combination of year, portfolio and simulId can be associated multiple events that will be taken into account when applying Excess of Loss reinsurance.

Examples

Run this code
# NOT RUN {
c <- data.frame(year = unlist(sapply(2000:2017, function(x) rep(x, rpois(1,3)))))
c$amount <- pmax(rnorm(nrow(c), 200000, 100000), 0)

p <- aggregate(amount ~ year, c, sum)

claims <- claims(c, p)

# }

Run the code above in your browser using DataLab