% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dewens_k.R
\name{dewens_k}
\alias{dewens_k}
\title{Probability mass function for the number of classes from a Ewens distribution}
\usage{
dewens_k(k, n, theta)
}
\arguments{
\item{k}{An integer number of classes at which to evaluate the PMF}

\item{n}{A sample size not less than k}

\item{theta}{A non-negative parameter governing the expected sample diversity.}
}
\value{
The probability of observing k classes
}
\description{
Probability mass function for the number of classes from a Ewens distribution
}
\details{
The number of classes from a Ewens distribution with parameter \eqn{\theta} is given by the expression \deqn{Pr(K = k) = \lvert{} S^k_n \rvert{} \frac{\theta^k}{\theta (\theta + 1) ... (\theta + n - 1)}}, where \eqn{\lvert{}S^k_n \rvert{}} is the absolute value of a Stirling number of the first kind.
}
\examples{
x <- sample(LETTERS, 120, replace = TRUE)
dewens_k(1, 20, theta = 1) ## Pretty unlikely we just see one class

}
