Description Usage Arguments Value Author(s) References Examples
This function gives the Shapley value introduced in Shapley (1953).
1 | Shapley_value(characteristic_function, game = c("profit", "cost"))
|
characteristic_function |
A vector with the characteristic function v(S) (or c(S), if we work with a cost game), according to the order of coalitions shown in |
game |
Characters to indicate if the game is a cost or profit game. The possibles values are |
A vector with the allocation that Shapley value (Shapley, 1953) proposes.
A. Saavedra-Nieves
Shapley, L.S. (1953). A value por n-person games. In H. Kuhn y A. Tucker (eds), Contributions to the theory of games II, Vol. 28, Annals of Mathematics Studies. Princeton University Press.
1 2 3 4 5 6 | characteristic_function<-c(1,1,2,1,2,2,2)
Shapley_value(characteristic_function,game="cost")
#[1] "Shapley Value"
# 1 2 3
# 0.3333333 0.3333333 1.333333
|
Loading required package: e1071
Loading required package: lpSolveAPI
[1] "Shapley Value"
1 2 3
0.3333333 0.3333333 1.333333
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.