Learn R Programming

emdbook (version 1.3.13)

dzinbinom: Zero-inflated negative binomial distribution

Description

Probability distribution function and random variate generation for the zero-inflated negative binomial distribution

Usage

dzinbinom(x, mu, size, zprob, log=FALSE)
rzinbinom(n, mu, size, zprob)

Value

Probabilities of x or random deviates.

Arguments

x

vector of integer values

n

number of values to draw

mu

mean parameter (or vector of parameters) of negative binomial

size

number of trials/overdispersion parameter (or vector of parameters) of negative binomial

zprob

probability of structural zeros

log

return log probability?

Author

Ben Bolker

Details

The zero-inflated negative binomial distribution is widely used to model extra zero counts in count data that otherwise follows a negative binomial distribution. The probability distribution is $$ p(0) =p_z + (1-p_z) NB(0,mu,k)$$ and $$ p(x) =(1-p_z) NB(x,mu,k)$$ for \(x>0\).

References

Tyre et al., "Improving precision and reducing bias in biological surveys: estimating false-negative error rates", Ecological Applications 13:1790-1801 (2003)

See Also

dnbinom, Simon Jackman's pscl package

Examples

Run this code
dzinbinom(0:9,mu=2,zprob=0.3,size=0.9)
dnbinom(0:9,mu=2,size=0.9)
rzinbinom(10,mu=2,zprob=0.3,size=0.9)

Run the code above in your browser using DataLab