Stick: Broken stick

dstickR Documentation

Broken stick

Description

dstick gives the probability mass function, pstick gives the cumulative mass function, qstick the quantile function, rstick randome number generation

Usage

dstick(x, r, log = FALSE)

pstick(q, r, lower.tail = TRUE, log = FALSE)

qstick(p, r, lower.tail = TRUE, log = FALSE)

rstick(n, r)

Arguments

x

vector of integers for which to return the probability

r

parameter of the broken stick model, see Details

log

logical, should the log probability be used

q

vector of integers for which to return the cumulative probability

lower.tail

logical, should the lower tail be used

p

vector of probabilities for which to return the quantile

n

number of random replicates

Details

These functions assume infinite support of the Broken stick model from [1, Inf). Parameter r corresponds roughly to the probability of dividing the resource, but really should be interpreted in terms of the underlying PMF: (1-r)^{x-1}r

Value

A numeric vector of length equal to the input

Author(s)

Andy Rominger <ajrominger@gmail.com>

See Also

fitSAD, dgeom

Examples


dstick(1:10, 0.5)


ajrominger/pika documentation built on Nov. 13, 2022, 8:22 a.m.