Description Usage Arguments Details Value References Examples

Given a cooperative game, the `shapleyValue`

function
computes its Shapley value.

1 | ```
shapleyValue(n, S = NULL, v)
``` |

`n` |
number of players in the cooperative game. |

`S` |
vector with all the possible coalitions. If none has been specified the function generates it automatically. |

`v` |
vector with the characteristic function of the cooperative game. |

The Shapley value is a solution concept in cooperative game theory proposed by Lloyd Shapley in 1953. It is obtained as the average of the marginal contributions of the players associated with all the posible orders of the players.

The `shapleyValue`

functions returns a matrix with all
the marginal contributions of the players
(`contributions`

) and a vector with the Shapley value
(`value`

).

Lloyd S. Shapley. "A Value for n-person Games". In Contributions to the Theory of Games, volume II, by H.W. Kuhn and A.W. Tucker, editors. Annals of Mathematical Studies v. 28, pp. 307-317. Princeton University Press, 1953.

1 2 3 4 5 | ```
# Cooperative game
n <- 3 # players
v <- c(4, 4, 4, 8, 8, 8, 14) # characteristic function
# Shapley value
shapleyValue(n, v = v)
``` |

```
Loading required package: igraph
Attaching package: 'igraph'
The following objects are masked from 'package:stats':
decompose, spectrum
The following object is masked from 'package:base':
union
Loading required package: optrees
$contributions
[,1] [,2] [,3]
[1,] 4 4 6
[2,] 4 6 4
[3,] 4 4 6
[4,] 6 4 4
[5,] 4 6 4
[6,] 6 4 4
$value
[1] 4.666667 4.666667 4.666667
```

cooptrees documentation built on May 30, 2017, 8:11 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.