# Risk and Ruin

## Introduction

This is the second in a four-part series on the actuar package for the R programming language.

## Risk Theory

Risk theory refers to a body of techniques to model and measure the risk

associated with a portfolio of insurance contracts. A first approach consists

in modeling the distribution of total claims over a fixed period of time using

the classical collective model of risk theory. A second input of interest to

the actuary is the evolution of the surplus of the insurance company over

many periods of time.

## Ruin Theory

In ruin theory, the main quantity of interest is the

probability that the surplus becomes negative, in which case technical ruin of

the insurance company occurs.^{1}

## The Collective Risk Model

Let random variable S represent the aggregate claim amount (or total amount

of claims) of a portfolio of independent risks over a ﬁxed period of time, random variable N represent the number of claims (or frequency) in the portfolio

over that period, and random variable Cj represent the amount of claim j (or

severity). Then, we have the random sum

S = C_{1} + … + C_{N}

where we assume that C1, C2, … are mutually independent and identically

distributed random variables each independent of N.

# Risk Functions

## discretize

Compute a discrete probability mass function from a continuous cumulative distribution function (cdf) with various methods `discretise` is an alias for `discretize`.

```
discretize(cdf, from, to, step = 1,
method = c("upper", "lower", "rounding", "unbiased"),
lev, by = step, xlim = NULL)
```

**cdf:**an expression written as a function of x, or alternatively the name of a function, giving the cdf to discretize.**from, to:**the range over which the function will be discretized.**step:**numeric; the discretization step (or span, or lag).**method:**discretization method to use (elaborated on below).**lev:**an expression written as a function of x, or alternatively the name of a function, to compute the limited expected value of the distribution corresponding to cdf. Used only with the "unbiased" method.**by:**an alias for step.**xlim:**numeric of length 2; if specified, it serves as default for c(from, to).

### Methods

Let F(x) denote the cdf of the distribution to discretize on some interval

(a, b) and f(x) denote the probability mass at x in the discretized distribution.

Upper discretization, or forward difference of F(x):

for x = a, a + h, … , b h. The discretized cdf is always above the true

cdf.

Lower discretization, or backward difference of F(x):

The discretized cdf is always under the true cdf.

Rounding of the random variable, or the midpoint method:

The true cdf passes exactly midway through the steps of the discretized

cdf.

Unbiased, or local matching of the ﬁrst moment method:

The discretized and the true distributions have the same total probability

and expected value on (a, b).

A graphical comparison of the four methods can be found here.

## aggregatedist

Compute the aggregate claim amount cumulative distribution function of a portfolio over a period using one of ﬁve methods.

```
aggregateDist(method = c("recursive", "convolution", "normal",
"npower", "simulation"),
model.freq = NULL, model.sev = NULL, p0 = NULL,
x.scale = 1, convolve = 0, moments, nb.simul, ...,
tol = 1e-06, maxit = 500, echo = FALSE)
## S3 method for class ’aggregateDist’
print(x, ...)
## S3 method for class ’aggregateDist’
plot(x, xlim, ylab = expression(F[S](x)),
main = "Aggregate Claim Amount Distribution",
sub = comment(x), ...)
## S3 method for class ’aggregateDist’
summary(object, ...)
## S3 method for class ’aggregateDist’
mean(x, ...)
## S3 method for class ’aggregateDist’
diff(x, ...)
```

Arguments:

**method:**method to be used**model.freq**: for "recursive" method: a character string giving the name of a distribution in the (a; b; 0) or (a; b; 1) families of distributions. For "convolution" method: a vector of claim number probabilities. For "simulation" method: a frequency simulation model (see simul for details) or NULL. Ignored with normal and npower methods.**model.sev**: for "recursive" and "convolution" methods: a vector of claim amount probabilities. For "simulation" method: a severity simulation model (see simul for details) or NULL. Ignored with normal and npower methods.**p0**: arbitrary probability at zero for the frequency distribution. Creates a zeromodiﬁed or zero-truncated distribution if not NULL. Used only with "recursive" method.**x.scale**: value of an amount of 1 in the severity model (monetary unit). Used only with "recursive" and "convolution" methods.**convolve:**number of times to convolve the resulting distribution with itself. Used only with "recursive" method.**moments:**vector of the true moments of the aggregate claim amount distribution; required only by the "normal" or "npower" methods.**nb.simul:**number of simulations for the "simulation" method.**…:**parameters of the frequency distribution for the "recursive" method; further arguments to be passed to or from other methods otherwise.**tol:**the resulting cumulative distribution in the "recursive" method will get less than tol away from 1.**maxit:**maximum number of recursions in the "recursive" method.**echo**: logical; echo the recursions to screen in the "recursive" method.**x, object:**an object of class "aggregateDist".**xlim:**numeric of length 2; the x limits of the plot.**ylab:**label of the y axis.**main:**main title.**sub:**subtitle, defaulting to the calculation method.