egttools.distributions.multinomial_pmf

multinomial_pmf(x: numpy.ndarray[numpy.uint64[m, 1]], n: int, p: numpy.ndarray[numpy.float64[m, 1]]) float

Calculates the probability density function of a multivariate hyper-geometric distribution.

This function returns the probability that a sample of size :param n with counts of each type indicated by :param x would be drawn from a population with frequencies :param p.

Both :param population_counts and :param sample_counts must be of shape (k,), where k is the number of types of objects in the population.

For the application often used in this library, :param n would be the size of the group, :param k would be the number of strategies, :param x would be group configuration and :param p would be the state of the population (in infinite populations).

Parameters
  • x (numpy.ndarray) – Vector of containing the counts of each element that should be drawn. Must sum to n.

  • n (int) – Total number of elements to draw

  • p (numpy.ndarray) – Vector indicating the total frequency of each element. Must sum to 1.

Returns

The probability that a sample of size n with counts x of each type is draw from a population with total frequencies per type defined by p.

Return type

float