Density, distribution function, quantile function, raw moments and random generation for the Pareto distribution.
dpareto(x, k =2, xmin =1, log =FALSE, na.rm =FALSE)ppareto(q, k =2, xmin =1, lower.tail =TRUE, log.p =FALSE, na.rm =FALSE)qpareto(p, k =2, xmin =1, lower.tail =TRUE, log.p =FALSE)mpareto(r =0, truncation = xmin, k =2, xmin =1, lower.tail =TRUE)rpareto(n, k =2, xmin =1)
Arguments
x, q: vector of quantiles
xmin, k: Scale and shape of the Pareto distribution, defaults to 1 and 2 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 Pareto distribution
truncation: lower truncation parameter, defaults to xmin
n: number of observations
Returns
dpareto returns the density, ppareto the distribution function, qpareto the quantile function, mpareto the rth moment of the distribution and rpareto generates random deviates.
The length of the result is determined by n for rpareto, and is the maximum of the lengths of the numerical arguments for the other functions.
Details
Probability and Cumulative Distribution Function:
f(x)=xk+1kxmink,FX(x)=1−(xxmin)k
The y-bounded r-th raw moment of the Pareto distribution equals:
μyr=kxminkr−k−yr−k,k>r
Examples
## Pareto densityplot(x = seq(1,5, length.out =100), y = dpareto(x = seq(1,5, length.out =100), k =2, xmin =1))## Pareto relates to the exponential distribution available in the stats packageppareto(q =5, k =2, xmin =3)pexp(q = log(5/3), rate =2)## Demonstration of log functionality for probability and quantile functionqpareto(ppareto(2, log.p =TRUE), log.p =TRUE)## The zeroth truncated moment is equivalent to the probability functionppareto(2)mpareto(truncation =2)## The (truncated) first moment is equivalent to the mean of a (truncated) random sample,#for large enough samples.x <- rpareto(1e5)mean(x)mpareto(r =1, lower.tail =FALSE)sum(x[x > quantile(x,0.1)])/ length(x)mpareto(r =1, truncation = quantile(x,0.1), lower.tail =FALSE)