Title: | Reinsurance Treaties Application |
---|---|
Description: | 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>. |
Authors: | Arnaud Buzzi |
Maintainer: | Arnaud Buzzi <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.0 |
Built: | 2024-11-22 06:50:11 UTC |
Source: | CRAN |
apply_treaty
applies a treaty on an object of type Claims
(Claims-class
).
apply_treaty(claims, treaty)
apply_treaty(claims, treaty)
claims |
|
treaty |
The updated Claims
object
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) treaty_1 <- xl(ded = 100000, lim = 20000, aad = 5000, aal = 200000, prm = 0.01, rns = 1) claims <- apply_treaty(claims, treaty_1)
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) treaty_1 <- xl(ded = 100000, lim = 20000, aad = 5000, aal = 200000, prm = 0.01, rns = 1) claims <- apply_treaty(claims, treaty_1)
claims
defines an object of class Claims
(Claims-class
).
claims(claims, premiums)
claims(claims, premiums)
claims |
Data.frame. Claims table. Contains at least 2 columns, and may contain 2 optional columns:
|
premiums |
Data.frame. Premiums table. Contains at least 2 columns, and may contain 1 optional column:
|
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.
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.
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)
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)
An S4 class to represent Claims and Premiums for reinsurance computations.
## S4 method for signature 'Claims' show(object)
## S4 method for signature 'Claims' show(object)
object |
The object to display |
show
: show method
clm
Data.table. Claims table. Contains at least 4 columns:
year
: year associated with the considered claim;
portfolio
: portfolio associated with the considered claim;
simulId
: simulation id of the considered claim. Useful for stochastic modelling;
amount
: amount of the considered claim.
prm
Data.table. Premiums table. Contains at least 3 columns:
year
: year associated with the considered premium;
portfolio
: portfolio associated with the considered premium;
amount
: amount of the considered premium.
rns
Data.table. Reinstatement amount table, that only concerns excess of loss treaties. Contains at least 2 columns:
year
: year associated with the considered reinstatements;
simulId
: simulation id of the considered reinstatement amount. Useful for stochastic modelling.
com
Data.table. Commissions amount table, that only concerns quota share treaties. Contains at least 2 columns:
year
: year associated with the considered commission amount;
portfolio
: portfolio associated with the considered commission.
trt
Vector. List of treaties applied to the Claims object.
draw
produces a graphical representation of an object Claims
(Claims-class
).
draw(x, value = "all", moment = "gain", output = "boxplot") ## S4 method for signature 'Claims' draw(x, value = "all", moment = "gain", output = "boxplot")
draw(x, value = "all", moment = "gain", output = "boxplot") ## S4 method for signature 'Claims' draw(x, value = "all", moment = "gain", output = "boxplot")
x |
The Claims object to represent. |
value |
Character. The value to consider plot, among:
|
moment |
Character. Moment for analysis:
|
output |
Character. Type of graph to produce:
|
For boxplots, a red dot represent the mean value for each year.
a plot
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) treaty_1 <- xl(ded = 100000, lim = 20000, aad = 5000, aal = 200000, prm = 0.01, rns = 1) claims <- apply_treaty(claims, treaty_1) draw(claims)
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) treaty_1 <- xl(ded = 100000, lim = 20000, aad = 5000, aal = 200000, prm = 0.01, rns = 1) claims <- apply_treaty(claims, treaty_1) draw(claims)
get_claims
gets the claims table of a Claims
(Claims-class
) object.
get_claims(object) ## S4 method for signature 'Claims' get_claims(object)
get_claims(object) ## S4 method for signature 'Claims' get_claims(object)
object |
The object to display |
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) get_claims(claims)
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) get_claims(claims)
get_commissions
gets the commissions induced by QS treaties applied to Claims
(Claims-class
) object.
get_commissions(object) ## S4 method for signature 'Claims' get_commissions(object)
get_commissions(object) ## S4 method for signature 'Claims' get_commissions(object)
object |
The object to display |
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) treaty_1 <- qs(0.8, com = 0.25) claims <- apply_treaty(claims, treaty_1) get_commissions(claims)
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) treaty_1 <- qs(0.8, com = 0.25) claims <- apply_treaty(claims, treaty_1) get_commissions(claims)
get_reinstatements
gets the reinstatements induced by XL treaties applied to Claims
(Claims-class
) object.
get_reinstatements(object) ## S4 method for signature 'Claims' get_reinstatements(object)
get_reinstatements(object) ## S4 method for signature 'Claims' get_reinstatements(object)
object |
The object to display |
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) treaty_1 <- xl(ded = 100000, lim = 20000, aad = 5000, aal = 200000, prm = 0.01, rns = 1) claims <- apply_treaty(claims, treaty_1) get_reinstatements(claims)
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) treaty_1 <- xl(ded = 100000, lim = 20000, aad = 5000, aal = 200000, prm = 0.01, rns = 1) claims <- apply_treaty(claims, treaty_1) get_reinstatements(claims)
get_treaties
gets the characteristics of treaties applied to Claims
(Claims-class
) object.
get_treaties(object) ## S4 method for signature 'Claims' get_treaties(object)
get_treaties(object) ## S4 method for signature 'Claims' get_treaties(object)
object |
The object to display |
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) treaty_1 <- qs(0.8, com = 0.25) claims <- apply_treaty(claims, treaty_1) get_treaties(claims)
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) treaty_1 <- qs(0.8, com = 0.25) claims <- apply_treaty(claims, treaty_1) get_treaties(claims)
qs
defines an object of class QS
(QS-class
).
qs(csn_clm, csn_prm = "auto", com = 0, ptf = "all")
qs(csn_clm, csn_prm = "auto", com = 0, ptf = "all")
csn_clm |
Numeric. Cession rate on claims. Should be between 0 and 1. |
csn_prm |
Numeric. Cession rate on premiums. Should be between 0 and 1. Default value set to |
com |
Numeric. Commission rate, applied on the part of premiums given to the reinsurer. Should be between 0 and 1. Default value set to 0. |
ptf |
Vector. List of portfolios on which the treaty is to be applied on. Default value set to all. |
An object of class QS
(QS-class
), initialized with the values given in input. Its basic methods are:
show
treaty_1 <- qs(0.8, com = 0.25) treaty_1
treaty_1 <- qs(0.8, com = 0.25) treaty_1
An S4 class to represent a Quota Share Treaty
## S4 method for signature 'QS' show(object)
## S4 method for signature 'QS' show(object)
object |
the object to display |
show
: Quota Share Treaty: show method
csn_clm
Numeric. Cession rate on claims. Should be between 0 and 1.
csn_prm
Numeric. Cession rate on premiums. Should be between 0 and 1.
com
Numeric. Commission rate, applied on the part of premiums given to the reinsurer. Should be between 0 and 1.
ptf
Vector. List of portfolios on which the treaty is to be applied on.
trt
Character. Always equal to "QS". Identifier for the type of treaty.
sl
defines an object of class SL
(SL-class
), which represents a Stop Loss treaty.
sl(ded = Inf, lim = Inf, prm = 0, ptf = "all")
sl(ded = Inf, lim = Inf, prm = 0, ptf = "all")
ded |
Numeric. Deductible amount of the treaty. Should be superior to 0. |
lim |
Numeric. Limit amount for the treaty. Should be superior to 0. May be equal to |
prm |
Numeric. Premium rate, which represents the proportion of the premium given to the reinsurer as price for the treaty. Should be between 0 and 1. |
ptf |
Vector. List of portfolios on which the treaty is to be applied on. Default value set to all. |
An object of class SL
(SL-class
), initialized with the values given in input. Its basic methods are:
show
treaty_1 <- sl(ded = 100000, lim = 20000, prm = 0.01, ptf = "all") treaty_1
treaty_1 <- sl(ded = 100000, lim = 20000, prm = 0.01, ptf = "all") treaty_1
An S4 class to represent a Stop Loss Treaty
## S4 method for signature 'SL' show(object)
## S4 method for signature 'SL' show(object)
object |
the object to display |
show
: Stop Loss Treaty: show method
ded
Numeric. Deductible amount of the treaty. Should be superior to 0.
lim
Numeric. Limit amount for the treaty. Should be superior to 0. May be equal to Inf
.
prm
Numeric. Premium rate, which represents the proportion of the premium given to the reinsurer as price for the treaty. Should be between 0 and 1.
ptf
Vector. List of portfolios on which the treaty is to be applied on.
trt
Character. Always equal to "SL". Identifier for the type of treaty
summy
summarizes the data contained in the object Claims
(Claims-class
).
summy(object, op = "mean") ## S4 method for signature 'Claims' summy(object, op = "mean")
summy(object, op = "mean") ## S4 method for signature 'Claims' summy(object, op = "mean")
object |
The Claims object to represent. |
op |
Character. The aggregation operation over the simulIds, among:
|
The summarized data
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) treaty_1 <- xl(ded = 100000, lim = 20000, aad = 5000, aal = 200000, prm = 0.01, rns = 1) claims <- apply_treaty(claims, treaty_1) summy(claims)
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) treaty_1 <- xl(ded = 100000, lim = 20000, aad = 5000, aal = 200000, prm = 0.01, rns = 1) claims <- apply_treaty(claims, treaty_1) summy(claims)
xl
defines an object of class XL
(XL-class
), which represents an Excess of Loss treaty.
xl(ded = Inf, lim = Inf, aal = Inf, aad = Inf, prm = 0, rns = "none", ptf = "all")
xl(ded = Inf, lim = Inf, aal = Inf, aad = Inf, prm = 0, rns = "none", ptf = "all")
ded |
Numeric. Deductible amount of the treaty. Should be superior to 0. |
lim |
Numeric. Limit amount for the treaty. Should be superior to 0. May be equal to |
aal |
Numeric. Annual Aggregate Deductible amount of the treaty. Should be superior to 0. |
aad |
Numeric. Annual Aggregate Limit amount for the treaty. Should be superior to 0. May be equal to |
prm |
Numeric. Premium rate, which represents the proportion of the premium given to the reinsurer as price for the treaty. Should be between 0 and 1. |
rns |
Numeric vector. Reinstatement prices. Vector of lentgh equals to the number of reinstatements with each value equals the price of the reinstatement. |
ptf |
Vector. List of portfolios on which the treaty is to be applied on. Default value set to all. |
Reinstatements are the number of time the limit can be reconstructed. The vector given for this parameter will be an indication of the price for each reinstatement. For example, a rns
value of c(0, 1)
will give one free reinstatement and one reinstatement paid 100% of the premium before totally consuming the limit.
An object of class XL
(XL-class
), initialized with the values given in input. Its basic methods are:
show
treaty_1 <- xl(ded = 200000, lim = 20000, aad = 0, aal = 10000, prm = 0.01, rns = c(0, 1)) treaty_1
treaty_1 <- xl(ded = 200000, lim = 20000, aad = 0, aal = 10000, prm = 0.01, rns = c(0, 1)) treaty_1
An S4 class to represent an Excess of Loss Treaty
## S4 method for signature 'XL' show(object)
## S4 method for signature 'XL' show(object)
object |
the object to display |
show
: Excess of Loss Treaty: show method
ded
Numeric. Deductible amount of the treaty. Should be superior to 0.
lim
Numeric. Limit amount for the treaty. Should be superior to 0. May be equal to Inf
.
aal
Numeric. Annual Aggregate Deductible amount of the treaty. Should be superior to 0.
aad
Numeric. Annual Aggregate Limit amount for the treaty. Should be superior to 0. May be equal to Inf
.
rns
Numeric vector. Reinstatement prices. Vector of lentgh equals to the number of reinstatements with each value equals the price of the reinstatement.
prm
Numeric. Premium rate, which represents the proportion of the premium given to the reinsurer as price for the treaty. Should be between 0 and 1.
ptf
Vector. List of portfolios on which the treaty is to be applied on.
trt
Character. Always equal to "SL". Identifier for the type of treaty