egttools.analytical.utils.get_pairwise_gradient_from_replicator_n_player

get_pairwise_gradient_from_replicator_n_player(i, j, x, nb_strategies, group_size, payoffs, freq_array)[source]

Compute the gradient of selection for an n-player game using the replicator equation.

Parameters:
  • i (int) – Index of the invader strategy.

  • j (int) – Index of the resident strategy.

  • x (int) – Number of invader individuals.

  • nb_strategies (int) – Number of strategies.

  • group_size (int) – Group size in the game.

  • payoffs (ndarray) – Payoff matrix shaped (nb_strategies, nb_group_configurations).

  • freq_array (ndarray) – Frequency vector for the population.

Returns:

Gradient of selection between the two strategies.

Return type:

float