<blockquote>
  <p><strong>Is there a tool which solves parametric games?</strong></p>
</blockquote>

<p>Not that I am aware of (I am a co-author of GTE and help with Gambit).</p>

<p>The best suggestion I have if you don't find such a tool (and I doubt one exists) is to do a parameter sweep and solve a bunch of individual instantiations and see what the resulting sets of equilibria say about $EQ()$. Gambit is very tightly integrated with python, so you can easily define your game as a python function with the parameters as arguments and solve a set of instances via a parameter sweep.</p>

CC BY-SA 4.0
2019-01-03T19:22:18.747Z
Can you combine Gambit with sympy to solve the game symbolically?
Erel Segal-Halevi
CC BY-SA 4.0
2019-01-05T12:57:24.163Z
For simple settings one might indeed be able to use sympy relatively easily. E.g., one could use solveset from sympy to do support enumeration for a bimatrix game with some parametrized payoffs, which would give (some parametric description of) the extreme NE. To find all NEs one then need to solve a maximal clique enumeration problem - probably tricky in this parametrized setting. For >= 3, the NE set can be any semi-algebraic set and we don't have robust enumerators for the non-parametric case, so unless the payoff parametrization is highly constrained, it may be hopeless.
Rahul Savani
CC BY-SA 3.0
2015-01-01T16:32:51.913Z
2015-01-01T18:04:48.360Z
2015-01-01T18:04:48.360Z
Rahul Savani
<p>There are a few tools, either online or offline, that could solve (find equilibrium) in a game explicitly given as a real-valued matrix.</p>

<p>Such tools are <a href="http://gte.csc.liv.ac.uk/gte/builder/" rel="nofollow">Game Theory Explorer</a> and <a href="http://gambit.sourceforge.net/" rel="nofollow">Gambit</a>.</p>

<p>However, as far as I know, these can not be used for finding equilibrium in a game with parameters.</p>

<p>For example, consider a two player game symmetric game, parametrized by some $x\in[0,1]$, which is given by the following payoff matrix for the row player (and $A^t(x)$ for the column player):
$$A(x)=
 \left( \begin{array}{ccc}
\frac{x}{2} &amp; x \\
1-x &amp; \frac{1-x}{2} \\
\end{array} \right) $$</p>

<p>Each equilibrium in this game can be represented as $&lt;p_a,p_b&gt;\in[0,1]^2$ where $p_a$ is the probability of the first player playing the first strategy and $p_b$ is the probability the second player plays the first strategy.</p>

<p>Analytically we can find all the equilibriums for this game</p>

<p>$$EQ(x)=
\begin{cases}
\{&lt;1,1&gt;\}&amp;\mbox{if } x&gt;\frac{2}{3}\\
\{&lt;3x-1,3x-1&gt;,&lt;1,0&gt;,&lt;0,1&gt;\}&amp;\mbox{if } \frac{1}{3}\leq x\leq\frac{2}{3}\\
\{&lt;0,0&gt;\}&amp; \mbox{else}
\end{cases}
$$</p>

<p>I'm looking for a solver which is able to understand inputs like $A(x)$ and produce $EQ(x)$.</p>

<blockquote>
  <p><strong>Is there a tool which solves parametric games?</strong></p>
</blockquote>

CC BY-SA 3.0
2015-01-01T21:20:49.013Z
How can the entries depend on $x$?
Kristoffer Arnsfelt Hansen
CC BY-SA 3.0
2015-01-02T07:41:19.913Z
@KristofferArnsfeltHansen - what do you mean? For every $x$, $A(x)$ is a normal game given in matrix form. A parametric solver would be able to produce the output with respect to $x$.
R B
CC BY-SA 3.0
2015-01-02T10:43:15.647Z
I understand that. But how is the input specified? For instance, in your example, the entries are simple linear functions of $x$.
Kristoffer Arnsfelt Hansen
CC BY-SA 3.0
2015-01-02T11:40:41.290Z
@KristofferArnsfeltHansen - assume you can simply write the matrix as $<f_{1,1}(x),f_{1,2}(x);f_{2,1}(x),f_{2,2}(x)>$, where $f_{i,j}$ is a some function of $x$, e.g. $<x/2, x; 1-x, (1-x)/2>$. Such tool would be very useful (for me anyways) even for a single parameter, small matrices (up to $3\times 3$) and linear functions of the parameter.
R B
CC BY-SA 3.0
2015-01-02T12:39:49.193Z
For small matrices you can simply enumerate over square submatrices and use the characterization of Shapley and Snow.
Kristoffer Arnsfelt Hansen
<gt.game-theory><software><nash-equilibrium>
Is there a tool for finding Nash equilibria in parametric games?
R B
# Is there a tool for finding Nash equilibria in parametric games?

(Asked by: username_0 on 2015-01-01)

There are a few tools, either online or offline, that could solve (find equilibrium) in a game explicitly given as a real-valued matrix.

Such tools are [Game Theory Explorer](http://gte.csc.liv.ac.uk/gte/builder/) and [Gambit](http://gambit.sourceforge.net/).

However, as far as I know, these can not be used for finding equilibrium in a game with parameters.

For example, consider a two player game symmetric game, parametrized by some $x\in[0,1]$, which is given by the following payoff matrix for the row player (and $A^t(x)$ for the column player):
$$A(x)=
\left( \begin{array}{ccc}
\frac{x}{2} & x \\
1-x & \frac{1-x}{2} \\
\end{array} \right) $$

Each equilibrium in this game can be represented as $\in[0,1]^2$ where $p\_a$ is the probability of the first player playing the first strategy and $p\_b$ is the probability the second player plays the first strategy.

Analytically we can find all the equilibriums for this game

$$EQ(x)=
\begin{cases}
\{<1,1>\}&\mbox{if } x>\frac{2}{3}\\
\{<3x-1,3x-1>,<1,0>,<0,1>\}&\mbox{if } \frac{1}{3}\leq x\leq\frac{2}{3}\\
\{<0,0>\}& \mbox{else}
\end{cases}
$$

I'm looking for a solver which is able to understand inputs like $A(x)$ and produce $EQ(x)$.

> **Is there a tool which solves parametric games?**

**Tags:** gt.game-theory, software, nash-equilibrium
> **Comments:**
> **username_1**: How can the entries depend on $x$?  
> **username_0**: @KristofferArnsfeltHansen - what do you mean? For every $x$, $A(x)$ is a normal game given in matrix form. A parametric solver would be able to produce the output with respect to $x$.  
> **username_1**: I understand that. But how is the input specified? For instance, in your example, the entries are simple linear functions of $x$.  
> **username_0**: @KristofferArnsfeltHansen - assume you can simply write the matrix as $<f_{1,1}(x),f_{1,2}(x);f_{2,1}(x),f_{2,2}(x)>$, where $f_{i,j}$ is a some function of $x$, e.g. $<x/2, x; 1-x, (1-x)/2>$. Such tool would be very useful (for me anyways) even for a single parameter, small matrices (up to $3\times 3$) and linear functions of the parameter.  
> **username_1**: For small matrices you can simply enumerate over square submatrices and use the characterization of Shapley and Snow.  

---

## 1 answers

### Answer by username_2 on 2015-01-01. Score: 4 | Accepted answer

> **Is there a tool which solves parametric games?**

Not that I am aware of (I am a co-author of GTE and help with Gambit).

The best suggestion I have if you don't find such a tool (and I doubt one exists) is to do a parameter sweep and solve a bunch of individual instantiations and see what the resulting sets of equilibria say about $EQ()$. Gambit is very tightly integrated with python, so you can easily define your game as a python function with the parameters as arguments and solve a set of instances via a parameter sweep.

> **Comments:**
> **username_3**: Can you combine Gambit with sympy to solve the game symbolically?  
> **username_2**: For simple settings one might indeed be able to use sympy relatively easily. E.g., one could use solveset from sympy to do support enumeration for a bimatrix game with some parametrized payoffs, which would give (some parametric description of) the extreme NE. To find all NEs one then need to solve a maximal clique enumeration problem - probably tricky in this parametrized setting. For >= 3, the NE set can be any semi-algebraic set and we don't have robust enumerators for the non-parametric case, so unless the payoff parametrization is highly constrained, it may be hopeless.  

---

