egttools.utils

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

Functions

calculate_nb_unique_combinations

Calculates the number of unique combinations given the required number of elements of each group, which should be given in List format in the slots_per_bin parameter.

calculate_stationary_distribution

Calculates stationary distribution from a transition matrix of Markov chain.

calculate_stationary_distribution_non_hermitian

Calculates stationary distribution from a transition matrix of Markov chain which is not hermitian.

combine

Outputs a generator that will generate an ordered list with the possible combinations of values with length.

eigvals

Compute eigenvalues from an ordinary or generalized eigenvalue problem.

find_saddle_type_and_gradient_direction

Finds whether a saddle point is stable or not.

get_payoff_function

Returns a function which gives the payoff of strategy i against strategy j.

schur

Compute Schur decomposition of a matrix.

transform_payoffs_to_pairwise

This function transform a payoff matrix in full format to a pairwise format.

warn

Issue a warning, or maybe ignore it or raise an exception.

Classes

AbstractGame

Abstract class which must be implemented by any new game.

csc_matrix

Compressed Sparse Column matrix

csr_matrix

Compressed Sparse Row matrix