Density, distribution function, quantile function and random generation
for the Bell distribution with parameter theta.
Usage
dbell(x, theta, log = FALSE)
pbell(x, theta)
rbell(n, theta, max_z = 100L)
qbell(p, theta, max_z = 100L)Arguments
- x
vector of nonnegative integers (for
dbellandpbell).- theta
scalar nonnegative Bell parameter.
- log
logical; if TRUE, probabilities p are given as log(p).
- n
number of observations to generate (for
rbell).- max_z
maximum support value used for approximation in
rbellandqbell.- p
numeric vector of probabilities between 0 and 1 inclusive (for
qbell).
Value
For dbell, a numeric vector of probabilities.
For pbell, a numeric vector of cumulative probabilities.
For qbell, an integer vector of quantiles.
For rbell, an integer vector of random values.
Details
Let \(B_x\) denote the xth Bell number. The Bell distribution has probability mass function $$ P(X = x) = \theta^x \exp(-\exp(\theta) + 1) \frac{B_x}{x!}, $$ for nonnegative integers \(x\) and \(\theta \ge 0\).
For \(\theta > 0\), the Bell mean is \(E[X] = \theta e^\theta\). At \(\theta = 0\), the distribution is degenerate at 0.
The functions follow the standard naming used in base R:
dbell for the density, pbell for the distribution function,
qbell for the quantile function and rbell for random
generation.