Package 'NetSimR'

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

Help Index


Apply a deductible and limit to claims

Description

Apply a deductible and limit to claims

Usage

apply_deductible_limit(
  gross_claims_data,
  reinsurance_structure,
  deductible,
  limit
)

Arguments

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.

Value

The ceded claims for the structure, with the chosen deductible and limit.

Examples

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

Description

Apply severity cap function

Usage

apply_severity_cap(claims, severity_cap_boolean, severity_cap_amount)

Arguments

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.

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

Description

Server function for the Distribution Fitting tool application

Usage

distribution_fitting_tool_Server(input, output, session)

Arguments

input

Input for the server function.

output

Output for the server function.

session

Session for the server function.

Value

Returns server rendering for the shiny application.


UI file for the Shiny glm fitting tool

Description

UI file for the Shiny glm fitting tool

Usage

distribution_fitting_tool_UI

Format

An object of class shiny.tag.list (inherits from list) of length 4.

Value

Returns the UI code for the shiny application.


The class of the distribution objects

Description

The class of the distribution objects


The probability density function (pdf) of a Sliced Gamma Pareto severity distribution

Description

The probability density function (pdf) of a Sliced Gamma Pareto severity distribution

Usage

dSlicedGammaPareto(x, GShape, GRate, SlicePoint, PShape)

Arguments

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.

Value

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.

Examples

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

Description

The probability density function (pdf) of a Sliced LogNormal Pareto severity distribution

Usage

dSlicedLNormPareto(x, mu, sigma, SlicePoint, shape)

Arguments

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.

Value

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.

Examples

dSlicedLNormPareto(1200,6,1.5,1000,1.2)
dSlicedLNormPareto(4000,7,1.6,3000,1.4)

Error function

Description

Error function

Usage

erf(x)

Arguments

x

A real number.

Value

The value of the error function at x.

Examples

erf(0.1)
erf(0.5)

Exposure Curve from a Gamma severity distribution

Description

Exposure Curve from a Gamma severity distribution

Usage

ExposureCurveGamma(x, shape, rate)

Arguments

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.

Value

The value of the Exposure curve at x with Claim Severity from a Gamma distribution with parameters shape and rate.

Examples

ExposureCurveGamma(700,1,0.0005)
ExposureCurveGamma(1000,1.5,0.0006)

Exposure Curve from LogNormal a severity distribution

Description

Exposure Curve from LogNormal a severity distribution

Usage

ExposureCurveLNorm(x, mu, sigma)

Arguments

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.

Value

The value of the Exposure curve at x with Claim Severity from a LogNormal distribution with parameters mu and sigma.

Examples

ExposureCurveLNorm(2000,6,1.5)
ExposureCurveLNorm(1000,5,1.6)

Exposure Curve from a Pareto severity distribution

Description

Exposure Curve from a Pareto severity distribution

Usage

ExposureCurvePareto(x, scale, shape)

Arguments

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.

Value

The value of the Exposure curve at x with Claim Severity from a Pareto distribution with parameters scale and shape.

Examples

ExposureCurvePareto(700,500,1.2)
ExposureCurvePareto(20000,200,1.1)

Exposure Curve from a Sliced Gamma Pareto severity distribution

Description

Exposure Curve from a Sliced Gamma Pareto severity distribution

Usage

ExposureCurveSlicedGammaPareto(x, GShape, GRate, SlicePoint, PShape)

Arguments

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.

Value

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.

Examples

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

Description

Exposure Curve from a Sliced LogNormal Pareto severity distribution

Usage

ExposureCurveSlicedLNormPareto(x, mu, sigma, SlicePoint, shape)

Arguments

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.

Value

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.

Examples

ExposureCurveSlicedLNormPareto(1200,6,1.5,1000,1.2)
ExposureCurveSlicedLNormPareto(4000,7,1.6,3000,1.4)

A vector with the frequency distribution objects

Description

A vector with the frequency distribution objects

Usage

freq_dist_options

Format

An object of class list of length 4.

Value

The frequency distribution objects.


A data frame with the frequency distribution parameter placeholders

Description

A data frame with the frequency distribution parameter placeholders

Usage

freq_dist_parameter_placeholders

Format

An object of class data.frame with 2 rows and 2 columns.

Value

The frequency distribution parameter placeholders.


Gamma capped mean

Description

Gamma capped mean

Usage

GammaCappedMean(cap, shape, rate)

Arguments

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.

Value

The mean of the claim severity capped at cap with a Gamma distribution with parameters shape and rate.

Examples

GammaCappedMean(700,1,0.0005)
GammaCappedMean(1000,1.5,0.0006)

Server function for the GLM Fitting tool application

Description

Server function for the GLM Fitting tool application

Usage

GLMFittingToolServer(input, output, session)

Arguments

input

Input for the server function.

output

Output for the server function.

session

Session for the server function.

Value

Returns server rendering for the shiny application.


UI file for the Shiny glm fitting tool

Description

UI file for the Shiny glm fitting tool

Usage

GLMFittingToolUI

Format

An object of class shiny.tag.list (inherits from list) of length 4.

Value

Returns the UI code for the shiny application.


Lower incomplete gamma function

Description

Lower incomplete gamma function

Usage

IGamma(a, x)

Arguments

a

A positive real number.

x

A positive real number.

Value

The value of the lower incomplete gamma function at x with shape parameter a.

Examples

IGamma(1,1)
IGamma(0.1,2)

Increased Limit Factor Curve from a Gamma severity distribution

Description

Increased Limit Factor Curve from a Gamma severity distribution

Usage

ILFGamma(xLow, xHigh, shape, rate)

Arguments

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.

Value

The value of the Increased Limit Factor curve from xLow to xHigh with Claim Severity from a Gamma distribution with parameters shape and rate.

Examples

ILFGamma(1000,700,1,0.0005)
ILFGamma(1200,1000,1.5,0.0006)

Increased Limit Factor Curve from a LogNormal severity distribution

Description

Increased Limit Factor Curve from a LogNormal severity distribution

Usage

ILFLNorm(xLow, xHigh, mu, sigma)

Arguments

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.

Value

The value of the Increased Limit Factor curve from xLow to xHigh with Claim Severity from a LogNormal distribution with parameters mu and sigma.

Examples

ILFLNorm(1000,2000,6,1.5)
ILFLNorm(1000,1500,5,1.6)

Increased Limit Factor Curve from a Pareto severity distribution

Description

Increased Limit Factor Curve from a Pareto severity distribution

Usage

ILFPareto(xLow, xHigh, scale, shape)

Arguments

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.

Value

The value of the Increased Limit Factor curve from xLow to xHigh with Claim Severity from a Pareto distribution with parameters scale and shape.

Examples

ILFPareto(700,1200,500,1.2)
ILFPareto(1200,20000,200,1.1)

Increased Limit Factor Curve from a Sliced Gamma Pareto severity distribution

Description

Increased Limit Factor Curve from a Sliced Gamma Pareto severity distribution

Usage

ILFSlicedGammaPareto(xLow, xHigh, GShape, GRate, SlicePoint, PShape)

Arguments

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.

Value

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.

Examples

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

Description

Increased Limit Factor Curve from a Sliced LogNormal Pareto severity distribution

Usage

ILFSlicedLNormPareto(xLow, xHigh, mu, sigma, SlicePoint, shape)

Arguments

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.

Value

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.

Examples

ILFSlicedLNormPareto(800,1200,6,1.5,1000,1.2)
ILFSlicedLNormPareto(2000,4000,7,1.6,3000,1.4)

Lognormal capped mean

Description

Lognormal capped mean

Usage

LNormCappedMean(cap, mu, sigma)

Arguments

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.

Value

The mean of the claim severity capped at cap with a LogNormal distribution with parameters mu and sigma.

Examples

LNormCappedMean(2000,6,1.5)
LNormCappedMean(1000,5,1.6)

Parameter to set the maximum number of pareto slices

Description

Parameter to set the maximum number of pareto slices

Usage

max_number_of_pareto_slices

Format

An object of class numeric of length 1.

Value

The the maximum number of Pareto Slices.


NetSimR: A non-life insurance package for computating various statistics.

Description

The NetSimR package provides three categories of functions:

  1. Capped means, Exposure and ILF curve from various severity distributions

  2. Pure IBNR and UPR earned periods

  3. Sliced distributions

NetSimR mean functions

SlicedGammaParetoMean SlicedLNormParetoMean

NetSimR capped mean functions

GammaCappedMean LNormCappedMean ParetoCappedMean SlicedGammaParetoCappedMean SlicedLNormParetoCappedMean

NetSimR exposure curve functions

ExposureCurveGamma ExposureCurveLNorm ExposureCurvePareto ExposureCurveSlicedGammaPareto ExposureCurveSlicedLNormPareto

NetSimR ILF curve functions

ILFGamma ILFLNorm ILFPareto ILFSlicedGammaPareto ILFSlicedLNormPareto

NetSimR pure IBNR functions

PureIBNRGamma PureIBNRLNorm

NetSimR Sliced distribution functions

dSlicedGammaPareto dSlicedLNormPareto pSlicedGammaPareto pSlicedLNormPareto qSlicedGammaPareto qSlicedLNormPareto


Pareto capped mean

Description

Pareto capped mean

Usage

ParetoCappedMean(cap, scale, shape)

Arguments

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.

Value

The mean of the claim severity capped at cap with a Pareto distribution with parameters scale and shape.

Examples

ParetoCappedMean(600,200,1.2)
ParetoCappedMean(800,100,1)
ParetoCappedMean(1000,500,0.8)

Pareto capped mean intermediary calculation

Description

Pareto capped mean intermediary calculation

Usage

ParetoCappedMeanCalc(cap, scale, shape)

Arguments

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.

Value

An interim calculation for the mean of the claim severity capped at cap with a Pareto distribution with parameters scale and shape.

Examples

ParetoCappedMeanCalc(800,100,1.1)
ParetoCappedMeanCalc(1000,500,0.9)

The cumulative density function (cdf) of a Sliced Gamma-Pareto severity distribution

Description

The cumulative density function (cdf) of a Sliced Gamma-Pareto severity distribution

Usage

pSlicedGammaPareto(x, GShape, GRate, SlicePoint, PShape)

Arguments

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.

Value

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.

Examples

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

Description

The cumulative density function (cdf) of a Sliced LogNormal Pareto severity distribution

Usage

pSlicedLNormPareto(x, mu, sigma, SlicePoint, shape)

Arguments

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.

Value

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.

Examples

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

Description

Pure IBNR exposure from a Gamma reporting delay distribution

Usage

PureIBNRGamma(IncDate, ExpDate, ValDate, shape, rate)

Arguments

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.

Value

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.

Examples

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

Description

Pure IBNR exposure from a LogNormal reporting delay distribution

Usage

PureIBNRLNorm(IncDate, ExpDate, ValDate, mu, sigma)

Arguments

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.

Value

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.

Examples

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

Description

The inverse cumulative density function of a Sliced Gamma Pareto severity distribution

Usage

qSlicedGammaPareto(q, GShape, GRate, SlicePoint, PShape)

Arguments

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.

Value

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.

Examples

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

Description

The inverse cumulative density function of a Sliced LogNormal Pareto severity distribution

Usage

qSlicedLNormPareto(q, mu, sigma, SlicePoint, shape)

Arguments

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.

Value

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.

Examples

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

Description

A vector with the reinsurance structure options

Usage

reinsurance_structures_options

Format

An object of class character of length 4.

Value

The reinsurance structure options


Random Pareto generator

Description

Random Pareto generator

Usage

rpareto(n, alpha, x_m)

Arguments

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.

Value

A vector of n random Pareto variables with parameters alpha and x_m.


A function to run the glm fitting tool application

Description

A function to run the glm fitting tool application

Usage

run_shiny_distribution_fitting_tool()

Value

Opens the glm fitting tool application


A function to run the glm fitting tool application

Description

A function to run the glm fitting tool application

Usage

run_shiny_glm_fitting_tool()

Value

Opens the glm fitting tool application


A function to run the shiny simulator application

Description

A function to run the shiny simulator application

Usage

run_shiny_simulator()

Value

Opens the shiny simulator application


A vector with the severity distribution objects

Description

A vector with the severity distribution objects

Usage

sev_dist_options

Format

An object of class list of length 6.

Value

The severity distribution objects.


A data frame with the severity distribution parameter placeholders

Description

A data frame with the severity distribution parameter placeholders

Usage

sev_dist_parameter_placeholders

Format

An object of class data.frame with 2 rows and 2 columns.

Value

The severity distribution parameter placeholders.


Server function for the Shiny Simulator application

Description

Server function for the Shiny Simulator application

Usage

shiny_simulator_server(input, output, session)

Arguments

input

Input for the server function.

output

Output for the server function.

session

Session for the server function.

Value

Returns server rendering for the shiny application.


UI file for the Shiny GLM Fitting Tool

Description

UI file for the Shiny GLM Fitting Tool

Usage

shiny_simulator_ui

Format

An object of class shiny.tag.list (inherits from list) of length 4.

Value

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.

Description

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.

Usage

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
)

Arguments

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.

Value

A data frame with claims counts, ceded claims and the number of reinstatements used.


Sliced Gamma Pareto capped mean

Description

Sliced Gamma Pareto capped mean

Usage

SlicedGammaParetoCappedMean(cap, GShape, GRate, SlicePoint, PShape)

Arguments

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.

Value

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.

Examples

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

Description

Sliced Gamma Pareto mean

Usage

SlicedGammaParetoMean(GShape, GRate, SlicePoint, PShape)

Arguments

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.

Value

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.

Examples

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

Description

Sliced LogNormal Pareto capped mean

Usage

SlicedLNormParetoCappedMean(cap, mu, sigma, SlicePoint, shape)

Arguments

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.

Value

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.

Examples

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

Description

Sliced LogNormal Pareto mean

Usage

SlicedLNormParetoMean(mu, sigma, SlicePoint, shape)

Arguments

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.

Value

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.

Examples

SlicedLNormParetoMean(6,1.5,1000,1.2)
SlicedLNormParetoMean(6.5,1.4,2000,1.6)
SlicedLNormParetoMean(7,1.6,3000,1.4)