marcharper / Yen

:yen: Python scripts for computing the yen and related quantities of trajectories of finite Markov processes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yen

Python scripts for computing the yen and related quantities of trajectories of finite Markov processes.

Examples: Two Types

The yen can be decomposed into various interesting components. For fitness landscapes defined by the following matrices:

    matrices = [
        [[1, 1], [0, 1]], # tournament
        [[1, 1], [1, 1]], # neutral
        [[2, 2], [1, 1]], # class Moran
        [[1, 2], [2, 1]], # hawk-dove
        [[1, 3], [2, 1]], # asymmetric hawk-dove
        [[2, 1], [1, 2]], # coordination
    ]

We can plot the decompositions as follows:







Examples: Three Types

For populations of three types, there are three directions in which one can compute the yen. For a rock-paper-scissors matrix::

    [0, -1, 1]
    [1, 0, -1]
    [-1, 1, 0]

We have three decomposition directions::




Stationary distributions and phase portraits are avaialable here.

We can also plot which "evolutionary force" contributes most to the action of the dynamic at each point, encoded by the following colors:

  • adaptation: red
  • relative_fitness: green
  • drift: blue
  • mutation: purple


About

:yen: Python scripts for computing the yen and related quantities of trajectories of finite Markov processes.


Languages

Language:Mathematica 89.3%Language:TeX 5.7%Language:Python 5.0%