gameanalysis.trace module

Module for tracing equilibria in mixture games

gameanalysis.trace.trace_equilibrium(game0, game1, peq, eqm, target, *, regret_thresh=0.001, max_step=0.1, singular=1e-07, **ivp_args)[source]

Try to trace an equilibrium out to target

Takes two games, a fraction that they’re mixed (peq), and an equilibrium of the mixed game (eqm). It then attempts to find the equilibrium at the target mixture. It may not reach target, but will return as far as it got. The return value is two parallel arrays for the probabilities with known equilibria and the equilibria.

Parameters
  • game0 (RsGame) – The first game that’s merged. Represents the payoffs when peq is 0.

  • game1 (RsGame) – The second game that’s merged. Represents the payoffs when peq is 1.

  • peq (float) – The amount that the two games are merged such that eqm is an equilibrium. Must be in [0, 1].

  • eqm (ndarray) – An equilibrium when game0 and game1 are merged a peq fraction.

  • target (float) – The desired mixture probability to have an equilibrium at.

  • regret_thresh (float, optional) – The amount of gain from deviating to a strategy outside support can have before it’s considered a beneficial deviation and the tracing stops. This should be larger than zero as most equilibria are approximate due to floating point precision.

  • max_step (float, optional) – The maximum step to take in t when evaluating.

  • singular (float, optional) – An absolute determinant below this value is considered singular. Occasionally the derivative doesn’t exist, and this is one way in which that manifests. This values regulate when ODE solving terminates due to a singular matrix.

  • ivp_args – Any remaining keyword arguments are passed to the ivp solver.

gameanalysis.trace.trace_interpolate(game0, game1, peqs, eqa, targets, **kwargs)[source]

Get an equilibrium at a specific time

Parameters
  • game0 (RsGame) – The game to get data from when the mixture probability is 0.

  • game1 (RsGame) – The game to get data from when the mixture probability is 1.

  • peqs ([float]) – A parallel list of probabilities for each equilibria in a continuous trace.

  • eqa ([eqm]) – A parallel list of equilibria for each probability representing continuous equilibria for prob mixture games.

  • targets ([float]) – The probabilities to compute an equilibria at.

  • kwargs (options) – The same options as trace_equilibrium.