Learn R Programming

TUvalues (version 1.1.0)

myerson: Myerson value

Description

Calculate the Myerson value in a communication game.

Usage

myerson(
  characteristic_func,
  graph_edges,
  n_players = 0,
  method = "exact",
  n_rep = 10000,
  echo = TRUE
)

Value

The Myerson value for each player.

Arguments

characteristic_func

The valued function defined on the subsets of the number of players. It can be provided as a vector or as a function.

graph_edges

Edges of the communication graph of the game. It must be a list of pairs indicating the connected players.

n_players

Only used if characteristic_func is a function. The number of players in the game.

method

Method used to calculate the Myerson value. Valid methods are: exact for the exact calculation or appro for approximated polynomial calculation based on sampling proposed.

n_rep

Only used if method is appro. The number of iterations to perform in the approximated calculation.

echo

Only used if method is appro. Show progress of the approximated calculation.

Examples

Run this code
characteristic_func <- c(
1, 2, 0, 3,
3, 1, 4, 2, 5, 3,
3, 6, 4, 5,
15
)
graph_edges <- list(c(1, 2), c(2, 4))
myerson(characteristic_func, graph_edges, method = "exact")
myerson(characteristic_func, graph_edges, method = "appro", n_rep = 1000)

v <- function(S) {
  if (length(S) == 2) {
    return(1)
   }
   return(0)
}
n <- 3
graph_edges <- list(c(1, 2))
myerson(v, graph_edges, n_players = n, method = "exact")
myerson(v, graph_edges, n_players = n, method = "appro", n_rep = 2000)

Run the code above in your browser using DataLab