egttools.plotting.plot_replicator_dynamics_in_simplex

plot_replicator_dynamics_in_simplex(payoff_matrix, group_size=2, nb_points_simplex=100, nb_of_initial_points_for_root_search=10, atol=1e-07, atol_equal=1e-12, method_find_roots='hybr', atol_stability_pos=0.0001, atol_stability_neg=0.0001, atol_stability_zero=0.0001, figsize=(10, 8), ax=None)[source]

Helper function to simplify the plotting of the replicator dynamics in a 2 Simplex.

Parameters
  • payoff_matrix (numpy.ndarray) – The square payoff matrix. Group games are still unsupported in the replicator dynamics. This feature will soon be added.

  • group_size (int) – size of the group

  • nb_points_simplex (int) – Number of initial points to draw in the simplex

  • nb_of_initial_points_for_root_search (int) – Number of initial points used in the method that searches for the roots of the replicator equation

  • atol (float) – Tolerance to consider a value equal to zero. This is used to check if an edge has random drift. By default, the tolerance is 1e-7.

  • atol_equal (float) – Tolerance to consider two arrays equal.

  • method_find_roots (str) – Method used in scipy.optimize.root

  • atol_stability_neg (float) – Tolerance used to determine the stability of the roots. This is used to determine whether an eigenvalue is negative.

  • atol_stability_pos (float) – Tolerance used to determine the stability of the roots. This is used to determine whether an eigenvalue is positive.

  • atol_stability_zero (float) – Tolerance used to determine the stability of the roots. This is used to determine whether an eigenvalue is zero.

  • figsize (Tuple[int, int]) – Size of the figure. This parameter is only used if the ax parameter is not defined.

  • ax (Optional[matplotlib.pyplot.axis]) – A matplotlib figure axis.

Return type

Tuple[Simplex2D, Callable[[ndarray, int], ndarray], List[ndarray], List[ndarray], List[int]]

Returns

  • Tuple[Simplex2D, Callable[[numpy.ndarray, int], numpy.ndarray], List[numpy.ndarray], List[numpy.ndarray], List[int]]

  • A tuple with the simplex object which can be used to add more features to the plot, the function that

  • can be used to calculate gradients and should be passed to Simplex2D.draw_trajectory_from_roots and

  • Simplex2D.draw_scatter_shadow, a list of the roots in barycentric coordinates, a list of the roots in

  • cartesian coordinates and a list of booleans or integers indicating whether the roots are stable.