zinbinom {countreg}R Documentation

The Zero-Inflated Negative Binomial Distribution

Description

Density, distribution function, quantile function, random generation and score function for the zero-inflated negative binomial distribution with parameters mu (= mean of the uninflated distribution), dispersion parameter theta (or equivalently size), and inflation probability pi (for structural zeros).

Usage

dzinbinom(x, mu, theta, size, pi, log = FALSE)
pzinbinom(q, mu, theta, size, pi, lower.tail = TRUE, log.p = FALSE)
qzinbinom(p, mu, theta, size, pi, lower.tail = TRUE, log.p = FALSE)
rzinbinom(n, mu, theta, size, pi)
szinbinom(x, mu, theta, size, pi, parameter = c("mu", "theta", "pi"), drop = TRUE)

Arguments

x

vector of (non-negative integer) quantiles.

q

vector of quantiles.

p

vector of probabilities.

n

number of random values to return.

mu

vector of non-negative means of the uninflated negative binomial distribution.

theta, size

vector of strictly positive dispersion parameters (shape parameter of the gamma mixing distribution). Only one of theta or size must be specified.

pi

vector of zero inflation probabilities for structural zeros.

log, log.p

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

lower.tail

logical. If TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x].

parameter

character. Should the derivative with respect to "mu" and/or "theta" and/or "pi" be computed?

drop

logical. Should the result be a matrix (drop = FALSE) or should the dimension be dropped (drop = TRUE, the default)?

Details

The uninflated negative binomial distribution has density

Γ(x + θ)/(Γ(θ) x!) (μ^y θ^θ)/((μ + θ)^(y + θ)

for x = 0, 1, 2, …. The zero-inflated density is then simply obtained as

g(x) = π I(x = 0) + (1 - π) f(x)

where I is the indicator function (for the point mass at zero).

Value

dzinbinom gives the (log) density, pzinbinom gives the (log) distribution function, qzinbinom gives the quantile function, rzinbinom generates random deviates, and szinbinom gives the score function (= derivative of the log-density with respect to mu and/or theta and/or pi).

See Also

dnbinom, zeroinfl


[Package countreg version 0.2-1 Index]