simpf {actuar} | R Documentation |
simpf
simulates a portfolio of data for insurance
applications. Both frequency and severity distributions can have an
unknown risk parameter — that is, they can each be mixtures of
models.
simpf(contracts, years, model.freq, model.sev, weights)
contracts |
the number of contracts in the porfolio |
years |
the number of years of experience for each contract |
model.freq |
named list containing the frequency model (see details
below); if NULL , only claim amounts are simulated |
model.sev |
named list containing the severity model (see details
below); if NULL , only claim numbers are simulated |
weights |
a matrix of weights (one per contract and per year) to be used in the simulation of frequencies |
The function allows for continuous mixtures of models for both
frequency and severity of losses. The mixing (or risk) parameter
is called Lambda
in the frequency model and Theta
in the
severity model.
Distribution assumptions are specified using the base name of random
number generation functions, e.g. "pois"
for the Poisson distribution
or "lnorm"
for the lognormal.
model.freq
and model.sev
are NULL
or named lists
composed of:
dist1
par1
dist1
as
they are defined in rdist1
. If needed, the mixing parameter
is identified by an unevaluated expression in Lambda
and
weights
for model.freq
, or Theta
for
model.sev
.dist2
par2
dist2
as
they are defined in rdist2
.A list with two components:
data |
a two dimension (contracts rows and
years columns) list where each element is a vector of
losses, or a matrix if each element has length 1 |
weights |
the matrix of weights given in argument, or a matrix of 1 otherwise. |
Vincent Goulet vincent.goulet@act.ulaval.ca and Sébastien Auclair
Goulet, V. (2006), Credibility for severity revisited, North American Actuarial Journal, to appear.
## Portfolio where both frequency and severity models are mixed. modelfreq <- list(dist1 = "pois", par1 = list(lambda = quote(Lambda * weights)), dist2 = "gamma", par2 = c(shape = 2, rate = 1)) modelsev<-list(dist1 = "lnorm", par1 = list(meanlog = quote(Theta), sdlog = 1), dist2 = "norm", par2 = c(mean = 5, sd = 1)) data(hachemeister) weights <- hachemeister$weights/mean(hachemeister$weights) simpf(5, 12, modelfreq, modelsev, weights) ## Portfolio where the frequency model is mixed, but not the ## severity model. modelsev <- list(dist1 = "lnorm", par1 = list(meanlog = 7, sd = 1)) simpf(5, 12, modelfreq, modelsev) ## Portofolio with a severity model only and a user function for the ## simulation of claim amounts. rpareto <- function(n, alpha, lambda) lambda * (runif(n)^(-1/alpha) - 1) modelsev <- list(dist1 = "pareto", par1 = list(alpha = 3, lambda = 8000)) simpf(5, 12, model.freq = NULL, modelsev)