fuzzySets-1.0.0: Library for constructing and manipulating fuzzy sets and fuzzy relations.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Fuzzy.Sets.Cardinality

Synopsis

Documentation

sigmaCount :: FuzzySet set a l => set -> Double Source #

Most commonly used way to tell the size of a fuzzy set. The sigma count is the sum of membership values of all elements in the universe set. For fuzzy set a |A| = Σ A(u) for all u ∈ U

Examples

Expand
>>> let set = fromPairs [(1, 0.2), (2, 0.7), (3, 0.5)] :: LSet Int UILukasiewicz
>>> sigmaCount set
1.4
>>> let emptySet = mkEmptySet :: LSet Int UILukasiewicz
>>> sigmaCount emptySet
0.0

thresholdSigmaCount :: FuzzySet set a l => l -> set -> Double Source #

Sigma count with a threshold applied. Only membership values greater or equal than the threshold are summed.

Examples

Expand
>>> let set = fromPairs [(1, 0.2), (2, 0.7), (3, 0.5)] :: LSet Int UILukasiewicz
>>> thresholdSigmaCount 0.5 set
1.2
>>> thresholdSigmaCount 0.8 set
0.0

normalizedSigmaCount :: FuzzySet set a l => set -> l Source #

Normalized sigma count is like the standard sigma count, but the value is normalized to be in the interval [0,1].

Examples

Expand
>>> let set = fromPairs [(1, 0.2), (2, 0.7), (3, 0.5)] :: LSet Int UILukasiewicz
>>> normalizedSigmaCount set
0.4666666666666667
>>> let emptySet = mkEmptySet :: LSet Int UILukasiewicz
>>> normalizedSigmaCount emptySet
0.0

sigmaCountWithModifier :: FuzzySet set a l => (l -> l) -> set -> Double Source #

Similar to sigmaCount, but applies a modifier function c to each membership value before summing. For a fuzzy set A, |A| = Σ c(A(u)) for all u ∈ U

Examples

Expand
>>> let set = fromPairs [(1, 0.2), (2, 0.7), (3, 0.5)] :: LSet Int UILukasiewicz
>>> let modifier = sigmoidModifier 2.0 0.5
>>> sigmaCountWithModifier modifier set
1.4

Modifier functions

modifierFunction :: ResiduatedLattice l => Double -> Double -> Double -> l -> l Source #

A general modifier function that can be used to create specific modifier functions. The parameters p, r, and threshold control the behavior of the modifier.

Examples

Expand
>>> let modifier = modifierFunction 2 2 0.5 :: UILukasiewicz -> UILukasiewicz
>>> modifier 0.3
0.18
>>> modifier 0.7
0.82

sigmoidModifier :: ResiduatedLattice l => Double -> Double -> l -> l Source #

A sigmoid modifier function, a specific case of modifierFunction where `p = r`.

Examples

Expand
>>> let modifier = sigmoidModifier 2 :: UILukasiewicz -> UILukasiewicz
>>> modifier 0.3
0.36
>>> modifier 0.7
0.84

identityModifier :: ResiduatedLattice l => l -> l Source #

Identity modifier function, which leaves the membership values unchanged.

Examples

Expand
>>> let modifier = identityModifier :: UILukasiewicz -> UILukasiewicz
>>> modifier 0.3
0.3
>>> modifier 0.7
0.7

subDiagonalModifier :: ResiduatedLattice l => Double -> l -> l Source #

Sub-diagonal modifier function, a specific case of modifierFunction where `r = 1`.

Examples

Expand
>>> let modifier = subDiagonalModifier 2 :: UILukasiewicz -> UILukasiewicz
>>> modifier 0.3
9.0e-2
>>> modifier 0.7
0.489999999999

alphaCutModifier :: ResiduatedLattice l => Double -> l -> l Source #

Alpha-cut modifier function, which sets membership values below the threshold to bot and values above the threshold to top.

Examples

Expand
>>> let modifier = alphaCutModifier 0.5 :: UILukasiewicz -> UILukasiewicz
>>> modifier 0.3
0.0
>>> modifier 0.7
1.0