Learn R Programming

zipfextR (version 1.0.2)

zipfpe: The Zipf-Poisson Extreme Distribution (Zipf-PE).

Description

Probability mass function, cumulative distribution function, quantile function and random number generation for the Zipf-PE distribution with parameters \(\alpha\) and \(\beta\). The support of the Zipf-PE distribution are the strictly positive integer numbers large or equal than one.

Usage

dzipfpe(x, alpha, beta, log = FALSE)

pzipfpe(q, alpha, beta, log.p = FALSE, lower.tail = TRUE)

qzipfpe(p, alpha, beta, log.p = FALSE, lower.tail = TRUE)

rzipfpe(n, alpha, beta)

Arguments

x, q

Vector of positive integer values.

alpha

Value of the \(\alpha\) parameter (\(\alpha > 1\) ).

beta

Value of the \(\beta\) parameter (\(\beta\in (-\infty, +\infty)\) ).

log, log.p

Logical; if TRUE, probabilities p are given as log(p).

lower.tail

Logical; if TRUE (default), probabilities are \(P[X \leq x]\), otherwise, \(P[X > x]\).

p

Vector of probabilities.

n

Number of random values to return.

Value

dzipfpe gives the probability mass function, pzipfpe gives the cumulative function, qzipfpe gives the quantile function, and rzipfpe generates random values from a Zipf-PE distribution.

Details

The probability mass function of the Zipf-PE distribution with parameters \(\alpha\) and \(\beta\) at a positive integer value \(x\) is computed as follows:

$$p(x | \alpha, \beta) = \frac{e^{\beta (1 - \frac{\zeta(\alpha, x)}{\zeta(\alpha)})} (e^{\beta \frac{x^{-\alpha}}{\zeta(\alpha)}} - 1)} {e^{\beta} - 1},\, x= 1,2,...,\, \alpha > 1,\, -\infty < \beta < +\infty,$$

where \(\zeta(\alpha)\) is the Riemann-zeta function at \(\alpha\), and \(\zeta(\alpha, x)\) is the Hurtwitz zeta function with arguments \(\alpha\) and x.

The cumulative distribution function at a given positive integer value \(x\), \(F(x)\), is equal to: $$F(x) = \frac{e^{\beta (1 - \frac{\zeta(\alpha, x + 1)}{\zeta(\alpha)})} - 1}{e^{\beta} -1}$$

The quantile of the Zipf-PE\((\alpha, \beta)\) distribution of a given probability value p is equal to the quantile of the Zipf\((\alpha)\) distribution at the value:

$$p\prime = \frac{log(p\, (e^{\beta} - 1) + 1)}{\beta}$$ The quantiles of the Zipf\((\alpha)\) distribution are computed by means of the tolerance package.

To generate random data from a Zipf-PE one applies the quantile function over n values randomly generated from an Uniform distribution in the interval (0, 1).

References

Young, D. S. (2010). Tolerance: an R package for estimating tolerance intervals. Journal of Statistical Software, 36(5), 1-39.

Examples

Run this code
# NOT RUN {
dzipfpe(1:10, 2.5, -1.5)
pzipfpe(1:10, 2.5, -1.5)
qzipfpe(0.56, 2.5, 1.3)
rzipfpe(10, 2.5, 1.3)

# }

Run the code above in your browser using DataLab