| title | egtplot: A Python Package for Three-Strategy Evolutionary Games | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| tags |
|
|||||||||||||||||||||
| authors |
|
|||||||||||||||||||||
| affiliations |
|
|||||||||||||||||||||
| date | 25 April 2018 | |||||||||||||||||||||
| bibliography | joss_bib.bib |
In the study of evolutionary game theory (EGT), there exists a need for open source software for the visualization of the dynamics of games. The Python package egtplot represents an attempt to make simple, visual analysis of a particular class of evolutionary games--those with three players and which can be represented by a payoff matrix. Using egtplot, these games can be visualized as static images or as animations with a variety of parameters to control what information is presented in the graphic.
EGT is a reformulation of classical game theory wherein the players of the game are members of a population. These members do not choose a strategy, but instead are born with their strategy ingrained, i.e., they cannot change strategy during the game. In biological terms, the strategies might represent discrete species or genotypes, hawks and doves being a classic example. Payoffs the players gain or lose based on their interactions with other players increase or decrease their fitness, thereby influencing the number or proportion of members playing that strategy in the next generation. As such, the populations of strategies can wax and wane as they outcompete or are outcompeted by other strategies.
As a very general model of cooperation and competition, EGT is well-suited for quantitative investigations of the dynamics of interactions between populations. EGT has been used to model phenomena from disparate areas of study, from poker [@javarone2016modeling] to hawks and doves [@smith1973logic] to host-parasite coevolution [@schenk2017chaotic].
While there are many use cases for this software, our group's particular focus is on the mathematical modeling of cancer and cancer therapies through evolutionary game theory [@kaznatcheev2017cancer, @kaznatcheev2015edge, @Kaznatcheev179259]. For details on analytical treatments of evolutionary games, please see Artem Kaznatcheev's blog at Theory, Evolution, and Games Group.
We demonstrate the features of egtplot via an example drawn from work modelling the interactions between cancer and healthy cells. Consider the following game from [@basanta2012investigating] which describes the evolutionary game between three strategies of cells, labeled "S" (Stroma), "D" (micronenvironmentally dependent), and "I" (microenvironmentally independent):
| S | D | I | |
|---|---|---|---|
| S | 0 | 0 | |
| D | |||
| I |
where
Using our package, we can quickly and easily analyze this game numerically and visually. To start, let us choose some simple values for each parameter:
\begin{figure}[h!]\centering
{\includegraphics[width=\textwidth]{images/output_8_1.png}}
\caption{Standard output of the package for
By altering the default values for the plotting function, a variety of different plotting styles can be achieved as demonstrated in Figure 2.
\begin{figure}[h!]\centering {\includegraphics[width=\textwidth]{images/two_parts.png}} \caption{\textit{Left} Background of the simplex is colored by the speed at which the points would travel along their trajectories. \textit{Right} Displaying the paths taken by each initial condition.} \end{figure}
Additionally, multiple parameter values can be easily combined into subplots of a larger image. In Figure 3, we vary
\begin{figure}[h!]\centering
{\includegraphics[width=\textwidth]{images/output_20_1.png}}
\caption{Parameter sweep for different
Finally, egtplot also has functionality to display animated versions of these plots. For further information on the use of the software and how these plots were created, please see the documentation and example notebook.
The authors would like to thank Mathematical Biosciences Institue (MBI) at Ohio State University, for partially supporting this research. MBI receives its funding through the National Science Foundation grant DMS 1440386. We gratefully acknowledge the work of Hanna Schenk whose code on her GitHub inspired this project.
Inom Mirzaev and Drew FK Williamson contributed equally to this work.