Special.Rd
Special mathematical functions not included in base R, specifically the multivariate form of the beta function and the multinomial coefficient.
mvbeta(a)
lmvbeta(a)
mnchoose(n, k)
lmnchoose(n, k)
non-negative numeric vector.
non-negative integer.
non-negative integer vector.
The functions mvbeta
and lmvbeta
return the multivariate beta function and the natural logarithm of the
multivariate beta function,
\[\beta(a) = \Gamma(a_1)\Gamma(a_2) ... \Gamma(a_m)/\Gamma(a_1 + a_2 + \dots + a_m).\]
The functions mnchoose
and lmnchoose
return the multinomial coefficient and the natural logarithm of the
multinomial coefficent,
\[{n \choose \mathbb{k}} = \frac{n!}{k_1! k_2! \dots k_m!}.\]
These calculations are difficult (or impossible) for large n
, so it is calculated in log space, which is much
easier. If the logarithm is not desired, the result is exponentiated (and rounded, because
\({n \choose \mathbb{k}}\) should be an integer), but beware this can also fail if n
is large enough.
https://en.wikipedia.org/wiki/Beta_function#Multivariate_beta_function https://en.wikipedia.org/wiki/Multinomial_theorem#Multinomial_coefficients
See Special
for the univariate beta function and the binomial coefficient.