rightparetolognormal function

The Right-Pareto Lognormal distribution

The Right-Pareto Lognormal distribution

Density, distribution function, quantile function and random generation for the Right-Pareto Lognormal distribution.

drightparetolognormal( x, shape2 = 1.5, meanlog = -0.5, sdlog = 0.5, log = FALSE ) prightparetolognormal( q, shape2 = 1.5, meanlog = -0.5, sdlog = 0.5, lower.tail = TRUE, log.p = FALSE ) qrightparetolognormal( p, shape2 = 1.5, meanlog = -0.5, sdlog = 0.5, lower.tail = TRUE, log.p = FALSE ) mrightparetolognormal( r = 0, truncation = 0, shape2 = 1.5, meanlog = -0.5, sdlog = 0.5, lower.tail = TRUE ) rrightparetolognormal( n, shape2 = 1.5, meanlog = -0.5, sdlog = 0.5, lower.tail = TRUE )

Arguments

  • x, q: vector of quantiles
  • shape2, meanlog, sdlog: Shape, mean and variance of the Right-Pareto Lognormal distribution respectively.
  • log, log.p: logical; if TRUE, probabilities p are given as log(p).
  • lower.tail: logical; if TRUE (default), probabilities (moments) are P[Xx]P[X \le x] (E[xrXy])(E[x^r|X \le y]), otherwise, P[X>x]P[X > x] (E[xrX>y])(E[x^r|X > y])
  • p: vector of probabilities
  • r: rth raw moment of the Pareto distribution
  • truncation: lower truncation parameter, defaults to xmin
  • n: number of observations

Returns

drightparetolognormal gives the density, prightparetolognormal gives the distribution function, qrightparetolognormal gives the quantile function, mrightparetolognormal gives the rth moment of the distribution and rrightparetolognormal generates random deviates.

The length of the result is determined by n for rrightparetolognormal, and is the maximum of the lengths of the numerical arguments for the other functions.

Details

Probability and Cumulative Distribution Function as provided by if(!exists(".Rdpack.currefs")) .Rdpack.currefs <-new.env();Rdpack::insert_citeOnly(keys="reed2004double",package="distributionsrd",cached_env=.Rdpack.currefs) :

f(x)=shape2ωshape21eshape2meanlog+shape22sdlog22Φ(lnxmeanlogshape2sdlog2sdlog),FX(x)=Φ(lnxmeanlogsdlog)ωshape2eshape2meanlog+shape22sdlog22Φ(lnxmeanlogshape2sdlog2sdlog)f(x) = shape2 \omega^{-shape2-1}e^{shape2 meanlog + \frac{shape2^2sdlog^2}{2}}\Phi(\frac{lnx - meanlog - shape2 sdlog^2}{sdlog}), \newline F_X(x) = \Phi(\frac{lnx - meanlog }{sdlog}) - \omega^{-shape2}e^{shape2 meanlog + \frac{shape2^2sdlog^2}{2}}\Phi(\frac{lnx - meanlog - shape2 sdlog^2}{sdlog})

The y-bounded r-th raw moment of the Right-Pareto Lognormal distribution equals:

meanlogyr=shape2eshape2meanlog+shape22sdlog22yσsshape21σsshape21Φ(lnymeanlogshape2sdlog2sdlog)shape2rshape2er2sdlog2+2meanlogr2Φc(lnyrsdlog2+meanlogsdlog),shape2>rmeanlog^{r}_{y} = -shape2e^{shape2 meanlog + \frac{shape2^2sdlog^2}{2}}\frac{y^{\sigma_s - shape2-1}}{\sigma_s - shape2 - 1}\Phi(\frac{lny - meanlog - shape2 sdlog^2}{sdlog}) \newline \qquad - \frac{shape2}{r-shape2} e^{\frac{ r^2sdlog^2 + 2meanlog r }{2}}\Phi^c(\frac{lny - rsdlog^2 + meanlog}{sdlog}), \qquad shape2>r

Examples

## Right-Pareto Lognormal density plot(x = seq(0, 5, length.out = 100), y = drightparetolognormal(x = seq(0, 5, length.out = 100))) plot(x = seq(0, 5, length.out = 100), y = drightparetolognormal(x = seq(0, 5, length.out = 100), shape2 = 1)) ## Right-Pareto Lognormal relates to the Lognormal if the shape parameter goes to infinity prightparetolognormal(q = 6, shape2 = 1e20, meanlog = -0.5, sdlog = 0.5) plnorm(q = 6, meanlog = -0.5, sdlog = 0.5) ## Demonstration of log functionality for probability and quantile function qrightparetolognormal(prightparetolognormal(2, log.p = TRUE), log.p = TRUE) ## The zeroth truncated moment is equivalent to the probability function prightparetolognormal(2) mrightparetolognormal(truncation = 2) ## The (truncated) first moment is equivalent to the mean of a (truncated) random sample, #for large enough samples. x <- rrightparetolognormal(1e5, shape2 = 3) mean(x) mrightparetolognormal(r = 1, shape2 = 3, lower.tail = FALSE) sum(x[x > quantile(x, 0.1)]) / length(x) mrightparetolognormal(r = 1, shape2 = 3, truncation = quantile(x, 0.1), lower.tail = FALSE)

References

if(!exists(".Rdpack.currefs")) .Rdpack.currefs <-new.env();Rdpack::insert_all_ref(.Rdpack.currefs)

  • Maintainer: Ruben Dewitte
  • License: GPL-3
  • Last published: 2020-05-25

Useful links