Repository navigation
Expand file tree
/
Copy pathdcombinom.Rd
More file actions
75 lines (65 loc) · 2.55 KB
/
Copy pathdcombinom.Rd
File metadata and controls
75 lines (65 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/distributions.R
\name{dcombinom}
\alias{dcombinom}
\alias{pcombinom}
\title{The Conway-Maxwell-Binomial Distribution}
\usage{
dcombinom(x, size, mu, nu, log = FALSE)
pcombinom(q, size, mu, nu, lower.tail = TRUE, log.p = FALSE)
}
\arguments{
\item{x}{vector of quantiles (non-negative integers \eqn{\le} \code{size}).}
\item{size}{vector of numbers of trials.}
\item{mu}{vector of means (of the \emph{count}, i.e. \eqn{0 < \mu <}
\code{size}).}
\item{nu}{vector of dispersion parameters; \eqn{\nu = 1} recovers the
binomial distribution, \eqn{\nu > 1} gives under-dispersion,
\eqn{0 < \nu < 1} over-dispersion, and \eqn{\nu < 0} super-dispersion
(see \code{allow_negative_nu} in \code{\link{combinomial}}).}
\item{log}{logical; if \code{TRUE} the log-density is returned.}
\item{q}{vector of quantiles.}
\item{lower.tail}{logical; if \code{TRUE} (default), probabilities are
\eqn{P(X \le q)}.}
\item{log.p}{logical; if \code{TRUE} probabilities are returned on the
log scale.}
}
\value{
\code{dcombinom} gives the density; \code{pcombinom} gives the cumulative
distribution function.
}
\description{
Density and cumulative distribution function for the
Conway-Maxwell-Binomial (CMB) distribution, parameterized by the mean.
}
\details{
The CMB distribution (Shmueli et al. 2005; Kadane 2016) has probability
mass function
\deqn{P(X = x) = \binom{n}{x}^{\nu} p^{x} (1-p)^{n-x} / Z(p, \nu, n)}
for \eqn{x = 0, 1, \ldots, n}, where \eqn{Z} normalizes over the support.
Following the mean parameterization used by the \code{\link{combinomial}}
family (cf. Huang 2017), \code{mu} is the mean count; the natural
parameter \eqn{p} is recovered internally by solving
\eqn{E[X \mid n, p, \nu] = \mu}.
}
\examples{
## 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)
}
\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.
\emph{Journal of the Royal Statistical Society C} \bold{54}(1):127--142.
Kadane, J. B. (2016). Sums of possibly associated Bernoulli variables:
the Conway-Maxwell-Binomial distribution.
\emph{Bayesian Analysis} \bold{11}(2):403--420.
}
\seealso{
\code{\link{combinomial}} for the CMB family in \pkg{glmmTMB};
\link{Distributions} for other standard distributions, including
\code{\link{dbinom}} for the binomial distribution.
}
\keyword{distribution}