dpower {sads}R Documentation

Power discrete distribution


Density, distribution function, quantile function and random generation for discrete version of power distribution with parameter s.


dpower( x, s, log=FALSE)
ppower( q, s, lower.tail=TRUE, log.p=FALSE)
qpower( p, s, lower.tail= TRUE, log.p=FALSE)
rpower( n, s)



vector of (integer x>0) quantiles. In the context of species abundance distributions, this is a vector of abundances of species in a sample.


vector of (integer x>0) quantiles. In the context of species abundance distributions, a vector of abundances of species in a sample.


number of random values to return.


vector of probabilities.


positive real s > 1; exponent of the power distribution.

log, log.p

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


logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x].


The power density is a discrete probability distribution defined for integer x > 0:

p(x) = x^(-s) / zeta (s)

Hence p(x) is proportional to a negative power of 'x', given by the 's' exponent. The Riemann's zeta function is the integration constant.

The power distribution can be used as a species abundance distribution (sad) model, which describes the probability of the abundance 'x' of a given species in a sample or assemblage of species.


dpower gives the (log) density of the density, ppower gives the (log) distribution function, qpower gives the quantile function.

Invalid values for parameter s will result in return values NaN, with a warning.


Paulo I Prado prado@ib.usp.br and Murilo Dantas Miranda.


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

See Also

dzeta in VGAM package; fitpower for maximum likelihood estimation in the context of species abundance distributions.


x <- 1:20
PDF <- dpower(x=x, s=2)
CDF <- ppower(q=x, s=2)
plot(x,CDF, ylab="Cumulative Probability", type="b",
     main="Power distribution, CDF")
plot(x,PDF, ylab="Probability", type="h",
     main="Power distribution, PDF")

## The power distribution is a discrete PDF, hence:
all.equal( ppower(10, s=2), sum(dpower(1:10, s=2)) ) # should be TRUE

## quantile is the inverse of CDF
all.equal(qpower(CDF, s=2), x) 

[Package sads version 0.4.2 Index]