Learn R Programming

glmmTMB (version 1.1.15.2)

dcombinom: The Conway-Maxwell-Binomial Distribution

Description

Density and cumulative distribution function for the Conway-Maxwell-Binomial (CMB) distribution, parameterized by the mean.

Usage

dcombinom(x, size, mu, nu, log = FALSE)

pcombinom(q, size, mu, nu, lower.tail = TRUE, log.p = FALSE)

Value

dcombinom gives the density; pcombinom gives the cumulative distribution function.

Arguments

x

vector of quantiles (non-negative integers \(\le\) size).

size

vector of numbers of trials.

mu

vector of means (of the count, i.e. \(0 < \mu <\) size).

nu

vector of dispersion parameters; \(\nu = 1\) recovers the binomial distribution, \(\nu > 1\) gives under-dispersion, \(0 < \nu < 1\) over-dispersion, and \(\nu < 0\) super-dispersion (see allow_negative_nu in combinomial).

log

logical; if TRUE the log-density is returned.

q

vector of quantiles.

lower.tail

logical; if TRUE (default), probabilities are \(P(X \le q)\).

log.p

logical; if TRUE probabilities are returned on the log scale.

Details

The CMB distribution (Shmueli et al. 2005; Kadane 2016) has probability mass function $$P(X = x) = \binom{n}{x}^{\nu} p^{x} (1-p)^{n-x} / Z(p, \nu, n)$$ for \(x = 0, 1, \ldots, n\), where \(Z\) normalizes over the support. Following the mean parameterization used by the combinomial family (cf. Huang 2017), mu is the mean count; the natural parameter \(p\) is recovered internally by solving \(E[X \mid n, p, \nu] = \mu\).

References

Shmueli, G., Minka, T. P., Kadane, J. B., Borle, S., Boatwright, P. (2005). A useful distribution for fitting discrete data: revival of the Conway-Maxwell-Poisson distribution. Journal of the Royal Statistical Society C 54(1):127--142.

Kadane, J. B. (2016). Sums of possibly associated Bernoulli variables: the Conway-Maxwell-Binomial distribution. Bayesian Analysis 11(2):403--420.

See Also

combinomial for the CMB family in glmmTMB; Distributions for other standard distributions, including dbinom for the binomial distribution.

Examples

Run this code
## nu = 1 recovers the binomial
all.equal(dcombinom(0:6, size = 6, mu = 3, nu = 1),
          dbinom(0:6, size = 6, prob = 0.5))
pcombinom(0:6, size = 6, mu = 3, nu = 0.5)

Run the code above in your browser using DataLab