Calculates the Shapley value for a N-agent cooperative game.
Usage
ShapleyValue(x, Names = NULL)
Arguments
x
object of class Game
Names
Labels of the agents
Details
Please check ShapleyShubik for an extension to voting power index.
Author(s)
Sebastian Cano-Berlanga <cano.berlanga@gmail.com>
References
Shapley L (1953). A value for n-person games. In Tucker A, Kuhn H (Eds.), Contributions to the theory of games II (pp. 307-317). Princeton University Press: Princeton NJ.
Examples
# Begin defining the game
COALITIONS <- c(46125,17437.5,5812.5,69187.5,53812.5,30750,90000)
LEMAIRE<-DefineGame(3,COALITIONS)
# End defining the game
NAMES <- c("Investor 1","Investor 2","Investor 3")
LEMAIRESHAPLEY <- ShapleyValue(LEMAIRE,NAMES)
summary(LEMAIRESHAPLEY)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(GameTheory)
Loading required package: lpSolveAPI
Loading required package: combinat
Attaching package: 'combinat'
The following object is masked from 'package:utils':
combn
Loading required package: gtools
Loading required package: ineq
Loading required package: kappalab
Loading required package: lpSolve
Loading required package: quadprog
Loading required package: kernlab
Attaching package: 'kappalab'
The following object is masked from 'package:ineq':
entropy
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GameTheory/ShapleyValue.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ShapleyValue
> ### Title: Shapley Value Solution
> ### Aliases: ShapleyValue
>
> ### ** Examples
>
>
>
>
> # Begin defining the game
>
> COALITIONS <- c(46125,17437.5,5812.5,69187.5,53812.5,30750,90000)
> LEMAIRE<-DefineGame(3,COALITIONS)
>
> # End defining the game
>
> NAMES <- c("Investor 1","Investor 2","Investor 3")
> LEMAIRESHAPLEY <- ShapleyValue(LEMAIRE,NAMES)
> summary(LEMAIRESHAPLEY)
Shapley Value for the given game
Shapley Value
Investor 1 51750
Investor 2 25875
Investor 3 12375
>
>
>
>
>
>
> dev.off()
null device
1
>