egttools.analytical.utils

Functions

calculate_gradients

Calculates the gradients of selection of each of the states given in population_states.

check_if_point_in_unit_simplex

Checks if a point (in barycentric coordinates) is inside the unit simplex.

check_if_there_is_random_drift

Checks if there is random drift along the edge between two strategies in the simplex.

check_replicator_stability_pairwise_games

Calculates the stability of the roots assuming that they are from a system governed by the replicator equation (this function uses the Jacobian of the replicator equation in pairwise games to calculate the stability).

eigvals

Compute eigenvalues from an ordinary or generalized eigenvalue problem.

find_roots

Searches for the roots of the given differential equation.

find_roots_and_stability

Searches for the roots of the differential equation gradient_function and calculates the stability based on an estimate of the Jacobian.

get_pairwise_gradient_from_replicator

Calculate the gradient for strategy/type i at the edges of the simplex (when there are only two strategies in the population i and j).

get_pairwise_gradient_from_replicator_n_player

Calculate the gradient for strategy/type i at the edges of the simplex (when there are only two strategies in the population i and j).

replicator_equation

Produces the discrete time derivative of the replicator dynamics

replicator_equation_n_player

Replicator dynamics in N-player games

root

Find a root of a vector function.

sample_unit_simplex

Samples uniformly at random the unit simplex with nb_strategies dimensionse.

Classes

StochDynamics

A class containing methods to calculate the stochastic evolutionary dynamics of a population.