Multinomial mean and covariance
M = distfun_mnstat(n,P) [M,C] = distfun_mnstat(n,P)
a 1-by-1 matrix of doubles, integer value, positive, the number of trials
a 1-by-k matrix of doubles, positive, sum to 1, the probability of the k categories
a 1-by-1 matrix of doubles, the mean
a k-by-k matrix of doubles, the variance-covariance matrix
Computes statistics from the multinomial distribution. On input, we assume that sum(P)==1.
The Mean and Covariance matrix of the Multinomial Distribution is:
Wikipedia, Multinomial distribution function, http://en.wikipedia.org/wiki/Multinomial_distribution