egttools.helpers.vectorized.replicator_equation_n_player

replicator_equation_n_player(frequencies: numpy.ndarray[numpy.float64[m, 1]], payoff_matrix: numpy.ndarray[numpy.float64[m, n]], group_size: int) numpy.ndarray[numpy.float64[m, 1]]

Calculates the gradient of the replicator dynamics given the current population state.

Parameters
  • frequencies (numpy.ndarray) – Vector of frequencies of each strategy in the population (it must have shape=(nb_strategies,)

  • payoff_matrix (numpy.ndarray) – A payoff matrix containing the payoff of each row strategy for each possible group configuration, indicated by the column index. The matrix must have shape (nb_strategies, nb_group_configurations).

  • group_size (int) – size of the group

Returns

A vector with the gradient for each strategy. The vector has shape (nb_strategies,)

Return type

numpy.ndarray