Bell: The Bell distribution

BellR Documentation

The Bell distribution

Description

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 dbell and pbell).

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 rbell and qbell.

p

numeric vector of probabilities between 0 and 1 inclusive (for qbell).

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.

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.

Examples

dbell(0:5, theta = 1)
pbell(0:5, theta = 1)
qbell(c(0.25, 0.5, 0.9), theta = 1)
set.seed(1)
rbell(10, theta = 1)


antedep documentation built on April 25, 2026, 1:06 a.m.