Skip to contents

Computes \(\log\{n! / (\alpha)_n \prod_i \alpha^{m_i} / (i^{m_i} m_i!)\}\), where multiplicities[i] is the number of blocks of size i and the sample size \(n = \sum_i i m_i\) is recovered from the multiplicities.

Usage

morie_gh_ewens_log(multiplicities, alpha)

Arguments

multiplicities

numeric vector whose i-th entry is the number of blocks of size i

alpha

Dirichlet-process precision (positive)

Value

numeric scalar log-probability of the partition

References

Ghosal, S. and van der Vaart, A. (2017). Fundamentals of Nonparametric Bayesian Inference. Cambridge University Press.

Examples

# a partition of n = 8 with three singletons, one pair and one triple
morie_gh_ewens_log(multiplicities = c(3, 1, 1), alpha = 2)
#> [1] -2.315008