Learn R Programming

TUvalues (version 0.1.0)

banzhaf_owen: Banzhaf-Owen value

Description

Calculate the Banzhaf-Owen value

Usage

banzhaf_owen(
  characteristic_func,
  union,
  method = "exact",
  n_rep = 10000,
  n_players = 0,
  replace = TRUE
)

Value

The Banzhaf-Owen value for each player

Arguments

characteristic_func

The valued function defined on the subsets of the number of players

union

List of vectors indicating the a priori unions between the players

method

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

n_rep

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

n_players

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

replace

should sampling be with replacement?

Examples

Run this code
characteristic_func <- c(0,0,0,0,30,30,40,40,50,50,60,70,80,90,100)
union <- list(c(1,3),c(2),c(4))
banzhaf_owen(characteristic_func, union)
banzhaf_owen(characteristic_func, union, method = "appro", n_rep = 4000)

Run the code above in your browser using DataLab