mchoose: Multinomial Coefficient

View source: R/helpers.r

mchooseR Documentation

Multinomial Coefficient

Description

Compute the multinomial coefficient.

Usage

mchoose(n, x)

Arguments

n

an integer

x

a vector of integers

Details

This function computes the multinomial coefficient by computing the factorial of each number on a log scale, differencing log(n!) - sum(log(x!)), and then exponentiating. It then checks to see if this is an integer; if it's not, it issues a warning.

Value

...

Examples


mchoose(6, c(2,2,1,1))





dkahle/algstat documentation built on May 23, 2023, 12:29 a.m.