phaseDiagram3S: Phase Diagram for two-player games with three strategies

View source: R/phaseDiagram3S.R

phaseDiagram3SR Documentation

Phase Diagram for two-player games with three strategies

Description

Plots phase diagram of a game with two players and three strategies.

Usage

phaseDiagram3S(
  A,
  dynamic,
  params = NULL,
  trajectories = NULL,
  contour = FALSE,
  vectorField = FALSE,
  strategies = c("1", "2", "3")
)

Arguments

A

Numeric matrix of size 3x3 representing the number of strategies of a symmetric matrix game.

dynamic

Function representing an evolutionary dynamic.

params

Numeric vector with additional parameters for the evolutionary dynamic.

trajectories

Numeric matrix of size mx3. Each row represents the initial values for the trajectory to be examined.

contour

Logical value that handles contour diagram presentation. If set to TRUE, contour diagram will be shown, otherwise not. Default is FALSE.

vectorField

Logical value that handles vector field presentation. If set to TRUE, vector field will be shown, otherwise not. Default is FALSE.

strategies

String vector of length 3 that names all strategies.

Value

None.

Author(s)

Daniel Gebele dngebele@gmail.com

Examples

A <- matrix(c(0, -2, 1, 1, 0, -2, -2, 1, 0), 3, byrow=TRUE)
state <- matrix(c(0.4, 0.3, 0.3), 1, 3, byrow=TRUE)

phaseDiagram3S(A, Replicator, NULL, state, FALSE, FALSE)
phaseDiagram3S(A, Replicator, NULL, state, TRUE, TRUE)

# Plot two trajectories rather than only one:
A <- matrix(c(0, -2, 1, 1, 0, -2, -2, 1, 0), 3, byrow=TRUE)
state <- matrix(c(0.4, 0.3, 0.3, 0.6, 0.2, 0.2), 2, 3, byrow=TRUE)
phaseDiagram3S(A, Replicator, NULL, state, FALSE, FALSE)

EvolutionaryGames documentation built on April 11, 2022, 5:07 p.m.