kappalab (version 0.4-7)

set.func-class: Class "set.func"

Description

Class representing a set function.

Arguments

Objects from the Class

Objects can be created by calls to the function set.func.

Slots

n:
Object of class numeric of length 1 equal to the number of elements of the set on which the set function is defined.
subsets:
Object of class numeric of length 2^n containing the power set of the underlying set in "natural" order. The subsets are coded as integers.
data:
Object of class numeric of length 2^n containing the coefficients of the set function in binary order.

Extends

Class superclass.set.func, directly.

Methods

show
signature(object = "set.func")
as.game
signature(object = "set.func")
as.capacity
signature(object = "set.func")
as.card.set.func
signature(object = "set.func")
as.Mobius.set.func
signature(object = "set.func")
as.Mobius.card.set.func
signature(object = "set.func")
conjugate
signature(object = "set.func")
interaction.indices
signature(object = "set.func")
is.cardinal
signature(object = "set.func")
is.kadditive
signature(object = "set.func", k = "numeric")
is.monotone
signature(object = "set.func")
k.truncate.Mobius
signature(object = "set.func", k = "numeric")
Mobius
signature(object = "set.func")
Shapley.value
signature(object = "set.func")
to.data.frame
signature(object = "set.func")

See Also

set.func, as.game-methods, as.capacity-methods, as.card.set.func-methods, as.Mobius.set.func-methods, as.Mobius.card.set.func-methods, conjugate-methods, interaction.indices-methods, is.cardinal-methods, is.kadditive-methods, is.monotone-methods, k.truncate.Mobius-methods, Mobius-methods, Shapley.value-methods, to.data.frame-methods.

Examples

Run this code
## a set function
mu <- set.func(c(1:8,8:1)/8)

## the attributes of the object
mu@n
mu@data
mu@subsets

## some conversions that cannot work
## Not run: as.game(mu)
## Not run: as.capacity(mu)
## Not run: as.card.set.func(mu)

## some tests
is.cardinal(mu)
is.kadditive(mu,2)
is.monotone(mu)

## some transformations
conjugate(mu)
Mobius(mu)
k.truncate.Mobius(mu,2)

## summary 
Shapley.value(mu)
interaction.indices(mu)
# the same
summary(mu)

## save the set function to a file
d <- to.data.frame(mu)
write.table(d,"my.set.func.csv",sep="\t")

# finally, some conversions that should work
mu <- set.func(c(0,1,1,1,2,2,2,3))
as.game(mu)
as.capacity(mu)
as.card.set.func(mu)

Run the code above in your browser using DataLab