MyNixOS website logo
Description

Reinsurance Treaties Application.

Application of reinsurance treaties to claims portfolios. The package creates a class Claims whose objective is to store claims and premiums, on which different treaties can be applied. A statistical analysis can then be applied to measure the impact of reinsurance, producing a table or graphical output. This package can be used for estimating the impact of reinsurance on several portfolios or for pricing treaties through statistical analysis. Documentation for the implemented methods can be found in "Reinsurance: Actuarial and Statistical Aspects" by Hansjöerg Albrecher, Jan Beirlant, Jozef L. Teugels (2017, ISBN: 978-0-470-77268-3) and "REINSURANCE: A Basic Guide to Facultative and Treaty Reinsurance" by Munich Re (2010) <https://www.munichre.com/site/mram/get/documents_E96160999/mram/assetpool.mr_america/PDFs/3_Publications/reinsurance_basic_guide.pdf>.

reinsureR

Implementation of a framework for application of reinsurance treaties on claims datasets, along with statistical and graphical analysis for cost estimation. This package can be used for estimating the impact of reinsurance on several portfolios or for pricing treaties through statistical analysis.

Getting started

Prerequisites

reinsureR can be installed from github.

The package depends on the followings:

  • data.table
  • dplyr
  • ggplot2
  • viridis and viridisLite

Installation

The package is available from its GitHub repository.

devtools::install_github("arnaudbu/reinsureR", dependencies = TRUE)

Claims class

This document aims at providing new users with an overview of the functionality brought by the package. For this purpose, a simple example will be developped in order to review all the implemented functions.

The package mainly relies on the Claims class, whose purpose is to represent the claims and premiums on which reinsurance will be applied. All computations are executed within objects of this class.

This package is implemented from the perspective of the ceding company. Thus, will be computed claims and premiums kept by the company, and not the amounts paid to the reinsurer or received from it.

Claims

For the purpose of illustrating the application of reinsurance treaties to a claim dataset, let us create such a dataset.

The objective is to create several claim events per year for a couple of years and two different portfolios.

# Claim table construction
set.seed(1) # For reproducibility
c <- expand.grid(year = unlist(sapply(2000:2017, function(x) rep(x, rpois(1,8)))),
                 portfolio = c("ptf1", "ptf2"),
                 simulId = 1:100)
c$amount <- pmax(rnorm(nrow(c), 200000, 100000), 0)
c[sample(1:nrow(c), 5), ]

Five randomly picked rows from the table thus created are:

year portfolio simulId   amount
2003      ptf1      49 317274.3
2014      ptf2      56 143056.1
2017      ptf2      99 250803.6
2000      ptf2      86 431303.8
2001      ptf1      69 250328.3

Three dimensions are used in order to group claims:

  • year: the occurence year of the event associated to the claim amount. A year can contain more than one claim: it corresponds to the numerous events the treaty may be applied to (in the case of an Excess of Loss treaty).
  • portfolio: a segmentation with different portfolios is possible, in order to apply reinsurance treaties on subsets of claims.
  • simulId: a simulation identifier. It is possible to use stochastic modelling in order to simulate claims and test the application of reinsurance over different scenarios.

Note that the there may be several lines associated with a triplet (year, portfolio, simulId), corresponding to different events occuring within a year for a portfolio and a scenario.

Premiums

A table containing the insurance premiums for each year and portfolio is also needed in order to construct an object of class Claims. Note that stochastic aspects are not taken into account for premiums. Except for the column simulId, column names are the same as in the table containing the claims. A unique premium amount should be associated to each year and portfolio.

# Premium table construction
p <- aggregate(amount ~ year + portfolio + simulId, c, sum)
p <- aggregate(amount ~ year + portfolio, p, mean)
p$amount[p$portfolio == "ptf1"] <- mean(p$amount[p$portfolio == "ptf1"])
p$amount[p$portfolio == "ptf2"] <- mean(p$amount[p$portfolio == "ptf2"])

For the purpose of the example, we construct the premium table by averaging the yearly claims over the portfolios, without taking into account fee issues.

Construction

An object of class Claims is constructed by calling the function claims on the two previously generated tables:

claims <- claims(c, p)

The slots of an object of this class are:

  • clm: the claim table given as an input for the constructor;
  • prm: the premium table, also given as an input for the constructor;
  • rns: reinstatements premiums paid to the reinsurer on Excess of Loss treaties;
  • com: commissions received from the reinsurer for Quota Share treaties;
  • trt: list of treaties applied.

All those values can be retrieved from their dedicated getters:

cl <- get_claims(claims)
pm <- get_premiums(claims)
cm <- get_commissions(claims)
rn <- get_reinstatements(claims)
tt <- get_treaties(claims)

Treaties classes

Three types of treaties are available within the package:

  • Quota Share treaties;
  • Excess of Loss treaties;
  • Stop Loss treaties.

They can all be applied to an object of class Claims with the function apply_treaty:

claims <- apply_treaty(claims, treaty)

In the examples, treaties are priced such that no gain can be made from reinsurance, which can be verified after the application of each treaty by the code mean(summy(claims)$rns_gain), explained later.

Reinsurance treaties are applied on the amounts considered after application of all previous treaties.

In this example, a quota share treaty will first be applied on the first portfolio, then an excess of loss treaty will be applied on the second, before applying a stop loss treaty on both portfolios.

Quota Share

Quota Share treaties are constructed from their constructor qs.

treaty_qs <- qs(csn_clm = 0.8,
               com = 0,
               ptf = "ptf1")

claims <- apply_treaty(claims, treaty_qs)

Excess Of Loss

Quota Share treaties are constructed from their constructor xl.

treaty_xl <- xl(ded = 200000,
                lim = 30000,
                aad = 0,
                aal = Inf,
                prm = rate_prm,
                rns = c(0,0),
                ptf = "ptf2")

claims <- apply_treaty(claims, treaty_xl)

Stop Loss

Stop Loss treaties are constructed from their constructor sl.

pp <- aggregate(amount ~ year + simulId + portfolio, c, sum)
pp$amount[pp$portfolio == "ptf1"] <- pp$amount[pp$portfolio == "ptf1"] * 0.2
pp <- aggregate(amount ~ year + simulId, pp, sum)
r$amount_treaty[r$portfolio == "ptf1"] <- 0
r <- aggregate(amount_treaty ~ year + simulId, r, sum)
t <- summy(claims)
rate_prm = mean(pmin(pmax(pp$amount - r$amount_treaty - 3000000, 0), 500000)) / mean(t$amount_after_treaty_2.prm)

treaty_sl <- sl(ded = 3000000,
                lim = 500000,
                prm = rate_prm,
                ptf = "all")

claims <- apply_treaty(claims, treaty_sl)

Visualization

Summarizing

A summary of the effect of reinsurance on all portfolios can be obtain via the summy function:

summy(claims, "mean")

The function takes two arguments:

  • claims: the claim object;
  • op: the operation to be performed for the summary, such as "mean", "sd", "median", "min", "max".

The column rns_gain computes the gain from reinsurance for the ceding company, taking into account the difference in claims and premiums, with commissions and reinstatements.

Plotting

It is also possible to get a graphical representation of the reinsurance effect on all portfolios with the function draw:

draw(x, value = "all", moment = "gain", output = "boxplot")

The plotting parameters are:

  • value: the value to take into account (claims, premiums, everything, ...);
  • moment: the moment of ploting (before or after reinsurance, gain from reinsurance);
  • output: the type of graph to produce (boxplot or histogram).

Authors

Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows