Learn R Programming

cascsim (version 0.4)

Casualty Actuarial Society Individual Claim Simulator

Description

It is an open source insurance claim simulation engine sponsored by the Casualty Actuarial Society. It generates individual insurance claims including open claims, reopened claims, incurred but not reported claims and future claims. It also includes claim data fitting functions to help set simulation assumptions. It is useful for claim level reserving analysis. Parodi (2013) .

Copy Link

Version

Install

install.packages('cascsim')

Monthly Downloads

254

Version

0.4

License

GPL-3

Maintainer

Kailan Shang

Last Published

January 13th, 2020

Functions in cascsim (0.4)

TSD

Calculate Theoretical Standard Deviation of distribution. min and max are not applied
PDFPlot

Plotting the PDF of data and fitted distribution
claimSample

Claim simulation at line/type/status level
claimSimulation

Claim simulation at line/type/status level
PPPlot

P-P Plot of data and fitted distribution
TSkewness

Calculate Theoretical Skewness of distribution. min and max are not applied
copulaDataPlot

Experience data plotting.
getTrend

Get the trend index.
claimdata

Sample Claim Data
Probability

Probability function.
QQPlot

Q-Q Plot of data and fitted distribution
CopulaObj-class

An S4 class to represent a copula object to model the correlation.
copulaFit

Copula fitting
setMin

Set the minimum of the distribution. For example, the distribution of settlement lag for open claims
setMonthlyIndex<-

Set monthly index values.
setDimension<-

Set the dimension of the copula.
sampleMean

Calculate the mean of 100000 sampled values from the distribution.
setDf<-

Set the degree of freedom for t Copula.
setStartDate<-

Set the start date for the claim simulation exercise
nloglik

Negative Loglikelihood.
sampleKurtosis

Calculate the excess kurtosis of 10000 sampled values from the distribution.
expectZeros

Get the expected P0 based on settlement/close year.
pempirical

Cumulative probability function of empirical distribution using linear interpolation
setAnnualizedRate<-

Set the annualized level rate to construct the index. Only used when tabulate == FALSE.
copulaFitPlot

Visualization Copula fitting
getCopula

Get the R copula object.
copulaPlot

Copula plotting. Only for 2 or 3 variables
Simulation-class

An S4 class to represent a simulation task.
Quantile

Quantile function.
setTabulate<-

Determine whether the index values are constructed from a constant rate or provided directly
fitPlot

Compare the raw data and fitted distribution on density, CDF, Q-Q plot and P-P plot
copulaSample

Copula sampling. It will generate correlated variables or percentiles when marginal distributions are not specified.
shiftIndex

Shift monthly index with a new start date and replace the unknown index value with zero.
doPlot

Plot function.
simP0

Simulate whether claims will have zero payment.
TEKurt

Calculate Theoretical Excessive Kurtosis of distribution. min and max are not applied
observationPlot

Plotting the data for distribution fitting
setFittedDist<-

Directly set the fitted distribution without fitting it to the data.
setRectangle

Set up the rectangle based on simulated data.
setMarginal<-

Set the marginal distributions of the copula.
setFun<-

Set the model format/link function (identity/inverse/log/exponential). Only used when FacModel == TRUE.
setCopulaParam<-

Set copula parameters.
setMeanList<-

Set the year-to-year loss development factor.
setSeasonality<-

Set seasonality on a monthly basis.
mpareto

Moment function of Pareto Distribution (PDF: alpha*xm^alpha/x^(alpha+1))
setFacModel<-

Determine whether the development factor is determined by a predictive model or a fixed schedule by development year
dtempirical

Density function of truncated empirical distribution
setprobs<-

Set the percentiles to be matched. Only used when qme is chosen for fitting method.
simSummary

Claim simulation result summary
setifreq<-

Set the data type: frequency or severity/time lag.
getIndex

Retrieve index value based on dates.
TMean

Calculate Theoretical Mean of distribution. min and max are not applied
simReport

Generate claim simulation result report in html
Triangle-class

An S4 class to represent a triangle or rectangle object.
claimFitting

Claim data fitting analysis at line/type/status level
ultiDevFac

Calculate ultimate development factor based on current development year, a mean development factor schedule and its volatility. It is used to simulate the ultimate loss for open claims.
getObservation

Get input data from an object.
rreopen

Simulate whether closed claims will be reopened or not.
plotText

Plot text content
dtexp

Density function of Truncated Exponential Distribution
setCopulaType<-

Set copula type.
setIndex

Set up a time index for frequency or severity.
setXname<-

Set additional explanatory variable names.
setID<-

setID Set the ID for an object
setDevFac

Set up an IBNER loss development schedule.
dtgamma

Density function of Truncated Gamma Distribution
setTrend<-

Set the trend with an Index Object.
setVolList<-

Set the year-to-year loss development factor volatility.
setTrialDist<-

Distribution fitting and testing.
setRange<-

Set the min and max of the variable.
setUpperTriangle

Set up the upper triangle based on claim data.
setUpperKeep

Set up the upper triangle for non-simulated data.
setFitdata

Preparing the input data (observation) for distribution fitting, including detrending, translating occurrence dates to frequency data, etc.
setParas<-

Set the values of model parameters.
setYearlyIndex<-

Set yearly index values.
doSample

Sampling from the distribution.
setfitmethod<-

Set distribution fitting method.
dtlnorm

Density function of Truncated Lognormal Distribution
truncate

Truncate a numeric vector
sampleSkew

Calculate the skewness of 10000 sampled values from the distribution.
dtnbinom

Density function of Truncated Negative Binomial Distribution
sampleSd

Calculate the standard deviation of 10000 sampled values from the distribution.
setDispstr<-

Set parameter matrix format of Elliptical copula.
dtweibull

Density function of Truncated Weibull Distribution
setObservation<-

Input the raw data.
setParams<-

Set distribution parameters.
setTruncated<-

Set the indicator of truncated distribution.
dtgeom

Density function of Truncated Geometric Distribution
setEmpirical<-

Set the list of values and corresponding probabilities (Pr(X<value) for continuous variable and Pr(X==value) for discrete variable). It is only used for empirical distribution.
setTrialDistErr<-

Distribution fitting and testing. Same as setTrialDist except for error tolerance.
setfreq<-

Set the data frequency.
setidate<-

Set whether occurrence dates will be used for frequency data.
simTriangle

Claim simulation result triangles
dtbeta

Density function of Truncated Beta Distribution
dtpois

Density function of Truncated Poisson Distribution
dtpareto

Density function of Truncated Pareto Distribution
toDate

Convert US date mm/dd/yyyy to yyyy-mm-dd format
dtnorm

Density function of Truncated Normal Distribution
KSTest

K-S Test
Density

Density function.
ClaimType-class

An S4 class to represent a claim type.
CDFPlot

Plotting the CDF of data and fitted distribution
Distribution-class

An S4 class to represent a distribution, either parametric or non-parametric.
ChiSqrTest

Chi-Squared Test
Index-class

An S4 class to represent a time index for frequency or severity distribution.
DevFac-class

An S4 class to represent a loss development schedule.
FitDist-class

An S4 class to represent distribution fitting.