egttools

The egttools package implements methods to study evolutionary dynamics.

Functions

calculate_expected_group_success

Calculate the expected group success eta_G under the stationary distribution.

calculate_expected_indicator

Calculate E[f] = sum_s sd(s) * sum_g P(g|s) * f(g) for an arbitrary indicator f.

calculate_expected_indicators

Calculate E[f_k] for multiple indicator functions in a single pass.

calculate_expected_indicators_precomputed

Compute expected indicators from a precomputed indicator matrix (pure C++, GIL released).

calculate_expected_payoff

Calculate the expected payoff averaged over the stationary distribution.

calculate_expected_state_indicator

Calculate E[f] = sum_s sd(s) * f(s) for a single state-level indicator.

calculate_expected_state_indicators

Calculate E[f_k] = sum_s sd(s) * f_k(s) for multiple state-level indicators in one pass.

calculate_expected_state_indicators_precomputed

Fast path: E[f_k] = sum_s sd(s) * indicator_values(s, k) using a precomputed matrix.

calculate_hypergeometric_expected_value

Compute E[f | state] = sum_g P(g | state) * f(g) for a single population state.

calculate_hypergeometric_fitness

Compute the fitness of a focal player (not included in strategies) via hypergeometric sampling.

calculate_nb_states

Calculate the number of possible states in a discrete simplex.

calculate_state

Convert a discrete population configuration into a unique index.

calculate_strategies_distribution

Calculate the average frequency of each strategy given a stationary distribution.

files

Get a Traversable resource from a package

is_arpack_enabled

Check if EGTtools was compiled with ARPACK eigensolver support.

is_blas_lapack_enabled

Check if EGTtools was compiled with BLAS/LAPACK acceleration.

is_boost_enabled

Check if EGTtools was compiled with Boost support.

is_openmp_enabled

Check if EGTtools was compiled with OpenMP support.

is_petsc_enabled

Check if EGTtools was compiled with PETSc/SLEPc MPI eigensolver support.

precompute_group_to_state_indicator_matrix

Build a state-level indicator matrix from group-level callables.

sample_simplex

Convert a state index into a group composition vector.

sample_unit_simplex

Sample a point uniformly at random from the unit simplex.

show_build_info

Nicely print the EGTtools build information and runtime feature support.

analytical

API reference documentation for the analytical submodule.

behaviors

API reference documentation for behaviors submodule.

datastructures

Custom data structures used to store data from numerical simulations.

distributions

Helpful implementations of stochastic distributions.

games

API reference documentation for the games submodule.

helpers

Set of helper functions that can be useful for obtaining analytical results, simulations or for plotting.

numerical

The numerical module contains functions and classes to simulate evolutionary dynamics in finite populations.

plotting

API reference documentation for the plotting submodule.

utils

This python module contains some utility functions to find saddle points and plot gradients in 2 player, 2 strategy games.