invpareto {distributionsrd}R Documentation

The Inverse Pareto distribution

Description

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

Usage

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 \le x] (E[x^r|X \le y]), otherwise, P[X > x] (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

Details

Probability and Cumulative Distribution Function:

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:

\mu^r_y =k\omega_{max}^{-k}\frac{\omega_{max}^{r+k}- y^{r+k}}{r+k}

Value

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.

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)

[Package distributionsrd version 0.0.6 Index]