Distributions: Bounded and unbounded power-law distributions

DistributionsR Documentation

Bounded and unbounded power-law distributions

Description

For the unbounded and bounded power-law distributions (PL and PLB respectively), probability density function (dPL and dPLB), cumulative distribution function P(X <= x) (pPL and pPLB), and random generation of values (rPL and rPLB), with exponent b, minimum xmin and maximum (for bounded distribution) xmax as described in Edwards et al. (2017, Methods in Ecology and Evolution, 8:57-67). Random generation uses the inverse method (e.g. p1215 of Edwards 2008, Journal of Animal Ecology, 77:1212-1222). qPLB from inverting the cumulative distribution function (to be written up). Unbounded distribution included for completeness (except no qPL) but is not used in remaining code.

Usage

dPL(x = 1, b = -2, xmin = 1)

pPL(x = 10, b = -2, xmin = 1)

rPL(n = 1, b = -2, xmin = 1)

dPLB(x = 1, b = -2, xmin = 1, xmax = 100)

pPLB(x = 10, b = -2, xmin = 1, xmax = 100)

rPLB(n = 1, b = -2, xmin = 1, xmax = 100)

qPLB(p = 0.1, b = -2, xmin = 1, xmax = 100)

Arguments

x

vector of values to compute the density and distribution functions.

b

exponent of the distribution (must be <-1 for unbounded)

xmin

minimum bound of the distribution, xmin > 0

n

number of random numbers to be generated (if length(n) > 1 then generate length(n) values)

xmax

maximum bound for bounded distribution, xmax > xmin

p

vector of probabilities for qPLB()

Value

dPL and dPLB return vector of probability density values corresponding to x. pPL and pPLB return vector of cumulative distribution values P(X <= x) corresponding to x. rPL and rPLB return a vector (of length n) of independent random draws from the distribution. qPLB returns vector of values of x for which P(X <= x) = p (each element corresponding to the element of p). So pPLB(qPLB(seq(0, 1, by = 0.1))) gives ⁠0, 0.1, ..., 1⁠.


andrew-edwards/sizeSpectra documentation built on June 28, 2023, 7:09 p.m.