invpareto function

The Inverse Pareto distribution

The Inverse Pareto distribution

Density, distribution function, quantile function, raw moments and random generation for the Pareto distribution.

dinvpareto(x, k = 1.5, xmax = 5, log = FALSE, na.rm = FALSE) pinvpareto( q, k = 1.5, xmax = 5, lower.tail = TRUE, log.p = FALSE, log = FALSE, na.rm = FALSE ) qinvpareto(p, k = 1.5, xmax = 5, lower.tail = TRUE, log.p = FALSE) minvpareto(r = 0, truncation = 0, k = 1.5, xmax = 5, lower.tail = TRUE) rinvpareto(n, k = 1.5, xmax = 5)

Arguments

  • x, q: vector of quantiles
  • xmax, k: Scale and shape of the Inverse Pareto distribution, defaults to 5 and 1.5 respectively.
  • log, log.p: logical; if TRUE, probabilities p are given as log(p).
  • na.rm: Removes values that fall outside the support of the distribution
  • 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 Inverse Pareto distribution
  • truncation: lower truncation parameter, defaults to xmin
  • n: number of observations

Returns

dinvpareto returns the density, pinvpareto the distribution function, qinvpareto the quantile function, minvpareto the rth moment of the distribution and rinvpareto generates random deviates.

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

Details

Probability and Cumulative Distribution Function:

f(x)=kxmaxkxk+1,FX(x)=(xmaxx)k f(x) =\frac{k x_{max}^{-k}}{x^{-k+1}}, \qquad F_X(x) = (\frac{x_{max} }{x})^{-k}

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

μyr=kωmaxkωmaxr+kyr+kr+k \mu^r_y =k\omega_{max}^{-k}\frac{\omega_{max}^{r+k}- y^{r+k}}{r+k}

Examples

## Inverse invpareto density plot(x = seq(0, 5, length.out = 100), y = dinvpareto(x = seq(0, 5, length.out = 100))) ## Demonstration of log functionality for probability and quantile function qinvpareto(pinvpareto(2, log.p = TRUE), log.p = TRUE) ## The zeroth truncated moment is equivalent to the probability function pinvpareto(2) minvpareto(truncation = 2) ## The (truncated) first moment is equivalent to the mean of a (truncated) random sample, #for large enough samples. x <- rinvpareto(1e5) mean(x) minvpareto(r = 1, lower.tail = FALSE) sum(x[x > quantile(x, 0.1)]) / length(x) minvpareto(r = 1, truncation = quantile(x, 0.1), lower.tail = FALSE)
  • Maintainer: Ruben Dewitte
  • License: GPL-3
  • Last published: 2020-05-25

Useful links