Learn R Programming

sads (version 0.2.2)

dmand: Zipf-Mandelbrodt distribution

Description

Density, distribution function and quantile function for Zipf-Mandelbrodt distribution with parameters N s and v.

Usage

dmand( x, N, s, v, log=FALSE)
pmand( q, N, s, v, lower.tail=TRUE, log.p=FALSE)
qmand( p, N, s, v, lower.tail = TRUE, log.p = FALSE)

Arguments

x
vector of (non-negative integer) quantiles. In the context of species abundance distributions, this is a vector of abundance ranks of species in a sample.
q
vector of (non-negative integer) quantiles. In the context of species abundance distributions, a vector of abundance ranks of species in a sample.
p
vector of probabilities.
N
positive integer 0 < N < Inf, total number of elements of a collection. In the context of species abundance distributions, usually the number of species in a sample.
s
positive real s > 0; Zipf-Mandelbrodt exponent.
v
positive real or zero v >= 0; Zipf-Mandelbrodt parameter.
log, log.p
logical; if TRUE, probabilities p are given as log(p).
lower.tail
logical; if TRUE (default), probabilities are P[X <= x],="" otherwise,="" p[x=""> x].

Value

  • dmand gives the (log) density of the density, pmand gives the (log) distribution function, qmand gives the quantile function.

    Invalid values for parameters v or s will result in return values NaN, with a warning.

Details

The Mandelbrodt distribution describes the probability or frequency of occurrence of a given element from a set of N elements. This probability is inversely proportional to a power s of the rank of the frequency of the element in the set. The density function is

$$p(x) = \frac{(x+v)^{-s}}{\sum_{i=1}^N (i+v)^{-s}}$$

Since p(x) is proportional to a power of x, the Zipf-Mandelbrodt distribution is a power distribution. The Zipf distribution is a special case when v=0. Hence, the Zipf-Mandelbrodt distribution is a generalization of the Zipf Law, and is widely used in the [x] for the same purposes. In Ecology, it can be used to describe the probability of the abundance rank x of given species in a sample or assemblage of N species.

References

Johnson N.L., Kemp, A.W. and Kotz S. 2005. Univariate Discrete Distributions, 3rd edition, Hoboken, New Jersey: Wiley. Section 11.2.20.

Magurran, A.E. and McGill, B.J. 2011. Biological Diversity - Frontiers in measurement and assessment. Oxford: Oxford University Press.

See Also

dmand and rmand and related functions in mandR package; Zeta for zeta distribution in VGAM package.

Examples

Run this code
x <- 1:100
PDF <- dmand(x=x, N=100, s=1.5, v=2)
CDF <- pmand(q=x, N=100, s=1.5, v=2)
par(mfrow=c(1,2))
plot(x,CDF, ylab="Cumulative Probability", type="b",
     main="Zipf-Mandelbrodt distribution, CDF")
plot(x,PDF, ylab="Probability", type="h",
     main="Zipf-Mandelbrodt distribution, PDF")
par(mfrow=c(1,1))

## quantile is the inverse of CDF
all.equal( qmand(p=CDF, N=100, s=1.5, v=2), x)

## Zipf distribution is a particular case of ZM when v=0
all.equal( dmand(x=x, N=100, s=1.5, v=0), dzipf(x=x, N=100, s=1.5) )

Run the code above in your browser using DataLab