Calculates the Shapley Value for a N-agent cooperative game.
shapleyValue(game, show.data = FALSE)
a vector that represents the cooperative game.
logical value indicating if the function displays the
console output (TRUE
) or not (FALSE
). By default the
value is FALSE
.
shapleyValue
returns and prints the Shapley Value
of associated cooperative game.
# NOT RUN {
# Cooperative game
game <- c(68, 102, 0, 170, 710, 762, 992)
# Shapley Value
shapleyValue(game, show.data = TRUE)
# -----------------------------
# Shapley Value Solution:
# -----------------------------
# [1] "(229, 272, 491)"
# }
Run the code above in your browser using DataLab