GithubHelp home page GithubHelp logo

ianmadlenya / r-heuristic-games Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phelps-sg/r-heuristic-games

0.0 1.0 0.0 45 KB

An R package called empiricalGameTheory which provides methods for analysing heuristic games using empirical game-theory.

R 100.00%

r-heuristic-games's Introduction

Provides an R package called empiricalGameTheory for analysing heuristic games using empirical game theory (Wellman 2006).

Installation

R CMD INSTALL empiricalGameTheory

Example usage

library(empiricalGameTheory)

# Payoff matrix for Rock, Paper, Scissors
payoff.matrix.rps <- matrix( c(
	0, 0, 2,  0,  0,  0,
	0, 1, 1,  0, -1,  1,
	2, 0, 0,  0,  0,  0,
	1, 1, 0, -1,  1,  0,
	0, 2, 0,  0,  0,  0,
	1, 0, 1,  1,  0, -1),
	    ncol = 6, byrow=T)

# Encapsulate in a HeuristicGame object
game.rps <- HeuristicGameFromPayoffMatrix(payoff.matrix.rps, strategies = c('R', 'P', 'S'))

# Generate the initial values for the replicator dynamics ODE
initial.values.random <- GenerateRandomInitialValues()

# Integrate from t=0 to t=100 in steps of delta_t = 1/100
times.rd <- seq(0, 100, by=0.01)

# Integrate the replicator dynamics ODE for each initial value
game.rps.analysed <- Analyse(game.rps, initial.values = initial.values.random, times = times.rd)

# Plot the resulting phase-space
plot(game.rps.analysed)

For a more complete example of analysing an actual agent-based model, see this example in which we analyse a financial market model implemented in the JASA framework.

References

Wellman, M. P. (2006). Methods for Empirical Game-Theoretic Analysis. In Twenty-First National Conference on Artificial Intelligence (AAAI-06) (pp. 1152โ€“1155). Boston, Massachusetts.

r-heuristic-games's People

Contributors

phelps-sg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.