egttools.plotting.simplified.vectorized_replicator_equation¶
- vectorized_replicator_equation(frequencies, payoffs)[source]¶
This function provides an easy way to calculate a matrix of gradients in a simplex in one go.
The input
frequencies
is expected to be a 3 dimensional tensor of shape (p, m, n) while the payoffs matrix is expected to be of shape (p, p).The main intention of this helper function is to facilitate the calculation of the gradients that are required by the
plot_gradients
method of theegttools.Simplex2D
class.- Parameters
frequencies (numpy.ndarray[p,m,n]) – A 3 dimensional tensor containing the set of population frequencies for which the gradient should be calculated.
payoffs (numpy.ndarray[p,p]) – A 2 dimensional matrix containing the payoffs of the game.
- Returns
The gradients for each of the input frequencies.
- Return type
numpy.ndarray[p,m,n]