Learn R Programming

kappalab (version 0.4-0)

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

Description

Class representing a cardinal set function, i.e. whose values depend only on the cardinality of subsets.

Arguments

Objects from the Class

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

Extends

Class superclass.set.func, directly.

See Also

set.func-class, card.set.func, as.card.game-methods, as.card.capacity-methods, as.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, Mobius-methods, Shapley.value-methods, to.data.frame-methods.

Examples

Run this code
## a cardinal set function
mu <- card.set.func(-3:2)

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

## some conversions that cannot work
as.card.game(mu)
as.card.capacityfunc(mu)

## the following should work
as.set.func(mu)

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

## some transformations
conjugate(mu)
Mobius(mu)
## let us check ...
zeta(Mobius(mu))

## 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.card.set.func.csv",sep="t")

# finally, some other conversions that should work
mu <- card.set.func(0:5)
as.card.game(mu)
as.card.capacity(mu)

Run the code above in your browser using DataLab