Learn R Programming

glmmTMB (version 1.1.15.2)

dbell: The Bell Distribution

Description

Density and cumulative distribution function for the Bell distribution.

Usage

dbell(x, theta, log = FALSE)

pbell(q, mu, lower.tail = TRUE, log.p = FALSE)

Value

dbell gives the density; pbell gives the cumulative distribution function.

Arguments

x

vector of non-negative integer quantiles.

theta

vector of positive Bell parameters. Related to the mean by \(\mu = \theta e^{\theta}\).

log

logical; if TRUE the log-density is returned.

q

vector of quantiles.

mu

vector of positive means. Related to the Bell parameter by \(\theta = W(\mu)\), where \(W\) is the Lambert W function.

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 Bell distribution (Castellares et al. 2018) has probability mass function $$P(X = x) = \frac{e^{1 - e^{\theta}} \theta^{x} B_{x}}{x!}$$ for \(x = 0, 1, 2, \ldots\) and \(\theta > 0\), where \(B_x\) is the \(x\)-th Bell number. The mean is \(\mu = \theta e^{\theta}\).

dbell is parameterized by theta; pbell is parameterized by the mean mu (as used in bell models). Both use internal C-level implementations with no external package dependencies.

References

Castellares, F., Ferrari, S. L. P., Lemonte, A. J. (2018). On the Bell distribution and its associated regression model for count data. Applied Mathematical Modelling 56:172--185. tools:::Rd_expr_doi("10.1016/j.apm.2017.12.014")

See Also

bell for the Bell family in glmmTMB; Distributions for other standard distributions.

Examples

Run this code
dbell(0:5, theta = 1)
pbell(0:5, mu = exp(1))  ## theta = 1 implies mu = e

Run the code above in your browser using DataLab