MM (version 1.6-7)

multinomial: Multinomial function

Description

The multinomial function and its logarithm

Usage

multinomial(x)
lmultinomial(x)

Arguments

x

Numeric vector

Author

Robin K. S. Hankin

Details

Function multinomial() returns

n n_1,n_2,...,n_k = n!n_1!n_2! n_k!omitted; see PDF

where _i n_i=nn_1+...+n_k=n, and function lmultinomial() returns the natural logarithm of this.

Examples

Run this code
x <- runif(10)

exp(lmultinomial(x)) - multinomial(x) #should be small 

Run the code above in your browser using DataLab