Custom severity from your own distribution function
custom_distribution.RdThe slow path for a distribution the package does not have: give its
cdf, and its quantile function if you have one (sampling inverts the
cdf by bisection otherwise, about a hundred cdf calls per draw). The
mean, variance, limited expected values and layer moments are computed
by Gauss-Legendre quadrature of the survival function between the
distribution's own quantiles, ignoring the probability above the
1 - 1e-12 quantile. It goes anywhere a severity does (layers,
compound_distribution(), simulate_events(), copula marginals,
mixture_distribution()); calculations that meet one run
single-threaded on R's main thread, since every value calls back into R.
Value
A custom_distribution object, which inherits from
distribution. Construction fails if a function errors, returns a
value out of range, or the cdf never reaches 1 - 1e-12.
Details
Properties: d@name, d@has_quantile, d@upper (the 1 - 1e-12
quantile, where the integrals stop) and d@last_error (the first error a
function raised after construction, or ""; that value became NaN).
Supports the same operations as pareto.