Splice {ReIns} | R Documentation |
Spliced distribution
Description
Density, distribution function, quantile function and random generation for the fitted spliced distribution.
Usage
dSplice(x, splicefit, log = FALSE)
pSplice(x, splicefit, lower.tail = TRUE, log.p = FALSE)
qSplice(p, splicefit, lower.tail = TRUE, log.p = FALSE)
rSplice(n, splicefit)
Arguments
x |
Vector of points to evaluate the CDF or PDF in. |
p |
Vector of probabilities. |
n |
Number of observations. |
splicefit |
A |
log |
Logical indicating if the densities are given as |
lower.tail |
Logical indicating if the probabilities are of the form |
log.p |
Logical indicating if the probabilities are given as |
Details
See Reynkens et al. (2017) and Section 4.3 in Albrecher et al. (2017) for details.
Value
dSplice
gives the density function evaluated in x
, pSplice
the CDF evaluated in x
and qSplice
the quantile function evaluated in p
. The length of the result is equal to the length of x
or p
.
rSplice
returns a random sample of length n
.
Author(s)
Tom Reynkens with R
code from Roel Verbelen for the mixed Erlang PDF, CDF and quantiles.
References
Albrecher, H., Beirlant, J. and Teugels, J. (2017). Reinsurance: Actuarial and Statistical Aspects, Wiley, Chichester.
Reynkens, T., Verbelen, R., Beirlant, J. and Antonio, K. (2017). "Modelling Censored Losses Using Splicing: a Global Fit Strategy With Mixed Erlang and Extreme Value Distributions". Insurance: Mathematics and Economics, 77, 65–77.
Verbelen, R., Gong, L., Antonio, K., Badescu, A. and Lin, S. (2015). "Fitting Mixtures of Erlangs to Censored and Truncated Data Using the EM Algorithm." Astin Bulletin, 45, 729–758.
See Also
VaR
, SpliceFit
, SpliceFitPareto
, SpliceFiticPareto
, SpliceFitGPD
,
SpliceECDF
, SpliceLL
, SplicePP
Examples
## Not run:
# Pareto random sample
X <- rpareto(1000, shape = 2)
# Splice ME and Pareto
splicefit <- SpliceFitPareto(X, 0.6)
x <- seq(0, 20, 0.01)
# Plot of spliced CDF
plot(x, pSplice(x, splicefit), type="l", xlab="x", ylab="F(x)")
# Plot of spliced PDF
plot(x, dSplice(x, splicefit), type="l", xlab="x", ylab="f(x)")
p <- seq(0, 1, 0.01)
# Plot of splicing quantiles
plot(p, qSplice(p, splicefit), type="l", xlab="p", ylab="Q(p)")
# Plot of VaR
plot(p, VaR(p, splicefit), type="l", xlab="p", ylab=bquote(VaR[p]))
# Random sample from spliced distribution
x <- rSplice(1000, splicefit)
## End(Not run)