Join us for
RADAR: AI Edition

coopProductGame (version 2.0)

shapleyValue: Shapley Value Solution

Description

Calculates the Shapley Value for a N-agent cooperative game.

Usage

shapleyValue(game, show.data = FALSE)

Arguments

game

a vector that represents the cooperative game.

show.data

logical value indicating if the function displays the console output (TRUE) or not (FALSE). By default the value is FALSE.

Value

shapleyValue returns and prints the Shapley Value of associated cooperative game.

Examples

Run this code
# 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