egttools.analytical.utils

Functions

calculate_gradients

Calculate the selection gradients for a list of population states.

check_if_point_in_unit_simplex

Check whether a point (in barycentric coordinates) lies inside the unit simplex.

check_if_there_is_random_drift

Check for pairs of strategies that exhibit random drift based on replicator gradients.

check_replicator_stability_pairwise_games

Determine the stability of stationary points for the replicator equation in pairwise games.

eigvals

Compute eigenvalues from an ordinary or generalized eigenvalue problem.

find_roots

Search for the roots (stationary points) of the given gradient function on the unit simplex.

find_roots_and_stability

Find fixed points of the gradient function and determine their stability.

get_pairwise_gradient_from_replicator

Compute the gradient of selection between two strategies i and j using the replicator equation.

get_pairwise_gradient_from_replicator_n_player

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

replicator_equation

Compute the time derivative of the replicator dynamics for 2-player games.

replicator_equation_n_player

Computes the replicator dynamics gradient for N-player games.

root

Find a root of a vector function.

sample_unit_simplex

Samples a continuous strategy composition uniformly at random from the unit simplex.

Classes

StochDynamics

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