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[X≤x](E[xr∣X≤y]), otherwise, P[X>x](E[xr∣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)=x−k+1kxmax−k,FX(x)=(xxmax)−k
The y-bounded r-th raw moment of the Inverse Pareto distribution equals:
μyr=kωmax−kr+kωmaxr+k−yr+k
Examples
## Inverse invpareto densityplot(x = seq(0,5, length.out =100), y = dinvpareto(x = seq(0,5, length.out =100)))## Demonstration of log functionality for probability and quantile functionqinvpareto(pinvpareto(2, log.p =TRUE), log.p =TRUE)## The zeroth truncated moment is equivalent to the probability functionpinvpareto(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)