ed.util.compute_multinomial_mode

compute_multinomial_mode(
    probs,
    total_count=1,
    seed=None
)

Defined in edward/util/random_variables.py.

Compute the mode of a Multinomial random variable.

Args:

  • probs: 1-D Numpy array of Multinomial class probabilities
  • total_count: integer number of trials in single Multinomial draw
  • seed: a Python integer. Used to create a random seed for the distribution

Examples

# returns either [2, 2, 1], [2, 1, 2] or [1, 2, 2]
probs = np.array(3 * [1/3])
total_count = 5
compute_multinomial_mode(probs, total_count)

# returns [3, 2, 0]
probs = np.array(3 * [1/3])
total_count = 5
compute_multinomial_mode(probs, total_count)