TNegBinom: Truncated negative binomial distribuiton

dtnegbR Documentation

Truncated negative binomial distribuiton

Description

dptnegb gives the probability mass function, ptnegb gives the cumulative mass function, qtnegb the quantile function, rtnegb randome number generation

Usage

dtnegb(x, mu, k, log = FALSE)

ptnegb(q, mu, k, lower.tail = TRUE, log = FALSE)

qtnegb(p, mu, k, lower.tail = TRUE, log = FALSE)

rtnegb(n, mu, k)

Arguments

x

vector of integers for which to return the probability

mu

mean abundance

k

dispersion parameter

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 truncated negative binomial from [1, Inf). The parameterization uses the mean of the untruncated distribution (μ) and the dispersion (k). This relates to a Gamma-Poisson mixture as trunNB(x; μ, k) = \int_0^{\inf} trunPois(x; λ) Gamma(λ; k, k/μ).

Value

A numeric vector of length equal to the input

Author(s)

Andy Rominger <ajrominger@gmail.com>

See Also

dnbinom

Examples


dtnegb(1:10, 0.5, 2)


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