Other Links:
|
What is Fuzzy Logic?Just what is Fuzzy Logic? Fuzzy Logic was actually invented by Lofti Zadeh
way back in 1965. Despite its name, Fuzzy Logic is not the science of fuzzy
thinking combined with fuzzy conclusions :-). Fuzzy Logic is a method for
modeling and reasoning about imprecise or approximate concepts. Traditional
logic, where concepts must be true or false, zero or one, has trouble at the
boundaries of a problem: Is the water hot or cold? It's neither and both, it is
somewhat hot. Fuzzy logic concerns itself with the boundaries of a concept,
things can be "somewhat true" and "sorta false". Fuzzy Logic reduces system
complexity by avoiding the complex mathematics and logic necessary to solve
problems at these boundary conditions using traditional, exists/not exists,
logic. It is able to approximate the behavior of problems that are poorly
understood or non-linear. What is Fuzzy Logic used for?Fuzzy Logic (see Fuzzy Logic Component Library), and Fuzzy Logic expert systems (see Inference Engine Component Suite), provide the ability to make your solutions more intuitive and natural, with less rules, and with greater readability and maintainability. It also makes your systems more powerful by modelling problems hard to solve using traditional techniques. Fuzzy Logic provides the following advantages for developing systems:
Fuzzy Logic is a great match for process and control engineering problems, business logic and risk analysis, and information decision support systems. For example, Fuzzy Logic can solve problems to automatically brake trains to a stop, back 18 wheeler trucks up to a loading dock, assess project risk, calculate pricing for new products, balance a pendulum, control mixing of flow of liquids, etc. Fuzzy Set TheoryAs opposed to numbers and discrete symbols, Fuzzy Logic reasons based on
fuzzy set theory. Unlike traditional sets though, where a value may either be in
(TRUE or one) or not in (False or zero) a set (a member of a set), fuzzy sets
are more flexible allowing values to have a degree of membership in the set
between zero and one. More formally, fuzzy sets are "functions that map a value,
which might be a member of a set, to a number between zero and one, indicating
its actual degree of membership." Membership values of zero indicate that a
value is not in the set, while membership values of one indicate a value is
completely in the set. Fuzzy Variable: Temperature Fuzzy Values: cold(*) 1.0000******* 0.9500 ** 0.9000 * 0.8500 * 0.8000 * 0.7500 * 0.7000 0.6500 * 0.6000 * 0.5500 0.5000 * 0.4500 0.4000 * 0.3500 * 0.3000 0.2500 * 0.2000 * 0.1500 * 0.1000 * 0.0500 ** 0.0000 ************************** |----|----|----|----|----|----|----|----|----|----| 0.00 20.00 40.00 60.00 80.00 100.00 Universe of Discourse: From 0.00 to 100.00 On the Left or y axis is the degree of membership and on the bottom or x-axis
is the universe of discourse, in this case the temperature range. A temperature
reading of 10 means that our belief that the temperature is cold is 100%. As the
temperature increases, our belief that the temperature is cold decreases until
we don't believe it at all at 50 Celsius. Note that our definition of a
linguistic variable is slightly different from what is defined in The Fuzzy
Systems Handbook by Earl Cox (highly recommended by the way). For the IECS and
FLCL, a fuzzy linguistic variable can take a fuzzy set value, which is a fuzzy
set modified by qualifiers. Our fuzzy set value is what Earl Cox defines as a
linguistic variable. Fuzzy Variable: Temperature Fuzzy Values: cold(*) very cold(+) 1.0000++++++* 0.9500 ++* 0.9000 +* 0.8500 +* 0.8000 * 0.7500 + * 0.7000 0.6500 + * 0.6000 * 0.5500 + 0.5000 * 0.4500 + 0.4000 * 0.3500 + * 0.3000 0.2500 + * 0.2000 + * 0.1500 + * 0.1000 * 0.0500 +++ ** 0.0000 +++++++++++++++++++++++++++++ |----|----|----|----|----|----|----|----|----|----| 0.00 20.00 40.00 60.00 80.00 100.00 Universe of Discourse: From 0.00 to 100.00
Fuzzy Variable: Temperature Fuzzy Values: hot or cold(*) 1.0000******* ****** 0.9500 ** ** 0.9000 * * 0.8500 * * 0.8000 * * 0.7500 * * 0.7000 0.6500 * * 0.6000 * * 0.5500 0.5000 * * 0.4500 0.4000 * * 0.3500 * * 0.3000 0.2500 * * 0.2000 * * 0.1500 * * 0.1000 * * 0.0500 ** ** 0.0000 *** |----|----|----|----|----|----|----|----|----|----| 0.00 20.00 40.00 60.00 80.00 100.00 Universe of Discourse: From 0.00 to 100.00
|
Define Fuzzy Sets using Singletons | |
Define Fuzzy Sets using Scalars or Functions | |
Modify Fuzzy Sets using Hedges | |
Define Fuzzy Sets using other Fuzzy Sets and Operations |
For our discussion, we are going to assume that a fuzzy variable,
temperature, has been defined like so:
> (ppdeftype temperature) (deftype temperature extends (type FUZZY) (range 0.0000 100.0000) (values (term low ((0.0000 1.0000) (100.0000 0.0000) )) (term medium (tri 0.0000 50.0000 100.0000)) (term high ((0.0000 0.0000) (100.0000 1.0000) )) ))
which, when graphed, looks like so:
> (plot-fuzzy-value t *+- n n temperature) Fuzzy Variable: temperature Fuzzy Values: medium(*) high(+) low(-) 1.0000-- * + 0.9500 -- * * ++ 0.9000 --- ** ** +++ 0.8500 -- * * ++ 0.8000 --- * * +++ 0.7500 -- * * ++ 0.7000 ---** **+++ 0.6500 *-- ++* 0.6000 * --- +++ * 0.5500 * -- ++ * 0.5000 ** --- ** 0.4500 * ++ -- * 0.4000 * +++ --- * 0.3500 * ++ -- * 0.3000 ** +++ --- ** 0.2500 * ++ -- * 0.2000 * +++ --- * 0.1500 * ++ -- * 0.1000 **+++ ---** 0.0500 *++ --* 0.0000++ - |----|----|----|----|----|----|----|----|----|----| 0.00 20.00 40.00 60.00 80.00 100.00 Universe of Discourse: From 0.00 to 100.00
The most simplistic way to define fuzzy sets is to define a singletons vector
of XY value pairs. The singletons vector defines a vector of XY value pairs that
control the shape of the fuzzy set. The syntax for a singletons vector is:
((x0 y0) (x1 y1)... (xN yN))
For example:
(plot-fuzzy-value t * n n
(create-fuzzy-value temperature ((20.0000 0.0000) (30.0000 0.2222) (40.0000 0.7778) (50.0000 1.0000) (60.0000 0.7778) (70.0000 0.2222) (80.0000 0.0000) )))
Fuzzy Variable: temperature
Fuzzy Values: ((20.0000 0.0000) (30.0000 0.2222) (40.0000 0.7778) (50.0000 1.0000) (60.0000 0.7778) (70.0000 0.2222) (80.0000 0.0000) )(*)
1.0000 *
0.9500 * *
0.9000 * *
0.8500 * *
0.8000 ** **
0.7500
0.7000
0.6500 * *
0.6000
0.5500 * *
0.5000
0.4500 * *
0.4000
0.3500 * *
0.3000
0.2500
0.2000 ** **
0.1500 * *
0.1000 * *
0.0500 * *
0.0000*********** **********
|----|----|----|----|----|----|----|----|----|----|
0.00 20.00 40.00 60.00 80.00 100.00
Universe of Discourse: From 0.00 to 100.00
Using singletons gives you the most control over the shape of your fuzzy set,
but it is easily the hardest method to define a fuzzy shape. You must
laboriously define every point of the fuzzy shape. Which brings us to the next
means of defining a fuzzy set shape...
Scalars (numbers) and Functions are the easiest means of defining a fuzzy set
shape.
Scalars define one point in the range of the fuzzy variable where the fuzzy set
is true, everywhere else the fuzzy set is false.
> (plot-fuzzy-value t * n n (create-fuzzy-value temperature 50)) Fuzzy Variable: temperature Fuzzy Values: 50(*) 1.0000 * 0.9500 0.9000 0.8500 0.8000 0.7500 0.7000 0.6500 0.6000 0.5500 0.5000 0.4500 0.4000 0.3500 0.3000 0.2500 0.2000 0.1500 0.1000 0.0500 0.0000************************* ************************ |----|----|----|----|----|----|----|----|----|----| 0.00 20.00 40.00 60.00 80.00 100.00 Universe of Discourse: From 0.00 to 100.00
There are some very special hedges, discussed below, which are specifically
intended to modify scalar fuzzy sets to "broaden" their truth membership range.
Functions may also be defined to return fuzzy sets or singletons. You can use a
function to mathematically define the shape of the fuzzy set curve. For example,
the singletons defined above could have also been created using the pi function:
> (plot-fuzzy-value t * n n (create-fuzzy-value temperature (pi 50 30))) Fuzzy Variable: temperature Fuzzy Values: (pi 50 30)(*) 1.0000 * 0.9500 * * 0.9000 * * 0.8500 * * 0.8000 ** ** 0.7500 0.7000 0.6500 * * 0.6000 0.5500 * * 0.5000 0.4500 * * 0.4000 0.3500 * * 0.3000 0.2500 0.2000 ** ** 0.1500 * * 0.1000 * * 0.0500 * * 0.0000*********** ********** |----|----|----|----|----|----|----|----|----|----| 0.00 20.00 40.00 60.00 80.00 100.00 Universe of Discourse: From 0.00 to 100.00
The pi function creates a singletons vector which defines a bell shaped curve
based on its inputs. In the above example, the first argument specifies the
middle of the bell shape, its high point, and the other argument specifies the
spread of the curve from the middle point. The IECS currently has 4 functions
which return fuzzy shape singletons:
s (Returns a fuzzy value using a growth curve function, i.e., the probability increases from 0 to 1 between the arguments) | |
z (Returns a fuzzy value using a decline curve function, i.e., the probability decreases from 0 to 1 between the arguments) | |
pi (Returns a typical bell curve fuzzy value, e.g., the probablities increase as the X value gets closer to the middle point) | |
beta (Another bell curve function, Returns a fuzzy value with a beta
bell curve shape, e.g., the probablities increase as the X value gets closer
to the middle point) |
The IECS and FLCL provide an important class of fuzzy modifiers called
hedges. Hedges modify the shape of a fuzzy set in predictable ways. For
example, the very hedge modifies a fuzzy set by pushing all values less
than one towards zero. This has the effect of shrinking the boundary, the fuzzy
portion, of the set closer to the area that is completely in the set:
> (plot-fuzzy-value t *+ n n (create-fuzzy-value temperature (pi 50 30)) (create-fuzzy-value temperature very (pi 50 30)))
Fuzzy Variable: temperature
Fuzzy Values: (pi 50 30)(*) very [(pi 50 30)](+)
1.0000 +
0.9500 * *
0.9000 *+ +*
0.8500 *+ +*
0.8000 ** **
0.7500 + +
0.7000 + +
0.6500 * *
0.6000 + +
0.5500 * *
0.5000 + +
0.4500 * *
0.4000 + +
0.3500 * *
0.3000
0.2500 + +
0.2000 ** **
0.1500 * + + *
0.1000 * *
0.0500 * +++ +++ *
0.0000+++++++++++++ ++++++++++++
|----|----|----|----|----|----|----|----|----|----|
0.00 20.00 40.00 60.00 80.00 100.00
Universe of Discourse: From 0.00 to 100.00
The curve defined by the plus signs in the graph above defines the fuzzy set
value, very (pi 50 30). Hedges are very powerful because they are
predictable as well as intuitive. Intuitively, if we imagine that (pi 50 30)shape defines the fuzzy set term, warm (e.g., it is definitely warm
at 50, as the temperature decreases it gets less warm and more cold, as the
temperature increases, it gets more hot), then when we think of a very warm
temperature, we want the value to be the proto-typical value of warm, closer to
warm. A temperature of 40 is certainly a member of warm, but it should
definitely be less of a member of very warm, which is what occurs.
The hedges in the IECS and FLCL come as unary operators, such as very warmor not warm, and as operands, such as warm + 0.5 or cold - 0.3.
The following hedges are available in the IECS and FLCL:
Add - Adds value to X or Y of the shape (+ (modifies Y component) +X (modifies X component)): low + 0.5, low +X 30 | |
Subtract - Subtracts value from X or Y of the shape (- (modifies Y component) -X (modifies X component)): low - 0.5, low -X 30 | |
Multiply - Multiplies value with X or Y of the shape (* (modifies Y component) *X (modifies X component)): low * 0.5, low *X 5 | |
Divide - Divides X or Y of the shape by value (/ (modifies Y component) /X (modifies X component)): low / 0.5, low /X 30 | |
Power - Raises X or Y of the shape to the power of value (^ (modifies Y component) ^X (modifies X component)): low ^ 0.5, low ^X 2 | |
CutLess - X or Y shape values less than value are set equal to value (< (modifies Y component) <X (modifies X component)): low < 0.5, low <X 30 | |
CutLessEq - X or Y shape values less than or equal to value are set equal to value (<= (modifies Y component) <=X (modifies X component)): low <= 0.5, low <=X 30 | |
CutGreater - X or Y shape values greater than value are set equal to value (> (modifies Y component) >X (modifies X component)): low > 0.5, low >X 30 | |
CutGreaterEq - X or Y shape values greater than or equal to value are set equal to value (>= (modifies Y component) >=X (modifies X component)): low >= 0.5, low >=X 30 | |
Not - Inverts fuzzy shape (not): not low | |
Somewhat, MoreOrLess, Greatly, Plus, Very, Extremely - Intensifies fuzzy shape by different amounts (somewhat, moreorless, greatly, plus, very, extremely): somewhat medium | |
Above - Invert truth membership above (to the right) the high point of the fuzzy shape, works best with fuzzy shapes that have one maximum (above): above medium | |
Below - Invert truth membership below (to the left) the high point of the fuzzy shape, works best with fuzzy shapes that have one maximum (below): below medium | |
Slightly - Increases truth membership at borders of fuzzy shape, decreases everywhere else (slightly): slightly medium | |
Normalize - Normalizes the fuzzy shape, stretches the fuzzy shape so that the maximum Y value equals 1 and everything else scales proportionately (normalize): normalize [low > 0.3] | |
About, VicinityOf, Close, Near, Neighboring - Approximation Hedges (about, vicinity, close, near, neighboring): about 50 | |
Positively, Absolutely, Definitely - Contrast Intensification Hedges (positively, absolutely, definitely): absolutely medium | |
Generally - Diffusion (reduces contrast or wildly varying values)
Hedge (generally): generally low |
Note that the hedges about, vicinity (of), close, near,
and neighboring are called approximation hedges. They are
excellent hedges for modify scalar values, e.g., about 50 degrees. The hedges
positively, absolutely, and definitely are called contrast
intensification hedges as they intensify the contrast; all Y values are
pushed closer to 0 or 1. The Generally hedge is the opposite, it is a
contrast diffusion hedge.
As we mentioned, the approximation hedges are particularly good at modifying
scalars, e.g., about 50:
> (plot-fuzzy-value t *+ n n (create-fuzzy-value temperature about 50)) Fuzzy Variable: temperature Fuzzy Values: about 50(*) 1.0000 * 0.9500 0.9000 * * 0.8500 0.8000 0.7500 0.7000 0.6500 * * 0.6000 0.5500 0.5000 0.4500 * * 0.4000 0.3500 0.3000 * * 0.2500 0.2000 * * 0.1500 * * 0.1000 *** *** 0.0500 ****** ****** 0.0000********** ********* |----|----|----|----|----|----|----|----|----|----| 0.00 20.00 40.00 60.00 80.00 100.00 Universe of Discourse: From 0.00 to 100.00
The final way to make fuzzy sets/values/terms is to create the fuzzy set by
combining other fuzzy sets. The simplest operations are and and or. What does it
mean to make fuzzy expressions using and and or? Lofti Zadeh (father of fuzzy
logic) defined the AND operator for fuzzy sets to mean taking the intersection
of the two sets, or the minimum values in the sets. The OR operator is the
opposite, taking the union of the two sets, or the maximum values in the sets.
The following example helps make it clear. When we talk about whether a value is
high OR low, we can see it is very likely that a value could be high or could be
low, where only in the mid range between the two concepts does the likelihood
decrease. The maximum of the two sets captures this meaning perfectly:
> (plot-fuzzy-value t *+ n n (create-fuzzy-value temperature high or low)) Fuzzy Variable: temperature Fuzzy Values: high or low(*) 1.0000** * 0.9500 ** ** 0.9000 *** *** 0.8500 ** ** 0.8000 *** *** 0.7500 ** ** 0.7000 *** *** 0.6500 ** ** 0.6000 *** *** 0.5500 ** ** 0.5000 *** 0.4500 0.4000 0.3500 0.3000 0.2500 0.2000 0.1500 0.1000 0.0500 0.0000 |----|----|----|----|----|----|----|----|----|----| 0.00 20.00 40.00 60.00 80.00 100.00 Universe of Discourse: From 0.00 to 100.00
Besides Zadeh's methods, the IECS and FLCL support other operations for
intersection and union
Intersection | Keyword | Union | Keyword | |
foZadeh: | MinValue([Y1,Y2]) | and | MaxValue([Y1,Y2]) | or |
foMean: | (Y1+Y2)/2 | and-mean | (2*MinValue([Y1,Y2])+4*MaxValue([Y1, Y2]))/6 | or-mean |
foMeanSqr: | Sqr((Y1+Y2)/2) | and-meansqr | Sqr((Y1+Y2)/2) | or-meansqr |
foMeanSqrt: | Sqrt((Y1+Y2)/2) | and-meansqrt | Sqrt((Y1+Y2)/2) | or-meansqrt |
foProduct: | y1*y2 | and-product | (y1+y2)-y1*y2 | or-product |
foBoundedSum: | MaxValue([0,y1+y2-1]) | and-boundedsum | MinValue([1,y1+y2]) | or-boundedsum |
foSum: | NA | and-sum | y1+y2 | or-sum |
You can create fuzzy expressions combining the operations, hedges, and
singletons in as elaborate ways as you wish. The bracket characters, [ and ],
enable you to define the precedence of operations, e.g., very [warm or hot]or [very warm] or hot.
Send mail to
webmasterNO@SPAMRiverSoftAVG.com with questions or comments about this web
site. |