Title: | Measures of Risk for the Compound Poisson Risk Process with Diffusion |
---|---|
Description: | Based on the compound Poisson risk process that is perturbed by a Brownian motion, saddlepoint approximations to some measures of risk are provided. Various approximation methods for the probability of ruin are also included. Furthermore, exact values of both the risk measures as well as the probability of ruin are available if the individual claims follow a hypo-exponential distribution (i. e., if it can be represented as a sum of independent exponentially distributed random variables with different rate parameters). For more details see Gatto and Baumgartner (2014) <doi:10.1007/s11009-012-9316-5>. |
Authors: | Benjamin Baumgartner [aut, cre], Riccardo Gatto [ctb, ths], Sebastian Szugat [ctb] |
Maintainer: | Benjamin Baumgartner <[email protected]> |
License: | AGPL-3 |
Version: | 1.1-6 |
Built: | 2024-10-31 18:35:30 UTC |
Source: | https://github.com/cran/sdprisk |
Returns the adjustment coefficient of a risk process with Gaussian diffusion.
adjcoef(process)
adjcoef(process)
process |
An object of the class |
The moment-generating function of the individual claim amounts is required
to be contained within the "claiminfo"
element of process
(see
claiminfo
). The only exception to this is the case of
hypo-exponentially distributed claim amounts.
The adjustment coefficient of the risk process represented by
process
. If the adjustment coefficient does not exist or cannot be
computed for any reason, NULL
is returned instead.
riskproc
and claiminfo
for more details on how
to provide the information necessary to compute the adjustment coefficient.
## Setting up a risk process with hypo-exponentially distributed claims myprocess <- riskproc( claims = claiminfo(hypoexp = list(rates = c(1, 10))), premium = 2, freq = 1, variance = 0.4 ) ## Return the adjustment coefficient adjcoef(myprocess)
## Setting up a risk process with hypo-exponentially distributed claims myprocess <- riskproc( claims = claiminfo(hypoexp = list(rates = c(1, 10))), premium = 2, freq = 1, variance = 0.4 ) ## Return the adjustment coefficient adjcoef(myprocess)
Creates or tests for claim information objects.
claiminfo(...) is.claiminfo(x) is.hypoexp(x)
claiminfo(...) is.claiminfo(x) is.hypoexp(x)
x |
An R object |
... |
various objects determining the individual claim amount distribution. Refer to the details section. |
Typicall usages are:
claiminfo(mgf, mgf.d1, mgf.d2, pdf, cdf, mean)
To be completed.
claiminfo
returns an object of the class "claiminfo"
(see
details section).
is.claiminfo
returns TRUE
if x
is a "claiminfo"
object, and FALSE
otherwise.
is.hypoexp
returns TRUE
if x
is a "claiminfo"
object describing hypo-exponentially distributed individual claim amounts
(see dhypoexp), and FALSE
otherwise. If x
is a
riskproc
object, the function is applied to the
"claiminfo"
object contained within it.
To be completed.
## For hypo-exponentially distribution claim amounts claiminfo(hypoexp = list(rates = c(1, 10))) ## A more complicated example ## Not run: claiminfo()
## For hypo-exponentially distribution claim amounts claiminfo(hypoexp = list(rates = c(1, 10))) ## A more complicated example ## Not run: claiminfo()
Density, distribution function, quantile function, random generation and
moment-generating function (and its first two derivatives) for the
hypo-exponential distribution with rates rate
.
dhypoexp(x, rate = 1, log = FALSE) phypoexp(q, rate = 1, lower.tail = TRUE, log.p = FALSE, tailarea = FALSE) qhypoexp(p, rate, interval = c(0.0, 1.0e+10)) rhypoexp(n = 1, rate = 1) mgfhypoexp(x, rate = 1, difforder = 0)
dhypoexp(x, rate = 1, log = FALSE) phypoexp(q, rate = 1, lower.tail = TRUE, log.p = FALSE, tailarea = FALSE) qhypoexp(p, rate, interval = c(0.0, 1.0e+10)) rhypoexp(n = 1, rate = 1) mgfhypoexp(x, rate = 1, difforder = 0)
x , q
|
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. If |
difforder |
the order of derivative for the moment-generating function; currently only implemented for 0, 1, 2. |
rate |
vector of (unique) rates. |
lower.tail |
logical; if |
log , log.p
|
logical; if |
tailarea |
logical; if |
interval |
Passed to |
The sum of independent exponentially distributed random variables
with rate parameters
has a hypo-exponential
distribution with rate vector
.
The hypo-exponential distribution is a generalization of the Erlang distribution (a Gamma distribution with an integer-valued shape parameter) and a special case of the phase-type distribution (see References section).
The quantile function is computed by numeric inversion (using
uniroot
).
dhypoexp
gives the density, phypoexp
gives the distribution
function (or the integrated tail area distribution function),
qhypoexp
gives the quantile function, rhypoexp
generates
random deviates and mgfhypoexp
gives the moment-generating function
(or its derivative up to the second order).
If length(rate) == 1
, dhypoexp
, phypoexp
and
rhypoexp
are equivalent to dexp
,
pexp
and rexp
with rate parameter
rate
and should, in fact, be replaced by the latter ones for
computation speed.
Neuts, M. F. (1981) Matrix-Geometric Solutions in Stochastic Models: An Algorithmic Approach, reprinted and corrected.
## Random generation rhypoexp(10, c(3, 5)) ## Mean mu <- mgfhypoexp(0, c(3, 5), difforder = 1) ## Variance mgfhypoexp(0, c(3, 5), difforder = 2) - mu^2 ## Quantile qhypoexp(0.5, c(3, 5))
## Random generation rhypoexp(10, c(3, 5)) ## Mean mu <- mgfhypoexp(0, c(3, 5), difforder = 1) ## Variance mgfhypoexp(0, c(3, 5), difforder = 2) - mu^2 ## Quantile qhypoexp(0.5, c(3, 5))
Creates an R object representing a compound Poisson risk process with Gaussian diffusion, which contains some or all information necessary for further processing.
riskproc(claims, premium, freq, variance) is.riskproc(x)
riskproc(claims, premium, freq, variance) is.riskproc(x)
claims |
a claiminfo object. |
premium |
premium rate. |
freq |
claim frequency. |
variance |
squared volatility of the Wiener component; currently only
implemented for |
x |
an R object. |
Given the arguments, most prominently claims
, various auxialiary parameters and
functions associated with the risk process to be represented are calculated.
riskproc
returns an object of the class "riskproc"
.
Internally, this is a list containing various elements (depending on the
information provided in the arguments).
is.riskproc
returns TRUE
if x
is a "riskproc"
object, and FALSE
otherwise.
claiminfo
for more details about passing on information about
the distribution of the individual claim amounts.
## A risk process with hypo-exponentially distributed individual claim amounts riskproc( claims = claiminfo(hypoexp = list(rates = c(1, 10))), premium = 2, freq = 1, variance = 0.4 )
## A risk process with hypo-exponentially distributed individual claim amounts riskproc( claims = claiminfo(hypoexp = list(rates = c(1, 10))), premium = 2, freq = 1, variance = 0.4 )
This functions provide various approximation methods for the (total) probability of ruin, the probability of ruin due to oscillation and the probability of ruin due to a claim. Exact calculations are possible in the case of hypo-exponentially distrubuted claim amounts.
ruinprob(process, method = c("saddlepoint", "fft", "bounds", "hypoexp", "lundberg"), ...) boundsRuinprob(process, interval, maxreserve, richardson = TRUE, use.splines = FALSE) fftRuinprob(process, interval, maxreserve, n, use.splines = FALSE) hypoexpRuinprob(process) saddlepointRuinprob(process, jensen = FALSE, normalize = TRUE)
ruinprob(process, method = c("saddlepoint", "fft", "bounds", "hypoexp", "lundberg"), ...) boundsRuinprob(process, interval, maxreserve, richardson = TRUE, use.splines = FALSE) fftRuinprob(process, interval, maxreserve, n, use.splines = FALSE) hypoexpRuinprob(process) saddlepointRuinprob(process, jensen = FALSE, normalize = TRUE)
process |
a |
method |
character string indicating the method used for approximation or calculation. |
interval |
interval width for the discretization of the claim distribution. |
maxreserve |
maximal value of the initial reserve for which the approximation can be calculated. |
n |
Length of the probability vectors resulting from the discretization. |
richardson |
logical; if |
use.splines |
logical; if |
jensen |
logical; if |
normalize |
logical; if |
... |
further arguments that are passed on to |
ruinprob
is a wrapper function for the other ones given here.
psi |
the total probability of ruin (as a function of the initial reserve). |
psi.1 |
the probability of ruin due to oscillation (as a function of the initial reserve). |
psi.2 |
the probability of ruin due to a claim (as a function of the initial reserve). |
... |
Daniels, H. E. (1954) Saddlepoint Approximations in Statistics. Annals of Mathematical Statistics 25(4), pp. 631–650.
Gatto, R. and Mosimann, M. (2012) Four Approaches to Compute the Probability of Ruin in the Compound Poisson Risk Process with Diffusion. Mathematical and Computer Modelling 55(3–4), pp. 1169–1185
Jensen, J. L. (1992) The Modified Signed Likelihood Statistic and Saddlepoint Approximations. Biometrika 79(4), pp. 693–703.
Lugannani, R. and Rice, S. (1980) Saddle Point Approximation for the Distribution of the Sum of Independent Random Variables. Advances in Applied Probability 12(2), pp. 475–490.
The sensitivities of both the value and the tail value at ruin are defined as their respective derivatives with respect to the probability level.
sensitivity(process, method = c("saddlepoint", "hypoexp"), ...) hypoexpSensitivity(process) saddlepointSensitivity(process, ...)
sensitivity(process, method = c("saddlepoint", "hypoexp"), ...) hypoexpSensitivity(process) saddlepointSensitivity(process, ...)
process |
a riskproc object. |
method |
character string indicating the calculation or approximation method. |
... |
further arguments that are passed on to
|
varu |
a function returning the sensitivity of the value at ruin. |
tvaru |
a function returning the sensitivity of the tail value at ruin. |
The tail value at ruin for a given probability level
is defined as the conditional expectation of the
maximal aggregate loss given that it is above the value at ruin of level
.
tvaru(process, method = c("saddlepoint", "hypoexp"), ...) hypoexpTvaru(process) saddlepointTvaru(process, type = c("tail", "density"), ...)
tvaru(process, method = c("saddlepoint", "hypoexp"), ...) hypoexpTvaru(process) saddlepointTvaru(process, type = c("tail", "density"), ...)
process |
a |
method |
character string indicating the calculation or approximation method. |
type |
character string indicating which function is to be used for the approximation. |
... |
further arguments that are passed on to
|
tvaru
is a wrapper function for hypoexpTvaru
and
saddlepointTvaru
.
hypoexpTvaru
calculates the tail value at ruin in the case of
hypo-exponentially distributed claim amounts by numerical integration of the
probability of ruin, which can be computed exactly.
saddlepointTvaru
uses saddlepoint techniques for the approximation of
the tail value at ruin. More precisely, the saddlepoint approximation to
the probability of is numerically integrated in the frequency domain, and
implicitly also the saddlepoint approximation to the value at ruin (see
varu
) is used. If type = "tail"
the integrand is the
probability of ruin (as function in the frequency domain), otherwise
(type = "density"
) it is essentially a re-scaled version of the
probability of ruin due to claims. The former requires fewer calculations
and seems to produce slightly more accurate results.
A function returning the tail value at ruin of a given probability level is returned.
If method = "saddlepoint"
or if saddlepointTvaru
is used, the
returned function has an additional second argument giving the number of
iterations used for the approximation of the value at ruin (i. e., the lower
integration limit), see varu
.
The value at ruin at a given probability level
is defined as the minimal capital that is required in order to have a ruin
probability of at most
. This is equivalent to
the
-quantile of the maximal aggregate
loss.
varu(process, method = c("saddlepoint", "hypoexp"), ...) hypoexpVaru(process) saddlepointVaru(process, type = 2)
varu(process, method = c("saddlepoint", "hypoexp"), ...) hypoexpVaru(process) saddlepointVaru(process, type = 2)
process |
a |
method |
character string indicating the calculation or approximation method. |
type |
number indicating the type of approximation; possible choices are 1 and 2. |
... |
further arguments that are passed on to |
varu
is a wrapper function for hypoexpVaru
and
saddlepointVaru
.
hypoexpVaru
calculates the value at ruin in the case of
hypo-exponentially distributed claim amounts by numerical inversion of the
probability of ruin, which can be computed exactly.
saddlepointVaru
uses saddlepoint techniques for the approximation of
the value at ruin, more specifically, the inversion algorithms provided by
Wang (1995). The first one (type = 1
) is only given for
completeness (or comparison purposes), because, due to repeatedly switching
back and forth between the monetary domain the frequency (saddlepoint)
domain, it is much slower than the second one (type = 2
), which is
performed entirely in the frequency domain. Refer to the references given
below for more details.
A function returning the value at ruin of a given probability level is returned.
If method = "saddlepoint"
or if saddlepointVaru
is used, the
returned function has an additional second argument giving the number of
iterations.
Wang, Suojin (1995) One-Step Saddlepoint Approximations for Quantiles. Computational Statistics and Data Analysis 20(1), pp. 65–74.