Skip to main content

A package for the margin game.

Project description

pip install margingame

This package is mainly for just one class, Initialise(...). You can:

  • Pass in non-default parameters for a custom game.
  • Get attributes, notably payoff matrices as Pandas dataframes.
  • Use the method to calculate the Nash equilibria.

See the code, notably, for more info.

Main Uses

Interactive payoff matrices for both players

  1. In a .ipynb file, run the code `from margingame.notebook.visualise import visualise`.
  2. Install any missing packages flagged by an error if there are any (this is due to a bug).
  3. Run `visualise()`.


  • You can click the left margin of the output cell to expand/truncate it.
  • Changing the domains of the payoff matrices is achieved by passing the relevant arguments into `visualise`.
  • It's slow, I know.

Calculate the nash equlibria

  1. Run the code `from margingame.Initialise import Initialise'.
  2. Create your game with `Game = Initialise(...)', specifying any non-default parameters desired.
  3. Calculate the nash equlibria via support enumeration via `Game.calculate_equilibria_support_enum()`.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

margingame-0.3.4.tar.gz (4.9 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page