Title: | Actuarial Functions for Non-Life Insurance Modelling |
---|---|
Description: | Assists actuaries and other insurance modellers in pricing, reserving and capital modelling for non-life insurance and reinsurance modelling. Provides functions that help model excess levels, capping and pure Incurred but not reported claims (pure IBNR). Includes capped mean, exposure curves and increased limit factor curves (ILFs) for LogNormal, Gamma, Pareto, Sliced LogNormal-Pareto and Sliced Gamma-Pareto distributions. Includes mean, probability density function (pdf), cumulative probability function (cdf) and inverse cumulative probability function for Sliced LogNormal-Pareto and Sliced Gamma-Pareto distributions. Includes calculating pure IBNR exposure with LogNormal and Gamma distribution for reporting delay. Includes three shiny tools, one to simulate insurance claims applying reinsurance structures, fit generalised linear models and fit claims frequency or severity distributions. Methods used in the package refer to Free for All by Yiannis Parizas (2023) <https://www.theactuary.com/2023/03/02/free-all>; Escaping the triangle by Yiannis Parizas (2019) <https://www.theactuary.com/features/2019/06/2019/06/05/escaping-triangle>; Take to excess by Yiannis Parizas (2019) <https://www.theactuary.com/features/2019/03/2019/03/06/taken-excess>. |
Authors: | Yiannis Parizas [aut, cre] |
Maintainer: | Yiannis Parizas <[email protected]> |
License: | GPL-3 |
Version: | 0.1.5 |
Built: | 2025-01-31 04:25:09 UTC |
Source: | https://github.com/cran/NetSimR |
Apply a deductible and limit to claims
apply_deductible_limit( gross_claims_data, reinsurance_structure, deductible, limit )
apply_deductible_limit( gross_claims_data, reinsurance_structure, deductible, limit )
gross_claims_data |
A vector of Claims. |
reinsurance_structure |
The chosen reinsurance structure. Options are: 'No Reinsurance Structure', 'Unlimited Layer', 'Limited Layer', 'Exclude Layer'. |
deductible |
The deductible of the reinsurance structure. |
limit |
The limit of the reinsurance structure. |
The ceded claims for the structure, with the chosen deductible and limit.
apply_deductible_limit(c(100, 50, 20), 'Limited Layer', 40, 20) apply_deductible_limit(c(100, 50, 20), 'Limited Layer', 10, 30)
apply_deductible_limit(c(100, 50, 20), 'Limited Layer', 40, 20) apply_deductible_limit(c(100, 50, 20), 'Limited Layer', 10, 30)
Apply severity cap function
apply_severity_cap(claims, severity_cap_boolean, severity_cap_amount)
apply_severity_cap(claims, severity_cap_boolean, severity_cap_amount)
claims |
A vector of Claims. |
severity_cap_boolean |
A variable that if true, the function will cap the claims, otherwise will just return them. |
severity_cap_amount |
The claim cap value. |
If severity_cap_boolean
is true, then will return the minimum of severity_cap_amount
or claims
otherwise will return claims
. The operation is vectorised.
Server function for the Distribution Fitting tool application
distribution_fitting_tool_Server(input, output, session)
distribution_fitting_tool_Server(input, output, session)
input |
Input for the server function. |
output |
Output for the server function. |
session |
Session for the server function. |
Returns server rendering for the shiny application.
UI file for the Shiny glm fitting tool
distribution_fitting_tool_UI
distribution_fitting_tool_UI
An object of class shiny.tag.list
(inherits from list
) of length 4.
Returns the UI code for the shiny application.
The probability density function (pdf) of a Sliced Gamma Pareto severity distribution
dSlicedGammaPareto(x, GShape, GRate, SlicePoint, PShape)
dSlicedGammaPareto(x, GShape, GRate, SlicePoint, PShape)
x |
A positive real number - the claim amount where the probability density function (pdf) will be evaluated. |
GShape |
A positive real number - the shape parameter of the attritional Claim Severity's Gamma distribution. |
GRate |
A positive real number - the rate parameter of the attritional Claim Severity's Gamma distribution. |
SlicePoint |
A positive real number - the slice point and the scale parameter of the tail Claim Severity's Pareto distribution. |
PShape |
A positive real number - the shape parameter of the tail Claim Severity's Pareto distribution. |
The value of the probability density function (pdf) at x
with an attritional claim Gamma distribution with parameters GShape
and GRate
and a large claim Pareto distribution with parameters SlicePoint
and PShape
.
dSlicedGammaPareto(3000,1,0.0005,1000,1.2) dSlicedGammaPareto(1000,1.1,0.0006,2000,1.6) dSlicedGammaPareto(2000,1.2,0.0004,3000,1.4)
dSlicedGammaPareto(3000,1,0.0005,1000,1.2) dSlicedGammaPareto(1000,1.1,0.0006,2000,1.6) dSlicedGammaPareto(2000,1.2,0.0004,3000,1.4)
The probability density function (pdf) of a Sliced LogNormal Pareto severity distribution
dSlicedLNormPareto(x, mu, sigma, SlicePoint, shape)
dSlicedLNormPareto(x, mu, sigma, SlicePoint, shape)
x |
A positive real number - the claim amount where the probability density function (pdf) will be evaluated. |
mu |
A real number - the first parameter of the attritional Claim Severity's LogNormal distribution. |
sigma |
A positive real number - the second parameter of the attritional Claim Severity's LogNormal distribution. |
SlicePoint |
A positive real number - the slice point and the scale parameter of the Claim Severity's Pareto distribution. |
shape |
A positive real number - the shape parameter of the Claim Severity's Pareto distribution. |
The value of the probability density function (pdf) at x
with an attritional claim LogNormal distribution with parameters mu
and sigma
and a large claim Pareto distribution with parameters SlicePoint
and shape
.
dSlicedLNormPareto(1200,6,1.5,1000,1.2) dSlicedLNormPareto(4000,7,1.6,3000,1.4)
dSlicedLNormPareto(1200,6,1.5,1000,1.2) dSlicedLNormPareto(4000,7,1.6,3000,1.4)
Error function
erf(x)
erf(x)
x |
A real number. |
The value of the error function at x
.
erf(0.1) erf(0.5)
erf(0.1) erf(0.5)
Exposure Curve from a Gamma severity distribution
ExposureCurveGamma(x, shape, rate)
ExposureCurveGamma(x, shape, rate)
x |
A positive real number - the claim amount where the exposure curve will be evaluated. |
shape |
A positive real number - the shape parameter of the Claim Severity's Gamma distribution. |
rate |
A positive real number - the rate parameter of the Claim Severity's Gamma distribution. |
The value of the Exposure curve at x
with Claim Severity from a Gamma distribution with parameters shape
and rate
.
ExposureCurveGamma(700,1,0.0005) ExposureCurveGamma(1000,1.5,0.0006)
ExposureCurveGamma(700,1,0.0005) ExposureCurveGamma(1000,1.5,0.0006)
Exposure Curve from LogNormal a severity distribution
ExposureCurveLNorm(x, mu, sigma)
ExposureCurveLNorm(x, mu, sigma)
x |
A positive real number - the claim amount where the exposure curve will be evaluated. |
mu |
A real number - the first parameter of the Claim Severity's LogNormal distribution. |
sigma |
A positive real number - the second parameter of the Claim Severity's LogNormal distribution. |
The value of the Exposure curve at x
with Claim Severity from a LogNormal distribution with parameters mu
and sigma
.
ExposureCurveLNorm(2000,6,1.5) ExposureCurveLNorm(1000,5,1.6)
ExposureCurveLNorm(2000,6,1.5) ExposureCurveLNorm(1000,5,1.6)
Exposure Curve from a Pareto severity distribution
ExposureCurvePareto(x, scale, shape)
ExposureCurvePareto(x, scale, shape)
x |
A positive real number - the claim amount where the exposure curve will be evaluated. |
scale |
A positive real number - the scale parameter of the Claim Severity's Pareto distribution. |
shape |
A positive real number - the shape parameter of the Claim Severity's Pareto distribution. |
The value of the Exposure curve at x
with Claim Severity from a Pareto distribution with parameters scale
and shape
.
ExposureCurvePareto(700,500,1.2) ExposureCurvePareto(20000,200,1.1)
ExposureCurvePareto(700,500,1.2) ExposureCurvePareto(20000,200,1.1)
Exposure Curve from a Sliced Gamma Pareto severity distribution
ExposureCurveSlicedGammaPareto(x, GShape, GRate, SlicePoint, PShape)
ExposureCurveSlicedGammaPareto(x, GShape, GRate, SlicePoint, PShape)
x |
A positive real number - the claim amount where the exposure curve will be evaluated. |
GShape |
A positive real number - the shape parameter of the Claim Severity's Gamma distribution. |
GRate |
A positive real number - the rate parameter of the Claim Severity's Gamma distribution. |
SlicePoint |
A positive real number - the slice point and the scale parameter of the Claim Severity's Pareto distribution. |
PShape |
A positive real number - the shape parameter of the Claim Severity's Pareto distribution. |
The value of the Exposure curve at x
with an attritional claim Gamma distribution with parameters GShape
and GRate
and a large claim Pareto distribution with parameters SlicePoint
and PShape
.
ExposureCurveSlicedGammaPareto(3000,1,0.0005,1000,1.2) ExposureCurveSlicedGammaPareto(1000,1.1,0.0006,2000,1.6) ExposureCurveSlicedGammaPareto(2000,1.2,0.0004,3000,1.4)
ExposureCurveSlicedGammaPareto(3000,1,0.0005,1000,1.2) ExposureCurveSlicedGammaPareto(1000,1.1,0.0006,2000,1.6) ExposureCurveSlicedGammaPareto(2000,1.2,0.0004,3000,1.4)
Exposure Curve from a Sliced LogNormal Pareto severity distribution
ExposureCurveSlicedLNormPareto(x, mu, sigma, SlicePoint, shape)
ExposureCurveSlicedLNormPareto(x, mu, sigma, SlicePoint, shape)
x |
A positive real number - the claim amount where the exposure curve will be evaluated. |
mu |
A real number - the first parameter of the attritional Claim Severity's LogNormal distribution. |
sigma |
A positive real number - the second parameter of the attritional Claim Severity's LogNormal distribution. |
SlicePoint |
A positive real number - the slice point and the scale parameter of the tail Claim Severity's Pareto distribution. |
shape |
A positive real number - the shape parameter of the tail Claim Severity's Pareto distribution. |
The value of the Exposure curve at x
with an attritional claim LogNormal distribution with parameters mu
and sigma
and a large claim Pareto distribution with parameters SlicePoint
and shape
.
ExposureCurveSlicedLNormPareto(1200,6,1.5,1000,1.2) ExposureCurveSlicedLNormPareto(4000,7,1.6,3000,1.4)
ExposureCurveSlicedLNormPareto(1200,6,1.5,1000,1.2) ExposureCurveSlicedLNormPareto(4000,7,1.6,3000,1.4)
A vector with the frequency distribution objects
freq_dist_options
freq_dist_options
An object of class list
of length 4.
The frequency distribution objects.
A data frame with the frequency distribution parameter placeholders
freq_dist_parameter_placeholders
freq_dist_parameter_placeholders
An object of class data.frame
with 2 rows and 2 columns.
The frequency distribution parameter placeholders.
Gamma capped mean
GammaCappedMean(cap, shape, rate)
GammaCappedMean(cap, shape, rate)
cap |
A positive real number - the claim severity cap. |
shape |
A positive real number - the shape parameter of the Claim Severity's Gamma distribution. |
rate |
A positive real number - the rate parameter of the Claim Severity's Gamma distribution. |
The mean of the claim severity capped at cap
with a Gamma distribution with parameters shape
and rate
.
GammaCappedMean(700,1,0.0005) GammaCappedMean(1000,1.5,0.0006)
GammaCappedMean(700,1,0.0005) GammaCappedMean(1000,1.5,0.0006)
Server function for the GLM Fitting tool application
GLMFittingToolServer(input, output, session)
GLMFittingToolServer(input, output, session)
input |
Input for the server function. |
output |
Output for the server function. |
session |
Session for the server function. |
Returns server rendering for the shiny application.
UI file for the Shiny glm fitting tool
GLMFittingToolUI
GLMFittingToolUI
An object of class shiny.tag.list
(inherits from list
) of length 4.
Returns the UI code for the shiny application.
Lower incomplete gamma function
IGamma(a, x)
IGamma(a, x)
a |
A positive real number. |
x |
A positive real number. |
The value of the lower incomplete gamma function at x
with shape parameter a
.
IGamma(1,1) IGamma(0.1,2)
IGamma(1,1) IGamma(0.1,2)
Increased Limit Factor Curve from a Gamma severity distribution
ILFGamma(xLow, xHigh, shape, rate)
ILFGamma(xLow, xHigh, shape, rate)
xLow |
A positive real number - the claim amount where the Increased Limit Factor Curve will be evaluated from. |
xHigh |
A positive real number - the claim amount where the Increased Limit Factor Curve will be evaluated to. |
shape |
A positive real number - the shape parameter of the Claim Severity's Gamma distribution. |
rate |
A positive real number - the rate parameter of the Claim Severity's Gamma distribution. |
The value of the Increased Limit Factor curve from xLow
to xHigh
with Claim Severity from a Gamma distribution with parameters shape
and rate
.
ILFGamma(1000,700,1,0.0005) ILFGamma(1200,1000,1.5,0.0006)
ILFGamma(1000,700,1,0.0005) ILFGamma(1200,1000,1.5,0.0006)
Increased Limit Factor Curve from a LogNormal severity distribution
ILFLNorm(xLow, xHigh, mu, sigma)
ILFLNorm(xLow, xHigh, mu, sigma)
xLow |
A positive real number - the claim amount where the Increased Limit Factor Curve will be evaluated from. |
xHigh |
A positive real number - the claim amount where the Increased Limit Factor Curve will be evaluated to. |
mu |
A real number - the first parameter of the Claim Severity's LogNormal distribution. |
sigma |
A positive real number - the second parameter of the Claim Severity's LogNormal distribution. |
The value of the Increased Limit Factor curve from xLow
to xHigh
with Claim Severity from a LogNormal distribution with parameters mu
and sigma
.
ILFLNorm(1000,2000,6,1.5) ILFLNorm(1000,1500,5,1.6)
ILFLNorm(1000,2000,6,1.5) ILFLNorm(1000,1500,5,1.6)
Increased Limit Factor Curve from a Pareto severity distribution
ILFPareto(xLow, xHigh, scale, shape)
ILFPareto(xLow, xHigh, scale, shape)
xLow |
A positive real number - the claim amount where the Increased Limit Factor Curve will be evaluated from. |
xHigh |
A positive real number - the claim amount where the Increased Limit Factor Curve will be evaluated to. |
scale |
A positive real number - the scale parameter of the Claim Severity's Pareto distribution. |
shape |
A positive real number - the shape parameter of the Claim Severity's Pareto distribution. |
The value of the Increased Limit Factor curve from xLow
to xHigh
with Claim Severity from a Pareto distribution with parameters scale
and shape
.
ILFPareto(700,1200,500,1.2) ILFPareto(1200,20000,200,1.1)
ILFPareto(700,1200,500,1.2) ILFPareto(1200,20000,200,1.1)
Increased Limit Factor Curve from a Sliced Gamma Pareto severity distribution
ILFSlicedGammaPareto(xLow, xHigh, GShape, GRate, SlicePoint, PShape)
ILFSlicedGammaPareto(xLow, xHigh, GShape, GRate, SlicePoint, PShape)
xLow |
A positive real number - the claim amount where the Limit Factor Curve will be evaluated from. |
xHigh |
A positive real number - the claim amount where the Limit Factor Curve will be evaluated to. |
GShape |
A positive real number - the shape parameter of the attritional Claim Severity's Gamma distribution. |
GRate |
A positive real number - the rate parameter of the attritional Claim Severity's Gamma distribution. |
SlicePoint |
A positive real number - the slice point and the scale parameter of the tail Claim Severity's Pareto distribution. |
PShape |
A positive real number - the shape parameter of the tail Claim Severity's Pareto distribution. |
The value of the Increased Limit Factor curve from xLow
to xHigh
with an attritional claim Gamma distribution with parameters GShape
and GRate
and a large claim Pareto distribution with parameters SlicePoint
and PShape
.
ILFSlicedGammaPareto(2000,3000,1,0.0005,1000,1.2) ILFSlicedGammaPareto(800,1000,1.1,0.0006,2000,1.6) ILFSlicedGammaPareto(1200,2000,1.2,0.0004,3000,1.4)
ILFSlicedGammaPareto(2000,3000,1,0.0005,1000,1.2) ILFSlicedGammaPareto(800,1000,1.1,0.0006,2000,1.6) ILFSlicedGammaPareto(1200,2000,1.2,0.0004,3000,1.4)
Increased Limit Factor Curve from a Sliced LogNormal Pareto severity distribution
ILFSlicedLNormPareto(xLow, xHigh, mu, sigma, SlicePoint, shape)
ILFSlicedLNormPareto(xLow, xHigh, mu, sigma, SlicePoint, shape)
xLow |
A positive real number - the claim amount where the Limit Factor Curve will be evaluated from. |
xHigh |
A positive real number - the claim amount where the Limit Factor Curve will be evaluated to. |
mu |
A real number - the first parameter of the attritional Claim Severity's LogNormal distribution. |
sigma |
A positive real number - the second parameter of the attritional Claim Severity's LogNormal distribution. |
SlicePoint |
A positive real number - the slice point and the scale parameter of the tail Claim Severity's Pareto distribution. |
shape |
A positive real number - the shape parameter of the tail Claim Severity's Pareto distribution. |
The value of the Increased Limit Factor curve from xLow
to xHigh
with an attritional claim LogNormal distribution with parameters mu
and sigma
and a large claim Pareto distribution with parameters SlicePoint
and shape
.
ILFSlicedLNormPareto(800,1200,6,1.5,1000,1.2) ILFSlicedLNormPareto(2000,4000,7,1.6,3000,1.4)
ILFSlicedLNormPareto(800,1200,6,1.5,1000,1.2) ILFSlicedLNormPareto(2000,4000,7,1.6,3000,1.4)
Lognormal capped mean
LNormCappedMean(cap, mu, sigma)
LNormCappedMean(cap, mu, sigma)
cap |
A positive real number - the claim severity cap. |
mu |
A real number - the first parameter of the Claim Severity's LogNormal distribution. |
sigma |
A positive real number - the second parameter of the Claim Severity's LogNormal distribution. |
The mean of the claim severity capped at cap
with a LogNormal distribution with parameters mu
and sigma
.
LNormCappedMean(2000,6,1.5) LNormCappedMean(1000,5,1.6)
LNormCappedMean(2000,6,1.5) LNormCappedMean(1000,5,1.6)
Parameter to set the maximum number of pareto slices
max_number_of_pareto_slices
max_number_of_pareto_slices
An object of class numeric
of length 1.
The the maximum number of Pareto Slices.
The NetSimR package provides three categories of functions:
Capped means, Exposure and ILF curve from various severity distributions
Pure IBNR and UPR earned periods
Sliced distributions
SlicedGammaParetoMean
SlicedLNormParetoMean
GammaCappedMean
LNormCappedMean
ParetoCappedMean
SlicedGammaParetoCappedMean
SlicedLNormParetoCappedMean
ExposureCurveGamma
ExposureCurveLNorm
ExposureCurvePareto
ExposureCurveSlicedGammaPareto
ExposureCurveSlicedLNormPareto
ILFGamma
ILFLNorm
ILFPareto
ILFSlicedGammaPareto
ILFSlicedLNormPareto
dSlicedGammaPareto
dSlicedLNormPareto
pSlicedGammaPareto
pSlicedLNormPareto
qSlicedGammaPareto
qSlicedLNormPareto
Pareto capped mean
ParetoCappedMean(cap, scale, shape)
ParetoCappedMean(cap, scale, shape)
cap |
A positive real number - the claim severity cap. |
scale |
A positive real number - the scale parameter of the Claim Severity's Pareto distribution. |
shape |
A positive real number - the shape parameter of the Claim Severity's Pareto distribution. |
The mean of the claim severity capped at cap
with a Pareto distribution with parameters scale
and shape
.
ParetoCappedMean(600,200,1.2) ParetoCappedMean(800,100,1) ParetoCappedMean(1000,500,0.8)
ParetoCappedMean(600,200,1.2) ParetoCappedMean(800,100,1) ParetoCappedMean(1000,500,0.8)
Pareto capped mean intermediary calculation
ParetoCappedMeanCalc(cap, scale, shape)
ParetoCappedMeanCalc(cap, scale, shape)
cap |
A positive real number - the claim severity cap. |
scale |
A positive real number - the scale parameter of the Claim Severity's Pareto distribution. |
shape |
A positive real number - the shape parameter of the Claim Severity's Pareto distribution. |
An interim calculation for the mean of the claim severity capped at cap
with a Pareto distribution with parameters scale
and shape
.
ParetoCappedMeanCalc(800,100,1.1) ParetoCappedMeanCalc(1000,500,0.9)
ParetoCappedMeanCalc(800,100,1.1) ParetoCappedMeanCalc(1000,500,0.9)
The cumulative density function (cdf) of a Sliced Gamma-Pareto severity distribution
pSlicedGammaPareto(x, GShape, GRate, SlicePoint, PShape)
pSlicedGammaPareto(x, GShape, GRate, SlicePoint, PShape)
x |
A positive real number - the claim amount where the cumulative density function (cdf) will be evaluated. |
GShape |
A positive real number - the shape parameter of the attritional Claim Severity's Gamma distribution. |
GRate |
A positive real number - the rate parameter of the attritional Claim Severity's Gamma distribution. |
SlicePoint |
A positive real number - the slice point and the scale parameter of the tail Claim Severity's Pareto distribution. |
PShape |
A positive real number - the shape parameter of the tail Claim Severity's Pareto distribution. |
The value of the cumulative density function (cdf) at x
with an attritional claim Gamma distribution with parameters GShape
and GRate
and a large claim Pareto distribution with parameters SlicePoint
and PShape
.
pSlicedGammaPareto(3000,1,0.0005,1000,1.2) pSlicedGammaPareto(1000,1.1,0.0006,2000,1.6) pSlicedGammaPareto(2000,1.2,0.0004,3000,1.4)
pSlicedGammaPareto(3000,1,0.0005,1000,1.2) pSlicedGammaPareto(1000,1.1,0.0006,2000,1.6) pSlicedGammaPareto(2000,1.2,0.0004,3000,1.4)
The cumulative density function (cdf) of a Sliced LogNormal Pareto severity distribution
pSlicedLNormPareto(x, mu, sigma, SlicePoint, shape)
pSlicedLNormPareto(x, mu, sigma, SlicePoint, shape)
x |
A positive real number - the claim amount where the cumulative density function (cdf) will be evaluated. |
mu |
A real number - the first parameter of the attritional Claim Severity's LogNormal distribution. |
sigma |
A positive real number - the second parameter of the attritional Claim Severity's LogNormal distribution. |
SlicePoint |
A positive real number - the slice point and the scale parameter of the tail Claim Severity's Pareto distribution. |
shape |
A positive real number - the shape parameter of the tail Claim Severity's Pareto distribution. |
The value of the cumulative density function (cdf) at x
with an attritional claim LogNormal distribution with parameters mu
and sigma
and a large claim Pareto distribution with parameters SlicePoint
and shape
.
pSlicedLNormPareto(1200,6,1.5,1000,1.2) pSlicedLNormPareto(4000,7,1.6,3000,1.4)
pSlicedLNormPareto(1200,6,1.5,1000,1.2) pSlicedLNormPareto(4000,7,1.6,3000,1.4)
Pure IBNR exposure from a Gamma reporting delay distribution
PureIBNRGamma(IncDate, ExpDate, ValDate, shape, rate)
PureIBNRGamma(IncDate, ExpDate, ValDate, shape, rate)
IncDate |
A date - the inception date of the period. |
ExpDate |
A date - the expiry date of the period. Must be greater than inception date. |
ValDate |
A date - the valuation date. |
shape |
A positive real number - the shape parameter of the reporing delay's Gamma distribution. |
rate |
A positive real number - the rate parameter of the reporing delay's Gamma distribution. |
Unearned and Pure IBNR exposure in days and as a percentage of the period's duration, where the reporting delay has a Gamma distribution with parameters shape
and rate
.
Dates = data.frame( inceptionDate = c("01/01/2006", "01/07/2006", "01/01/2007") ,expiryDate = c("31/12/2006", "30/06/2007", "31/12/2007") ) Dates$inceptionDate<-as.POSIXct(Dates$inceptionDate, format="%d/%m/%Y") Dates$expiryDate<-as.POSIXct(Dates$expiryDate, format="%d/%m/%Y") ValuationDate<-as.POSIXct("30/10/2007", format="%d/%m/%Y") PureIBNRGamma(Dates$inceptionDate,Dates$expiryDate,ValuationDate,7,0.15)
Dates = data.frame( inceptionDate = c("01/01/2006", "01/07/2006", "01/01/2007") ,expiryDate = c("31/12/2006", "30/06/2007", "31/12/2007") ) Dates$inceptionDate<-as.POSIXct(Dates$inceptionDate, format="%d/%m/%Y") Dates$expiryDate<-as.POSIXct(Dates$expiryDate, format="%d/%m/%Y") ValuationDate<-as.POSIXct("30/10/2007", format="%d/%m/%Y") PureIBNRGamma(Dates$inceptionDate,Dates$expiryDate,ValuationDate,7,0.15)
Pure IBNR exposure from a LogNormal reporting delay distribution
PureIBNRLNorm(IncDate, ExpDate, ValDate, mu, sigma)
PureIBNRLNorm(IncDate, ExpDate, ValDate, mu, sigma)
IncDate |
A date - the inception date of the period. |
ExpDate |
A date - the expiry date of the period. Must be greater than inception date. |
ValDate |
A date - the valuation date. |
mu |
A real number - the first parameter of the reporing delay's LogNormal distribution. |
sigma |
A positive real number - the second parameter of the reporing delay's LogNormal distribution. |
Unearned and Pure IBNR exposure in days and as a percentage of the period's duration, where the reporting delay has a LogNormal distribution with parameters mu
and sigma
.
Dates = data.frame( inceptionDate = c("01/01/2006", "01/07/2006", "01/01/2007") ,expiryDate = c("31/12/2006", "30/06/2007", "31/12/2007") ) Dates$inceptionDate<-as.POSIXct(Dates$inceptionDate, format="%d/%m/%Y") Dates$expiryDate<-as.POSIXct(Dates$expiryDate, format="%d/%m/%Y") ValuationDate<-as.POSIXct("30/10/2007", format="%d/%m/%Y") PureIBNRLNorm(Dates$inceptionDate,Dates$expiryDate,ValuationDate,4,1.5)
Dates = data.frame( inceptionDate = c("01/01/2006", "01/07/2006", "01/01/2007") ,expiryDate = c("31/12/2006", "30/06/2007", "31/12/2007") ) Dates$inceptionDate<-as.POSIXct(Dates$inceptionDate, format="%d/%m/%Y") Dates$expiryDate<-as.POSIXct(Dates$expiryDate, format="%d/%m/%Y") ValuationDate<-as.POSIXct("30/10/2007", format="%d/%m/%Y") PureIBNRLNorm(Dates$inceptionDate,Dates$expiryDate,ValuationDate,4,1.5)
The inverse cumulative density function of a Sliced Gamma Pareto severity distribution
qSlicedGammaPareto(q, GShape, GRate, SlicePoint, PShape)
qSlicedGammaPareto(q, GShape, GRate, SlicePoint, PShape)
q |
A real number between 0 and 1 - the probability where the inverse cumulative density function will be evaluated. |
GShape |
A positive real number - the shape parameter of the attritional Claim Severity's Gamma distribution. |
GRate |
A positive real number - the rate parameter of the attritional Claim Severity's Gamma distribution. |
SlicePoint |
A positive real number - the slice point and the scale parameter of the tail Claim Severity's Pareto distribution. |
PShape |
A positive real number - the shape parameter of the tail Claim Severity's Pareto distribution. |
The value of the inverse cumulative density function at q
with an attritional claim Gamma distribution with parameters GShape
and GRate
and a large claim Pareto distribution with parameters SlicePoint
and PShape
.
qSlicedGammaPareto(0.5,1,0.0005,1000,1.2) qSlicedGammaPareto(0.2,1.1,0.0006,2000,1.6) qSlicedGammaPareto(0.8,1.2,0.0004,3000,1.4)
qSlicedGammaPareto(0.5,1,0.0005,1000,1.2) qSlicedGammaPareto(0.2,1.1,0.0006,2000,1.6) qSlicedGammaPareto(0.8,1.2,0.0004,3000,1.4)
The inverse cumulative density function of a Sliced LogNormal Pareto severity distribution
qSlicedLNormPareto(q, mu, sigma, SlicePoint, shape)
qSlicedLNormPareto(q, mu, sigma, SlicePoint, shape)
q |
A real number between 0 and 1 - the probability where the inverse cumulative density function will be evaluated. |
mu |
A real number - the first parameter of the attritional Claim Severity's LogNormal distribution. |
sigma |
A positive real number - the second parameter of the attritional Claim Severity's LogNormal distribution. |
SlicePoint |
A positive real number - the slice point and the scale parameter of the tail Claim Severity's Pareto distribution. |
shape |
A positive real number - the shape parameter of the tail Claim Severity's Pareto distribution. |
The value of the inverse cumulative density function at q
with an attritional claim LogNormal distribution with parameters mu
and sigma
and a large claim Pareto distribution with parameters SlicePoint
and shape
.
qSlicedLNormPareto(0.5,6,1.5,1000,1.2) qSlicedLNormPareto(0.7,7,1.6,3000,1.4)
qSlicedLNormPareto(0.5,6,1.5,1000,1.2) qSlicedLNormPareto(0.7,7,1.6,3000,1.4)
A vector with the reinsurance structure options
reinsurance_structures_options
reinsurance_structures_options
An object of class character
of length 4.
The reinsurance structure options
Random Pareto generator
rpareto(n, alpha, x_m)
rpareto(n, alpha, x_m)
n |
Number of values to generate. |
alpha |
A positive real number. Alpha parameter of the Pareto distribution. |
x_m |
A positive real number. The minimum value for the Pareto distribution. |
A vector of n
random Pareto variables with parameters alpha
and x_m
.
A function to run the glm fitting tool application
run_shiny_distribution_fitting_tool()
run_shiny_distribution_fitting_tool()
Opens the glm fitting tool application
A function to run the glm fitting tool application
run_shiny_glm_fitting_tool()
run_shiny_glm_fitting_tool()
Opens the glm fitting tool application
A function to run the shiny simulator application
run_shiny_simulator()
run_shiny_simulator()
Opens the shiny simulator application
A vector with the severity distribution objects
sev_dist_options
sev_dist_options
An object of class list
of length 6.
The severity distribution objects.
A data frame with the severity distribution parameter placeholders
sev_dist_parameter_placeholders
sev_dist_parameter_placeholders
An object of class data.frame
with 2 rows and 2 columns.
The severity distribution parameter placeholders.
Server function for the Shiny Simulator application
shiny_simulator_server(input, output, session)
shiny_simulator_server(input, output, session)
input |
Input for the server function. |
output |
Output for the server function. |
session |
Session for the server function. |
Returns server rendering for the shiny application.
UI file for the Shiny GLM Fitting Tool
shiny_simulator_ui
shiny_simulator_ui
An object of class shiny.tag.list
(inherits from list
) of length 4.
Returns the UI code for the shiny application.
A function to simulate frequency - severity of insurance claims. The function applies severity cap, reinsurance structure for each and every loss claim, reinsurance structure for each and aggregate claims. The function allows for piecewise pareto slices.
simulate_function( numOfSimulations, freq_params, sev_params, seedSetBinary, seedValue, freqDistr, sevDistr, paretoSlice, pareto_slice_times, slice_pareto_alphas, slice_pareto_x_ms, sevCapBinary, sev_cap_amount, reinsuranceStructureEEL, reinsurance_structure_eel_dedctible_amount, reinsurance_structure_eel_limit_amount, reinsuranceStructureAL, reinsurance_structure_al_dedctible_amount, reinsurance_structure_al_limit_amount, reinsuranceStructureLimitedReinstatements, reinsuranceStructureReinstatementLimit, multiprocessing )
simulate_function( numOfSimulations, freq_params, sev_params, seedSetBinary, seedValue, freqDistr, sevDistr, paretoSlice, pareto_slice_times, slice_pareto_alphas, slice_pareto_x_ms, sevCapBinary, sev_cap_amount, reinsuranceStructureEEL, reinsurance_structure_eel_dedctible_amount, reinsurance_structure_eel_limit_amount, reinsuranceStructureAL, reinsurance_structure_al_dedctible_amount, reinsurance_structure_al_limit_amount, reinsuranceStructureLimitedReinstatements, reinsuranceStructureReinstatementLimit, multiprocessing )
numOfSimulations |
The number of simulations to run. |
freq_params |
A vector of the frequency distribution parameters. |
sev_params |
A vector of the severity distribution parameters. |
seedSetBinary |
True if there is a fixed seed, otherwise false. |
seedValue |
The seed value. |
freqDistr |
The frequency distribution. Options are as per the freq_dist_options. |
sevDistr |
The severity distribution. Options are as per the sev_dist_options. |
paretoSlice |
True if there is Pareto slicing. |
pareto_slice_times |
The number of Pareto slices. |
slice_pareto_alphas |
A vector of Pareto slices' aphla parameters. |
slice_pareto_x_ms |
A vector of Pareto slices' x_m parameters. |
sevCapBinary |
True if there is a severity cap. |
sev_cap_amount |
The severity cap amount. |
reinsuranceStructureEEL |
The chosen reinsurance structure for each and every loss claim. |
reinsurance_structure_eel_dedctible_amount |
The deductible for each and every loss reinsurance structure. |
reinsurance_structure_eel_limit_amount |
The limit for each and every loss reinsurance structure. |
reinsuranceStructureAL |
The chosen reinsurance structure for aggregate claims. |
reinsurance_structure_al_dedctible_amount |
The deductible for aggregate reinsurance structure. |
reinsurance_structure_al_limit_amount |
The limit for aggregate reinsurance structure. |
reinsuranceStructureLimitedReinstatements |
True if there is a limit in reinstatements, otherwise false. |
reinsuranceStructureReinstatementLimit |
The reinstatement limit. |
multiprocessing |
True if multiprocessing is used, otherwise false. |
A data frame with claims counts, ceded claims and the number of reinstatements used.
Sliced Gamma Pareto capped mean
SlicedGammaParetoCappedMean(cap, GShape, GRate, SlicePoint, PShape)
SlicedGammaParetoCappedMean(cap, GShape, GRate, SlicePoint, PShape)
cap |
A positive real number - the claim severity cap. |
GShape |
A positive real number - the shape parameter of the attritional Claim Severity's Gamma distribution. |
GRate |
A positive real number - the rate parameter of the attritional Claim Severity's Gamma distribution. |
SlicePoint |
A positive real number - the slice point and the scale parameter of the tail Claim Severity's Pareto distribution. |
PShape |
A positive real number - the shape parameter of the tail Claim Severity's Pareto distribution. |
The mean of the claim severity capped at cap
with an attritional claim Gamma distribution with parameters GShape
and GRate
and a large claim Pareto distribution with parameters SlicePoint
and PShape
.
SlicedGammaParetoCappedMean(3000,1,0.0005,1000,1.2) SlicedGammaParetoCappedMean(1000,1.1,0.0006,2000,1.6) SlicedGammaParetoCappedMean(2000,1.2,0.0004,3000,1.4)
SlicedGammaParetoCappedMean(3000,1,0.0005,1000,1.2) SlicedGammaParetoCappedMean(1000,1.1,0.0006,2000,1.6) SlicedGammaParetoCappedMean(2000,1.2,0.0004,3000,1.4)
Sliced Gamma Pareto mean
SlicedGammaParetoMean(GShape, GRate, SlicePoint, PShape)
SlicedGammaParetoMean(GShape, GRate, SlicePoint, PShape)
GShape |
A positive real number - the shape parameter of the attritional Claim Severity's Gamma distribution. |
GRate |
A positive real number - the rate parameter of the attritional Claim Severity's Gamma distribution. |
SlicePoint |
A positive real number - the slice point and the scale parameter of the tail Claim Severity's Pareto distribution. |
PShape |
A positive real number - the Shape parameter of the tail Claim Severity's Pareto distribution. |
The mean of the claim severity with an attritional claim Gamma distribution with parameters GShape
and GRate
and a large claim Pareto distribution with parameters SlicePoint
and PShape
.
SlicedGammaParetoMean(1,0.0005,1000,1.2) SlicedGammaParetoMean(1.1,0.0006,2000,1.6) SlicedGammaParetoMean(1.2,0.0004,3000,1.4)
SlicedGammaParetoMean(1,0.0005,1000,1.2) SlicedGammaParetoMean(1.1,0.0006,2000,1.6) SlicedGammaParetoMean(1.2,0.0004,3000,1.4)
Sliced LogNormal Pareto capped mean
SlicedLNormParetoCappedMean(cap, mu, sigma, SlicePoint, shape)
SlicedLNormParetoCappedMean(cap, mu, sigma, SlicePoint, shape)
cap |
A positive real number - the claim severity cap. |
mu |
A real number - the first parameter of the attritional Claim Severity's LogNormal distribution. |
sigma |
A positive real number - the second parameter of the attritional Claim Severity's LogNormal distribution. |
SlicePoint |
A positive real number - the slice point and the scale parameter of the tail Claim Severity's Pareto distribution. |
shape |
A positive real number - the shape parameter of the tail Claim Severity's Pareto distribution. |
The mean of the claim severity capped at cap
with an attritional claim LogNormal distribution with parameters mu
and sigma
and a large claim Pareto distribution with parameters SlicePoint
and shape
.
SlicedLNormParetoCappedMean(1200,6,1.5,1000,1.2) SlicedLNormParetoCappedMean(2500,6.5,1.4,2000,1.6) SlicedLNormParetoCappedMean(4000,7,1.6,3000,1.4)
SlicedLNormParetoCappedMean(1200,6,1.5,1000,1.2) SlicedLNormParetoCappedMean(2500,6.5,1.4,2000,1.6) SlicedLNormParetoCappedMean(4000,7,1.6,3000,1.4)
Sliced LogNormal Pareto mean
SlicedLNormParetoMean(mu, sigma, SlicePoint, shape)
SlicedLNormParetoMean(mu, sigma, SlicePoint, shape)
mu |
A real number - the first parameter of the attritional Claim Severity's LogNormal distribution. |
sigma |
A positive real number - the second parameter of the attritional Claim Severity's LogNormal distribution. |
SlicePoint |
A positive real number - the slice point and the scale parameter of the tail Claim Severity's Pareto distribution. |
shape |
A positive real number - the shape parameter of the tail Claim Severity's Pareto distribution. |
The mean of the claim severity with an attritional claim LogNormal distribution with parameters mu
and sigma
and a large claim Pareto distribution with parameters SlicePoint
and shape
.
SlicedLNormParetoMean(6,1.5,1000,1.2) SlicedLNormParetoMean(6.5,1.4,2000,1.6) SlicedLNormParetoMean(7,1.6,3000,1.4)
SlicedLNormParetoMean(6,1.5,1000,1.2) SlicedLNormParetoMean(6.5,1.4,2000,1.6) SlicedLNormParetoMean(7,1.6,3000,1.4)