This is a Matlab function that estimates the number of categories of a multinomial distribution