Learn R Programming

actuar (version 0.1-3)

simpf: Simulation of a portfolio of data

Description

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.

Usage

simpf(contracts, years, model.freq, model.sev, weights)

Arguments

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

Value

  • A list with two components:
  • dataa 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
  • weightsthe matrix of weights given in argument, or a matrix of 1 otherwise.

Details

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: [object Object],[object Object],[object Object],[object Object]

References

Goulet, V. (2006), Credibility for severity revisited, North American Actuarial Journal, to appear.

See Also

rearrangepf

Examples

Run this code
## 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)

Run the code above in your browser using DataLab