Learn R Programming

TUGLab (version 0.0.1)

marginalvector: Marginal contributions vector

Description

Given a game and a permutation, this function returns the corresponding marginal contributions vector.

Usage

marginalvector(v, binary = FALSE, permutation)

Value

The vector of marginal contributions.

Arguments

v

A characteristic function, as a vector.

binary

A logical value. By default, binary=FALSE. Should be set to TRUE if v is introduced in binary order instead of lexicographic order.

permutation

Position of the permutation in the Lehmer code order, as an integer.

Details

Given a game \(v\in G^N\) and an order \(\pi\) of the players in \(N\), the marginal contributions associated with order \(\pi\) is defined, for all \(i \in N\), as \(m_i^{\pi}=v(Pre^{\pi}(i)\cap i)-v(Pre^{\pi}(i))\), being \(Pre^{\pi}(i)=\{j:\pi(j)<\pi(i)\}\).

See Also

getpermutation, getpermutationnumber

Examples

Run this code
n <- 3
v <- c(1, 5, 10, 30, 60, 90, 200)
for (i in 1:factorial(n)) {
  cat("[", i, "]", paste(getpermutation(3,i)),"  ",
  paste(marginalvector(v,binary=FALSE,i)), "\n")
}

Run the code above in your browser using DataLab