Title: | Important Concepts of Evolutionary Game Theory |
---|---|
Description: | Evolutionary game theory applies game theory to evolving populations in biology, see e.g. one of the books by Weibull (1994, ISBN:978-0262731218) or by Sandholm (2010, ISBN:978-0262195874) for more details. A comprehensive set of tools to illustrate the core concepts of evolutionary game theory, such as evolutionary stability or various evolutionary dynamics, for teaching and academic research is provided. |
Authors: | Daniel Gebele [aut, cph], Jochen Staudacher [aut, cre, cph] |
Maintainer: | Jochen Staudacher <[email protected]> |
License: | GPL-2 |
Version: | 0.1.2 |
Built: | 2025-02-20 04:00:01 UTC |
Source: | https://github.com/cran/EvolutionaryGames |
Brown-von Neumann-Nash replicator dynamic as a type of evolutionary dynamics.
BNN(time, state, parameters)
BNN(time, state, parameters)
time |
Regular sequence that represents the time sequence under which simulation takes place. |
state |
Numeric vector that represents the initial state. |
parameters |
Numeric vector that represents parameters needed by the dynamic. |
Numeric list. Each component represents the rate of change depending on the dynamic.
Daniel Gebele [email protected]
Brown, G. W. and von Neumann, J. (1950) "Solutions of games by differential equations", In: Kuhn, Harold William and Tucker, Albert William (Eds.) "Contributions to the Theory of Games I", Princeton University Press, pp. 73–79.
dynamic <- BNN 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, dynamic, NULL, state, FALSE, FALSE)
dynamic <- BNN 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, dynamic, NULL, state, FALSE, FALSE)
Best response dynamic as a type of evolutionary dynamics.
BR(time, state, parameters)
BR(time, state, parameters)
time |
Regular sequence that represents the time sequence under which simulation takes place. |
state |
Numeric vector that represents the initial state. |
parameters |
Numeric vector that represents parameters needed by the dynamic. |
Numeric list. Each component represents the rate of change depending on the dynamic.
Daniel Gebele [email protected]
Gilboa, I. and Matsui, A. (1991) "Social Stability and Equilibrium", Econometrica 59, pp. 859–867.
dynamic <- BR 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, dynamic, NULL, state, FALSE, FALSE)
dynamic <- BR 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, dynamic, NULL, state, FALSE, FALSE)
Computes Evolutionary Stable Strategies of a game with two players and a maximum of three strategies.
ESS(A, strategies = c(), floats = TRUE)
ESS(A, strategies = c(), floats = TRUE)
A |
Numeric matrix of size 2x2 or 3x3 representing the number of strategies of a symmetric matrix game. |
strategies |
String vector of length n that names all strategies whereas n represents the number of strategies. |
floats |
Logical value that handles number representation. If set to
|
Numeric matrix. Each row represents an ESS.
Daniel Gebele [email protected]
Smith, J. M. and Price, G. R. (1973) "The logic of animal conflict", Nature 246, pp. 15–18.
ESS(matrix(c(-1, 4, 0, 2), 2, byrow=TRUE), c("Hawk", "Dove"), FALSE) ESS(matrix(c(1, 2, 0, 0, 1, 2, 2, 0, 1), 3, byrow=TRUE))
ESS(matrix(c(-1, 4, 0, 2), 2, byrow=TRUE), c("Hawk", "Dove"), FALSE) ESS(matrix(c(1, 2, 0, 0, 1, 2, 2, 0, 1), 3, byrow=TRUE))
Computes evolutionarily stable sets of a game with two players and three strategies.
ESset(A, strategies = c("1", "2", "3"), floats = TRUE)
ESset(A, strategies = c("1", "2", "3"), floats = TRUE)
A |
Numeric matrix of size 3x3 representing the number of strategies of a symmetric matrix game. |
strategies |
String vector of length 3 that names all strategies. |
floats |
Logical value that handles number representation. If set to
|
Numeric matrix. Each row represents the start and end point of a line (ESset). In addition, a plot of the ESset in the game will be created.
Daniel Gebele [email protected]
Thomas, B. (1985) "On evolutionarily stable sets", Journal of Mathematical Biology 22, pp. 105–115.
# Please note that the computation of evolutionarily stable sets # is rather time-consuming. # Depending on your machine you might need to wait more # than 10 seconds in order to run the following example. ## Not run: A <- matrix(c(-2, 5, 10/9, 0, 5/2, 10/9, -10/9, 35/9, 10/9), 3, byrow=TRUE) strategies <- c("Hawk", "Dove", "Mixed ESS") ESset(A, strategies) ## End(Not run)
# Please note that the computation of evolutionarily stable sets # is rather time-consuming. # Depending on your machine you might need to wait more # than 10 seconds in order to run the following example. ## Not run: A <- matrix(c(-2, 5, 10/9, 0, 5/2, 10/9, -10/9, 35/9, 10/9), 3, byrow=TRUE) strategies <- c("Hawk", "Dove", "Mixed ESS") ESset(A, strategies) ## End(Not run)
Imitative Logit dynamic as a type of evolutionary dynamics.
ILogit(time, state, parameters)
ILogit(time, state, parameters)
time |
Regular sequence that represents the time sequence under which simulation takes place. |
state |
Numeric vector that represents the initial state. |
parameters |
Numeric vector that represents parameters needed by the dynamic. |
Numeric list. Each component represents the rate of change depending on the dynamic.
Jochen Staudacher [email protected]
Weibull, J. W. (1997) "Evolutionary Game Theory", MIT Press.
dynamic <- ILogit A <- matrix(c(-1, 0, 0, 0, -1, 0, 0, 0, -1), 3, byrow=TRUE) state <- matrix(c(0.1, 0.2, 0.7, 0.2, 0.7, 0.1, 0.9, 0.05, 0.05), 3, 3, byrow=TRUE) eta <- 0.7 phaseDiagram3S(A, dynamic, eta, state, TRUE, FALSE)
dynamic <- ILogit A <- matrix(c(-1, 0, 0, 0, -1, 0, 0, 0, -1), 3, byrow=TRUE) state <- matrix(c(0.1, 0.2, 0.7, 0.2, 0.7, 0.1, 0.9, 0.05, 0.05), 3, 3, byrow=TRUE) eta <- 0.7 phaseDiagram3S(A, dynamic, eta, state, TRUE, FALSE)
Logit dynamic as a type of evolutionary dynamics.
Logit(time, state, parameters)
Logit(time, state, parameters)
time |
Regular sequence that represents the time sequence under which simulation takes place. |
state |
Numeric vector that represents the initial state. |
parameters |
Numeric vector that represents parameters needed by the dynamic. |
Numeric list. Each component represents the rate of change depending on the dynamic.
Daniel Gebele [email protected]
Fudenberg, D. and Levine, D. K. (1998) "The Theory of Learning in Games", MIT Press.
dynamic <- Logit 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) eta <- 0.1 phaseDiagram3S(A, dynamic, eta, state, FALSE, FALSE)
dynamic <- Logit 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) eta <- 0.1 phaseDiagram3S(A, dynamic, eta, state, FALSE, FALSE)
Maynard Smith replicator dynamic as a type of evolutionary dynamics.
MSReplicator(time, state, parameters)
MSReplicator(time, state, parameters)
time |
Regular sequence that represents the time sequence under which simulation takes place. |
state |
Numeric vector that represents the initial state. |
parameters |
Numeric vector that represents parameters needed by the dynamic. |
Numeric list. Each component represents the rate of change depending on the dynamic.
Daniel Gebele [email protected]
Smith, J. M. (1982) "Evolution and the Theory of Games", Cambridge University Press.
dynamic <- MSReplicator 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, dynamic, NULL, state, FALSE, FALSE)
dynamic <- MSReplicator 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, dynamic, NULL, state, FALSE, FALSE)
Plots phase diagram of a game with two players and two strategies.
phaseDiagram2S( A, dynamic, params = NULL, vectorField = TRUE, strategies = c("1", "2") )
phaseDiagram2S( A, dynamic, params = NULL, vectorField = TRUE, strategies = c("1", "2") )
A |
Numeric matrix of size 2x2 representing the number of strategies of a symmetric matrix game. |
dynamic |
Function representing an evolutionary dynamic. |
params |
Numeric vector representing additional parameters for the evolutionary dynamic. |
vectorField |
Logical value that handles vector field presentation. If
set to |
strategies |
String vector of length 2 that names all strategies. |
None.
Daniel Gebele [email protected]
A <- matrix(c(-1, 4, 0, 2), 2, 2, byrow=TRUE) phaseDiagram2S(A, Replicator, strategies = c("Hawk", "Dove"))
A <- matrix(c(-1, 4, 0, 2), 2, 2, byrow=TRUE) phaseDiagram2S(A, Replicator, strategies = c("Hawk", "Dove"))
Plots phase diagram of a game with two players and three strategies.
phaseDiagram3S( A, dynamic, params = NULL, trajectories = NULL, contour = FALSE, vectorField = FALSE, strategies = c("1", "2", "3") )
phaseDiagram3S( A, dynamic, params = NULL, trajectories = NULL, contour = FALSE, vectorField = FALSE, strategies = c("1", "2", "3") )
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 |
vectorField |
Logical value that handles vector field presentation. If
set to |
strategies |
String vector of length 3 that names all strategies. |
None.
Daniel Gebele [email protected]
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)
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)
Plots phase diagram of a game with two players and four strategies.
phaseDiagram4S( A, dynamic, params = NULL, trajectory = NULL, strategies = c("1", "2", "3", "4"), noRGL = TRUE )
phaseDiagram4S( A, dynamic, params = NULL, trajectory = NULL, strategies = c("1", "2", "3", "4"), noRGL = TRUE )
A |
Numeric matrix of size 4x4 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. |
trajectory |
Numeric vector of size 4 representing the initial value for the trajectory to be examined. |
strategies |
String vector of length 4 that names all strategies. |
noRGL |
Logical value that handles diagram rotation. If
set to |
None.
Daniel Gebele [email protected]
A <- matrix(c(5, -9, 6, 8, 20, 1, 2, -18, -14, 0, 2, 20, 13, 0, 4, -13), 4, 4, byrow=TRUE) state <- c(0.3, 0.2, 0.1, 0.4) phaseDiagram4S(A, Replicator, NULL, state)
A <- matrix(c(5, -9, 6, 8, 20, 1, 2, -18, -14, 0, 2, 20, 13, 0, 4, -13), 4, 4, byrow=TRUE) state <- c(0.3, 0.2, 0.1, 0.4) phaseDiagram4S(A, Replicator, NULL, state)
Replicator dynamic as a type of evolutionary dynamics.
Replicator(time, state, parameters)
Replicator(time, state, parameters)
time |
Regular sequence that represents the time sequence under which simulation takes place. |
state |
Numeric vector that represents the initial state. |
parameters |
Numeric vector that represents parameters needed by the dynamic. |
Numeric list. Each component represents the rate of change depending on the dynamic.
Daniel Gebele [email protected]
Taylor, P. D. and Jonker, L. B. (1978) "Evolutionary stable strategies and game dynamics", Mathematical Biosciences 40 (1-2), pp. 145–156.
dynamic <- Replicator 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, dynamic, NULL, state, FALSE, FALSE)
dynamic <- Replicator 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, dynamic, NULL, state, FALSE, FALSE)
Smith dynamic as a type of evolutionary dynamics.
Smith(time, state, parameters)
Smith(time, state, parameters)
time |
Regular sequence that represents the time sequence under which simulation takes place. |
state |
Numeric vector that represents the initial state. |
parameters |
Numeric vector that represents parameters needed by the dynamic. |
Numeric list. Each component represents the rate of change depending on the dynamic.
Daniel Gebele [email protected]
Smith, M. J. (1984) "The Stability of a Dynamic Model of Traffic Assignment – An Application of a Method of Lyapunov", Transportation Science 18, pp. 245–252.
dynamic <- Smith 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, dynamic, NULL, state, FALSE, FALSE)
dynamic <- Smith 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, dynamic, NULL, state, FALSE, FALSE)
Generates a triangle representing the 2-simplex.
triangle(labels = c("1", "2", "3"))
triangle(labels = c("1", "2", "3"))
labels |
String vector of length 3 that names the edges of the triangle. |
List of size 2 with members coords
and canvas
.
coords
holds edge coordinates of the 2-simplex, canvas
a ggplot2 plot object of the 2-simplex.
Daniel Gebele [email protected]
triangle()
triangle()