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: a claims simulator with reinsurance structures, a generalised linear model fitting tool, and a claims frequency and severity distribution fitting tool. 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>; Taken to excess by Yiannis Parizas (2019) < https://www.theactuary.com/features/2019/03/2019/03/06/taken-excess>.
NetSimR is an R package of actuarial functions for non-life insurance and reinsurance pricing, reserving and capital modelling, with three Shiny tools for simulating claims and fitting distributions and GLMs.
# the released version from CRAN
install.packages("NetSimR")
# the development version from GitHub
# install.packages("remotes")
remotes::install_github("NetSimAnalytics/NetSimR")
library(NetSimR)
# mean claim size capped at 600 for a Pareto with scale 200 and shape 1.2
ParetoCappedMean(600, 200, 1.2)
# increased limit factor from 700 to 1,000 for Gamma claim sizes
ILFGamma(700, 1000, 1, 0.0005)
# Gamma body sliced at 3,000 with a Pareto tail of shape 1.4
pSlicedGammaPareto(5000, 1.2, 0.0004, 3000, 1.4)
# pure IBNR exposure (in days) of three periods, with a Gamma reporting delay
PureIBNRGamma(
as.Date(c("2006-01-01", "2006-07-01", "2007-01-01")),
as.Date(c("2006-12-31", "2007-06-30", "2007-12-31")),
as.Date("2007-10-30"),
shape = 7, rate = 0.15
)
# 10,000 years of Poisson claim counts with LogNormal claim sizes, a Pareto tail
# above 100,000, and a layer of 50,000 excess of 20,000 on each claim with two
# reinstatements
ceded <- simulate_claims(
10000, "Poisson", 3, "LogNormal", c(meanlog = 8, sdlog = 1.5), seed = 1,
pareto_thresholds = 100000, pareto_alphas = 1.5,
eel_layer = "limited", eel_deductible = 20000, eel_limit = 50000,
eel_reinstatements = 2
)
mean(ceded$total_claims)
run_shiny_simulator() # claims simulator
run_shiny_distribution_fitting_tool() # frequency and severity fits
run_shiny_glm_fitting_tool() # generalised linear models
Four vignettes set out the theory behind the functions and work through examples:
They are on the package's CRAN page,
and browseVignettes("NetSimR") opens the copies installed with the package
(a development version installed from GitHub has them only when installed with
build_vignettes = TRUE).
The methods are described in articles by Yiannis Parizas in The Actuary: Free for All (2023), Escaping the triangle (2019) and Taken to excess (2019).