% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bell.R
\name{Bell}
\alias{Bell}
\alias{dbell}
\alias{pbell}
\alias{rbell}
\alias{qbell}
\title{The Bell distribution}
\usage{
dbell(x, theta, log = FALSE)

pbell(x, theta)

rbell(n, theta, max_z = 100L)

qbell(p, theta, max_z = 100L)
}
\arguments{
\item{x}{vector of nonnegative integers (for \code{dbell} and \code{pbell}).}

\item{theta}{scalar nonnegative Bell parameter.}

\item{log}{logical; if TRUE, probabilities p are given as log(p).}

\item{n}{number of observations to generate (for \code{rbell}).}

\item{max_z}{maximum support value used for approximation in
\code{rbell} and \code{qbell}.}

\item{p}{numeric vector of probabilities between 0 and 1 inclusive (for \code{qbell}).}
}
\value{
For \code{dbell}, a numeric vector of probabilities.
For \code{pbell}, a numeric vector of cumulative probabilities.
For \code{qbell}, an integer vector of quantiles.
For \code{rbell}, an integer vector of random values.
}
\description{
Density, distribution function, quantile function and random generation
for the Bell distribution with parameter \code{theta}.
}
\details{
Let \eqn{B_x} denote the xth Bell number. The Bell distribution has
probability mass function
\deqn{
P(X = x) = \theta^x \exp(-\exp(\theta) + 1) \frac{B_x}{x!},
}
for nonnegative integers \eqn{x} and \eqn{\theta \ge 0}.

For \eqn{\theta > 0}, the Bell mean is \eqn{E[X] = \theta e^\theta}.
At \eqn{\theta = 0}, the distribution is degenerate at 0.

The functions follow the standard naming used in base R:
\code{dbell} for the density, \code{pbell} for the distribution function,
\code{qbell} for the quantile function and \code{rbell} for random
generation.
}
\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)

}
