gameanalysis.regret module

A module for computing regret and social welfare of profiles

gameanalysis.regret.max_mixed_social_welfare(game, *, grid_points=2, random_restarts=0, processes=0, **swopt_args)[source]

Returns the maximum role symmetric mixed social welfare profile

Parameters:
  • grid_points (int > 1, optional) – The number of grid points to use for mixture seeds. two implies just pure mixtures, more will be denser, but scales exponentially with the dimension.
  • random_restarts (int, optional) – The number of random initializations.
  • processes (int, optional) – Number of processes to use when finding Nash equilibria. The game needs to be pickleable.
gameanalysis.regret.max_pure_social_welfare(game, *, by_role=False)[source]

Returns the maximum social welfare over the known profiles.

If by_role is specified, then max social welfare applies to each role independently. If there are no profiles with full payoff data for a role, an arbitrary profile will be returned.

gameanalysis.regret.mixed_social_welfare(game, mix)[source]

Returns the social welfare of a mixed strategy profile

gameanalysis.regret.mixture_deviation_gains(game, mix)[source]

Returns all the gains from deviation from a mixed strategy

The result is ordered by role, then strategy.

gameanalysis.regret.mixture_regret(game, mix)[source]

Return the regret of a mixture profile

gameanalysis.regret.pure_social_welfare(game, profile)[source]

Returns the social welfare of a pure strategy profile in game

gameanalysis.regret.pure_strategy_deviation_gains(game, profile)[source]

Returns the pure strategy deviations gains

The result is a compact array of deviation gains. Each element corresponds to the deviation from strategy i to strategy j ordered by (i, j) for all valid deviations.

gameanalysis.regret.pure_strategy_regret(game, prof)[source]

Returns the regret of a pure strategy profile

If prof has more than one dimension, the last dimension is taken as a set of profiles and returned as a new array.