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

Fuzzy.Sets.MembershipFunctions

Description

This module contains parametrized membership function use currying to construct the functions arguments a b c ... are parameters for constructing specific functions x is the variable for which membership is evaluated

Synopsis

Documentation

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

Constant function that returns a for any value of x f(x)=a

Examples

Expand
>>> let f = constant 0.5 :: Double -> UILukasiewicz
>>> f 1
0.5
>>> f 100
0.5

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

Standart textbook linear function where f(x)=ax+b

          / 
         /   
        /

Examples

Expand
>>> let f = linear 2 1 :: Double -> UILukasiewicz
>>> f 0
1.0
>>> f 1
3.0
>>> f (-1)
-1.0

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

Standart logistic function Takes K which is growth value of the function and x0 a midpoint of the function. f(x)=11+ek(xx0)

                      ______
                   .´      
                 /           
          _____.'       

Examples

Expand
>>> let f = sigmoid 1 0 :: Double -> UILukasiewicz
>>> f 0
0.5
>>> f 1
0.7310585786300049
>>> f (-1)
0.2689414213699951

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

A combination of two linear functions with this specific shape. first and second arguments are interval determining where the triangle will be on the number line. tri(x)={xaba,ax<bcxcb,bxc0,otherwise 0 stands for bot

         
            /\
         __/  \__

Examples

Expand
>>> let f = triangular 0 1 2 :: Double -> UILukasiewicz
>>> f 0
0.0
>>> f 0.5
0.5
>>> f 1
1.0
>>> f 1.5
0.5
>>> f 2
0.0

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

Constant function on interval [a, b], first two arguments, else returns bot of Residuated lattice - this creates a rectangle shaped function. Third argument is height of the set.

            _____ 
           |     |
        ___|     |___
>>> let f = rectangular 1 3 0.8 :: Double -> UILukasiewicz
>>> f 0
0.0
>>> f 2
0.8
>>> f 3
0.8
>>> f 4
0.0

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

Trapezoidal function is combination of triangular and rectangular functions tra(x)={xab1a,ax<b11,b1x<b2cxcb2,b2x<c0,otherwise

          _______   
         /       \
      __/         \__

Examples

Expand
>>> let f = trapezoidal 0 1 3 4 :: Double -> UILukasiewicz
>>> f 0
0.0
>>> f 0.5
0.5
>>> f 1
1.0
>>> f 2
1.0
>>> f 3.5
0.5
>>> f 4
0.0

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

Gausian function, also called Bell Curve

          
                    .-' `-.
                  .'       `.
                 /           \
               /               \
       ______.'                 '.____

Examples

Expand
>>> let f = gaussian 1 0 1 :: Double -> UILukasiewicz
>>> f 0
1.0
>>> f 1
0.6065306597126334
>>> f (-1)
0.6065306597126334
>>> f 2
0.1353352832366127

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

Exponential function eˣ

          
                   |
                  '  
                 /   
                /     
       ______.'   

Examples

Expand
>>> let f = exponential :: Double -> UILukasiewicz
>>> f 0
1.0
>>> f 1
2.718281828459045
>>> f (-1)
0.36787944117144233