Up until now, we have discussed how fuzzy logic could be used in conjunction with neural networks: We looked at a fuzzifier in Chapter A Look at Fuzzy Logic that takes crisp input data and creates fuzzy outputs, which then could be used as inputs to a neural network. In chapter 9, we used fuzzy logic to create a special type of associative memory called a FAM (fuzzy associative memory). In this chapter, we focus on applications of fuzzy logic by itself. This chapter starts with an overview of the different types of application areas for fuzzy logic. We then present two application domains of fuzzy logic: fuzzy control systems, and fuzzy databases and quantification. In these sections, we also introduce some more concepts in fuzzy logic theory.
Fuzzy logic is being applied to a wide variety of problems. The most pervasive field of influence is in control systems, with the rapid acceptance of fuzzy logic controllers (FLCs) for machine and process control. There are a number of other areas where fuzzy logic is being applied. Here is a brief list adapted from Yan, et al., with examples in each area:
• Biological and Medical Sciences Fuzzy logic based diagnosis systems, cancer research, fuzzy logic based manipulation of prosthetic devices, fuzzy logic based analysis of movement disorders, etc.
• Management and Decision Support Fuzzy logic based factory site selection, fuzzy logic aided military decision making (sounds scary, but remember that the fuzzy in fuzzy logic applies to the imprecision in the data and not in the logic), fuzzy logic based decision making for marketing strategies, etc.
• Economics and Finance Fuzzy modeling of complex marketing systems, fuzzy logic based trading systems, fuzzy logic based cost-benefit analysis, fuzzy logic based investment evaluation, etc.
• Environmental Science Fuzzy logic based weather prediction, fuzzy logic based water quality control, etc.
• Engineering and Computer Science Fuzzy database systems, fuzzy logic based prediction of earthquakes, fuzzy logic based automation of nuclear plant control, fuzzy logic based computer network design, fuzzy logic based evaluation of architectural design, fuzzy logic control systems, etc.
• Operations Research Fuzzy logic based scheduling and modeling, fuzzy logic based allocation of resources, etc.
• Pattern Recognition and Classification Fuzzy logic based speech recognition, fuzzy logic based handwriting recognition, fuzzy logic based facial characteristic analysis, fuzzy logic based military command analysis, fuzzy image search, etc.
• Psychology Fuzzy logic based analysis of human behavior, criminal investigation and prevention based on fuzzy logic reasoning, etc.
• Reliability and Quality Control Fuzzy logic based failure diagnosis, production line monitoring and inspection, etc.
We will now move to one of the two application domains that we will discuss in depth, Fuzzy Databases. Later in the chapter, we examine the second application domain, Fuzzy Control Systems.
In this section, we want to look at some ways in which fuzzy logic may be applied to databases and operations with databases. Standard databases have crisp data sets, and you create unambiguous relations over the data sets. You also make queries that are specific and that do not have any ambiguity. Introducing ambiguity in one or more of these aspects of standard databases leads to ideas of how fuzzy logic can be applied to databases. Such application of fuzzy logic could mean that you get databases that are easier to query and easier to interface to. A fuzzy search, where search criteria are not precisely bounded, may be more appropriate than a crisp search. You can recall any number of occasions when you tend to make ambiguous queries, since you are not certain of what you need. You also tend to make ambiguous queries when a “ball park” value is sufficient for your purposes.
In this section, you will also learn some more concepts in fuzzy logic. You will see these concepts introduced where they arise in the discussion of ideas relating to fuzzy databases. You may at times see somewhat of a digression in the middle of the fuzzy database discussion to fuzzy logic topics. You may skip to the area where the fuzzy database discussion is resumed and refer back to the skipped areas whenever you feel the need to get clarification of a concept.
We will start with an example of a standard database, relations and queries. We then point out some of the ways in which fuzziness can be introduced.
Imagine that you are interested in the travel business. You may be trying to design special tours in different countries with your own team of tour guides, etc. , and you want to identify suitable persons for these positions. Initially, let us say, you are interested in their own experiences in traveling, and the knowledge they possess, in terms of geography, customs, language, and special occasions, etc. The information you want to keep in your database may be something like, who the person is, the person’s citizenship, to where the person traveled, when such travel occurred, the length of stay at that destination, the person’s languages, the languages the person understands, the number of trips the person made to each place of travel, etc. Let us use some abbreviations:
|
cov—country visited |
|
lov—length of visit (days) |
|
nov—number of visits including previous visits |
|
ctz—citizenship |
|
yov—year of visit |
|
lps—language (other than mother tongue) with proficiency to speak |
|
lpu—language with only proficiency to understand |
|
hs—history was studied (1—yes, 0—no) |
Typical entries may appear as noted in table:
|
Example Database |
|||||||||
|
Name |
age |
Ctz |
cov |
lov |
nov |
yov |
lps |
lpu |
hs |
|
John Smith |
35 |
U.S. |
India |
4 |
1 |
1994 |
|
Hindi |
1 |
|
John Smith |
35 |
U.S. |
Italy |
7 |
2 |
1991 |
Italian |
|
1 |
|
John Smith |
35 |
U.S. |
Japan |
3 |
1 |
1993 |
|
|
0 |
When a query is made to list persons that visited India or Japan after 1992 for 3 or more days, John Smith’s two entries will be included. The conditions stated for this query are straightforward, with lov [ge] 3 and yov > 1992 and (cov = India or cov = Japan).
A relation from this database may be the set of quintuples, (name, age, cov, lov, yov). Another may be the set of triples, (name, ctz, lps). The quintuple (John Smith, 35, India, 4, 1994) belongs to the former relation, and the triple (John Smith, U.S., Italian) belongs to the latter. You can define other relations, as well.
Now the query part may be made fuzzy by asking to list young persons who recently visited Japan or India for a few days. John Smith’s entries may or may not be included this time since it is not clear if John Smith is considered young, or whether 1993 is considered recent, or if 3 days would qualify as a few days for the query. This modification of the query illustrates one of three scenarios in which fuzziness can be introduced into databases and their use.
This is the case where the database and relations are standard, but the queries may be fuzzy. The other cases are: one where the database is fuzzy, but the queries are standard with no ambiguity; and one where you have both a fuzzy database and some fuzzy queries.
We will illustrate the concept of fuzziness in the case where the database and the queries have fuzziness in them. Our discussion is guided by the reference Terano, Asai, and Sugeno. First, let us review and recast the concept of a fuzzy set in a slightly different notation.
If a, b, c, and d are in the set A with 0.9, 0.4, 0.5, 0, respectively, as degrees of membership, and in B with 0.9, 0.6, 0.3, 0.8, respectively, we give these fuzzy sets A and B as A = { 0.9/a, 0.4/b, 0.5/c} and B = {0.9/a, 0.6/b, 0.3/c, 0.8/d}. Now A[cup]B = {0.9/a, 0.6/b, 0.5/c, 0.8/d} since you take the larger of the degrees of membership in A and B for each element. Also, A[cap]B = {0.9/a, 0.4/b, 0.3/c} since you now take the smaller of the degrees of membership in A and B for each element. Since d has 0 as degree of membership in A (it is therefore not listed in A), it is not listed in A[cap]B.
Let us impart fuzzy values (FV) to each of the attributes, age, lov, nov,
yov, and hs by defining the sets in table:
|
Fuzzy Values for Example
Sets |
|
|
Fuzzy Value |
Set |
|
FV(age) |
{ very young, young, somewhat old, old } |
|
FV(nov) |
{ never, rarely, quite a few, often, very often } |
|
FV(lov) |
{ barely few days, few days, quite a few days, many days } |
|
FV(yov) |
{distant past, recent past, recent } |
|
FV(hs) |
{ barely, adequately, quite a bit, extensively } |
The attributes of name, citizenship, country of visit are clearly not
candidates for having fuzzy values. The attributes of lps, and lpu, which stand
for language in which speaking proficiency and language in which understanding
ability exist, can be coupled into another attribute called flp (foreign
language proficiency) with fuzzy values. We could have introduced in the original
list an attribute called lpr ( language with proficiency to read) along
with lps and lpu. As you can see, these three can be taken
together into the fuzzy-valued attribute of foreign language proficiency. We
give below the fuzzy values of flp.
FV(flp) = {not proficient, barely proficient, adequate,proficient, very proficient }
Note that each fuzzy value of each attribute gives rise to a fuzzy set, which depends on the elements you consider for the set and their degrees of membership.
Now
let us determine the fuzzy sets that have John Smith as an element, besides
possibly others. We need the values of degrees of membership for John Smith
(actually his attribute values) in various fuzzy sets. Let us pick them as
follows:
——————————————————————————————————————————————————————————————————————————
Age: mvery young(35) = 0 (degree of membership of 35 in very young is 0. We will employ this notation from now on). myoung(35) = 0.75 msomewhat old(35) = 0.3 mold(35) = 0——————————————————————————————————————————————————————————————————————————
Assume
that similar values are assigned to the degrees of membership of values of John
Smith’s attributes in other fuzzy sets. Just as John Smith’s age
does not belong in the fuzzy sets young and old, some of his other attribute
values do not belong in some of the other fuzzy sets. The following is a list
of fuzzy sets in which John Smith appears:
age_young = {0.75/35, ...}age_somewhat old = {0.3/35, ... }
A similar statement attempted for the number of visits may prompt you to list nov_rarely = {0.7/1, 0.2/2}, and nov_quite a few = {0.3/2, .6/3, ...}. But you readily realize that the number of visits by itself does not mean much unless it is referenced with the country of visit. A person may visit one country very often, but another only rarely. This suggests the notion of a fuzzy relation, which is also a fuzzy set.
NOTE: What follows is an explanation of relations and discussion of fuzzy
relations. If you want to skip this part for now, you may go to the
“Fuzzy Queries” section a few pages later in this chapter.
A standard relation from set A to set B is a subset of the Cartesian product of A and B, written as A×B. The elements of A×B are ordered pairs (a, b) where a is an element of A and b is an element of B. For example, the ordered pair (Joe, Paul) is an element of the Cartesian product of the set of fathers, which includes Joe and the set of sons which includes Paul. Or, you can consider it as an element of the Cartesian product of the set of men with itself. In this case, the ordered pair (Joe, Paul) is in the subset which contains (a, b, if a is the father of b. This subset is a relation on the set of men. You can call this relation “father.”
A
fuzzy relation is similar to a standard relation, except that the resulting
sets are fuzzy sets. An example of such a relation is
‘much_more_educated’. This fuzzy set may look something like,
much_more_educated = { ..., 0.2/(Jeff, Steve), 0.7/(Jeff, Mike), ... }
A
fuzzy relation can be given as a matrix also when the underlying sets, call
them domains, are finite. For example, let the set of men be S = { Jeff,
Steve, Mike }, and let us use the same relation, much_more_educated. For each
element of the Cartesian product S×S, we need the degree of
membership in this relation. We already have two such values, mmuch_more_educated(Jeff,
Steve) = 0.2, and mmuch_more_educated(Jeff, Mike) = 0.7. What degree
of membership in the set should we assign for the pair (Jeff, Jeff)? It seems
reasonable to assign a 0. We will assign a 0 whenever the two members of the
ordered pair are the same. Our relation much_more_educated is given by a matrix
that may look like the following:
0/(Jeff, Jeff) 0.2/(Jeff, Steve) 0.7/(Jeff, Mike)
much_more_educated = 0.4/(Steve, Jeff) 0/(Steve, Steve) 0.3/(Steve, Mike)0.1/(Mike, Jeff) 0.6/(Mike, Steve) 0/(Mike, Mike)
NOTE: Note that the first row corresponds to ordered pairs
with Jeff as the first member, second column corresponds to those with Steve as
the second member, and so on. The main diagonal has ordered pairs where the first
and second members are the same.
A relation on a set, that is a subset of a Cartesian product of some set with itself, may have some interesting properties. It may be reflexive. For this you need to have 1 for the degree of membership of each main diagonal entry. Our example here is evidently not reflexive.
A relation may be symmetric. For this you need the degrees of membership of each pair of entries symmetrically situated to the main diagonal to be the same value. For example (Jeff, Mike) and (Mike, Jeff) should have the same degree of membership. Here they do not, so our example of a relation is not symmetric.
A relation may be antisymmetric. This requires that if a is different from b and the degree of membership of the ordered pair (a, b) is not 0, then its mirror image, the ordered pair (b, a), should have 0 for degree of membership. In our example, both (Steve, Mike) and (Mike, Steve) have positive values for degree of membership; therefore, the relation much_more_educated over the set {Jeff, Steve, Mike} is not antisymmetric also.
A
relation may be transitive. For transitivity of a relation, you need the
following condition, illustrated with our set {Jeff, Steve, Mike}. For brevity,
let us use r in place of much_more_educated, the name of the relation:
min (mr(Jeff, Steve) , mr(Steve, Mike) )[le]mr(Jeff, Mike) min (mr(Jeff, Mike) , mr(Mike, Steve) )[le]mr(Jeff, Steve) min (mr(Steve, Jeff) , mr(Jeff, Mike) )[le]mr(Steve, Mike) min (mr(Steve, Mike) , mr(Mike, Jeff) )[le]mr(Steve, Jeff) min (mr(Mike, Jeff) , mr(Jeff, Steve) )[le]mr(Mike, Steve)min (mr(Mike, Steve) , mr(Steve, Jeff) )[le]mr(Mike, Jeff)
In the above listings, the ordered pairs on the left-hand side of an occurrence of [le] are such that the second member of the first ordered pair matches the first member of the second ordered pair, and also the right-hand side ordered pair is made up of the two nonmatching elements, in the same order.
In
our example,
min (mr(Jeff, Steve) , mr(Steve, Mike) ) = min (0.2, 0.3) = 0.2mr(Jeff, Mike) = 0.7 > 0.2
For
this instance, the required condition is met. But in the following:
min (mr(Jeff, Mike), mr(Mike, Steve) ) = min (0.7, 0.6) = 0.6mr(Jeff, Steve) = 0.2 < 0.6
The required condition is violated, so the relation much_more_educated is not transitive.
NOTE: If a condition defining a property of a relation is not met even in one
instance, the relation does not possess that property. Therefore, the relation
in our example is not reflexive, not symmetric, not even antisymmetric, and not
transitive.
If you think about it, it should be clear that when a relation on a set of more than one element is symmetric, it cannot be antisymmetric also, and vice versa. But a relation can be both not symmetric and not antisymmetric at the same time, as in our example.
An
example of reflexive, symmetric, and transitive relation is given by the
following matrix:
1 0.4 0.8
0.4 1 0.4
0.8 0.4 1
A reflexive, symmetric, and transitive fuzzy relation is said to be a fuzzy equivalence relation. Such a relation is also called a similarity relation. When you have a similarity relation s, you can define the similarity class of an element x of the domain as the fuzzy set in which the degree of membership of y in the domain is ms(x, y). The similarity class of x with the relation s can be denoted by [x]s.
Do you think similarity and resemblance are one and the same? If x is similar to y, does it mean that x resembles y? Or does the answer depend on what sense is used to talk of similarity or of resemblance? In everyday jargon, Bill may be similar to George in the sense of holding high office, but does Bill resemble George in financial terms? Does this prompt us to look at a ‘resemblance relation’ and distinguish it from the ‘similarity relation’? Of course.
Recall that a fuzzy relation that is reflexive, symmetric, and also transitive is called similarity relation. It helps you to create similarity classes. If the relation lacks any one of the three properties, it is not a similarity relation. But if it is only not transitive, meaning it is both reflexive and symmetric, it is still not a similarity relation, but it is a resemblance relation. An example of a resemblance relation, call it t, is given by the following matrix.
Let
the domain have elements a, b, and c:
1 0.4 0.8
t = 0.4 1 0.5
0.8 0.5 1
This
fuzzy relation is clearly reflexive, and symmetric, but it is not transitive.
For example:
min (mt(a, c) , mt(c, b) ) = min (0.8, 0.5) = 0.5 ,
but
the following:
mt(a, b) = 0.4 < 0.5 ,
is a violation of the condition for transitivity. Therefore, t is not a similarity relation, but it certainly is a resemblance relation.
One last definition is that of a fuzzy partial order. A fuzzy relation that is reflexive, antisymmetric, and transitive is a fuzzy partial order. It differs from a similarity relation by requiring antisymmetry instead of symmetry. In the context of crisp sets, an equivalence relation that helps to generate equivalence classes is also a reflexive, symmetric, and transitive relation. But those equivalence classes are disjoint, unlike similarity classes with fuzzy relations. With crisp sets, you can define a partial order, and it serves as a basis for making comparison of elements in the domain with one another.
At
this point, our digression from the discussion of fuzzy data bases is finished.
Let us now recall, for immediate reference, the entries in the definitions we
listed earlier in table:
|
Fuzzy Values for
Example Sets |
|
|
Fuzzy Value |
Set |
|
FV(age) |
{ very young, young, somewhat old, old } |
|
FV(nov) |
{ never, rarely, quite a few, often, very often } |
|
FV(lov) |
{ barely few days, few days, quite a few days, many days } |
|
FV(yov) |
{distant past, recent past, recent } |
|
FV(hs) |
{ barely, adequately, quite a bit, extensively } |
|
FV(flp) |
{not proficient, barely proficient, adequate, proficient, very proficient } |
Note that you can use unknown in place of the value of an attribute for an item in the database. If you do not know John Smith’s age, you can enter unknown in that field of John Smith’s record. You may say his age is unknown, even though you have a rough idea that he is about 35. You would then be able to assign some reasonable degrees of membership of John Smith in fuzzy sets like age_young or age_somewhat old.
One way of extending a model into a fuzzy model, as far as databases are concerned, is to make use of similarity relations and to extend the operations with them as Buckles and Perry do, such as PROJECT. First there are the domains, for the database. In our example relating to travel and tour guides above, the domains are:
|
|
D1 = { John Smith, ... }, the set of persons included in the database, |
|
|
D2 = {India, Italy, Japan, ... }, the set of countries of visit, |
|
|
D3 = {Hindi, Italian, Japanese, ... }, the set of foreign languages, |
|
|
D4 = {U.S., ... }, the set of countries of citizenship, |
|
|
D5 = set of ages, |
|
|
D6 = set of years, |
|
|
D7 = set of number of visits, |
|
|
D8 = set of length of visits. |
Note that the enumerated sets are shown with ‘...’ in the sets, to indicate that there may be more entries listed, but we are not giving a complete list. In practice, you will make a complete enumeration unlike in our example. The domains D5, D6, D7, and D8 can also be given with all their elements listed, since in practice, these sets are finite. Conceptually though, they are infinite sets; for example, D6 is the set of positive integers.
Next, you have the similarity relations that you define. And then there are the operations.
Consider a standard database given below. It can be called also the relation R1, from set D1 = {Georgette, Darrell, Ernie , Grace } to set D2 = {Spanish, Italian, French, Japanese, Chinese, Russian} as shown in table:
|
||||||||||||||||||||||
Let’s
say a fuzzy database has D1 and D2 as domains. Suppose you have a similarity
relation S1 on domain D1 given by the matrix:
1 0.4 0.8 0.7
0.4 1 0.5 0.3
0.8 0.5 1 0.4
0.7 0.3 0.4 1
Recall that the entries in this matrix represent the degrees of membership of ordered pairs in the relation S1. For example, the first row third column element, which is 0.8, in the matrix refers to the degree of membership of the pair (Georgette, Ernie), since the rows and columns refer to Georgette, Darrell, Ernie and Grace in that order.
The result of the operation: PROJECT (R1 over D1) with LEVEL(D1) = 0.6 is the relation R2 given in table:
|
This projection operation with a condition on the level works as follows. First, the column for D1 is to be picked, of the two columns that R1 shows. Repetitions are removed. The condition says that if two elements of D1 have a similarity of 0.6 or higher, they should be treated as the same. Even though similarity levels of pairs (Georgette, Ernie) and (Georgette, Grace) are both greater than 0.6, the pair (Ernie, Grace) has similarity of 0.4 only so that we do not treat the three as the same.
This type of table is not constructed in the standard database model, so this is part of an extension of the standard model.
Suppose you recast the information in the relation R1 and call it R3, shown in table:
|
||||||||||||
This kind of a table also is not found in standard databases (where there are groups with more than one element used in the relation), and is an example of an extended model.
As an alternative to using similarity relations for introducing fuzziness into a database model, you can, following Umano, et al., use a possibility distribution-relational model. The possibility distributions represent the fuzzy values of attributes in the data. An example of a possibility distribution is the fuzzy set you saw before, nov_rarely = {0.7/1, 0.2/2}, where nov_rarely stands for number of visits considered to be “rarely.”
An example of a database on the lines of this model is shown in Table 16.7:
|
||||||||||||||||||||||||||||||||
A standard database cannot look like this. Entries like many and {10, 11}p clearly suggest fuzziness. The entry {10, 11}p, is a possibility distribution, suggesting that the number of visits outside the United States made by Roberto is either 10 or 11. Similarly, Raj’s citizenship is India or United States, but not dual citizenship in both. Andre’s citizenship and Alan’s number of visits outside the United States are not known, and they can have any values. The possibilities cannot be narrowed down as in the case of Raj’s citizenship and Roberto’s frequency of visits outside the United States The entry undefined is used for Alan because he always traveled alone, he never took a companion.
James’
number of visits is fuzzy. He traveled many times. A fuzzy set for many will
provide the possibility distribution. It can be defined, for example, as:
many = {0.2/6, 0.5/7, 0.8/8, 1/9, 1/10, ...}
The name of the companion on James’ latest visit outside the United States is entered as null because we do not know on the one hand whether he never took a companion, in which case we could have used undefined as in Alan’s case, and on the other whom he took as a companion if he did take one, in which case we could have used unknown. Simply put, we use null when we do not know enough to use either unknown or undefined.
Let us turn our attention now to how queries are answered with this type of a database model. Suppose you want a list of U.S. citizens in your database. Peter and Alan clearly satisfy this condition on citizenship. Andre and Raj can only be said to possibly satisfy this condition. But Roberto and James clearly do not satisfy the given condition. This query itself is crisp and not fuzzy (either you belong to the list of U.S. citizens or you don’t). The answer therefore should be a crisp set, meaning that unless the degree of membership is 1, you will not list an element. So you get the set containing Peter and Alan only.
A second query could be for people who made more than a few visits outside the United States Here the query is fuzzy. James with many visits outside United States seems to clearly satisfy the given condition. It is perhaps reasonable to assume that each element in the fuzzy set for many appears in the fuzzy set more than a few with a degree of membership 1. Andre’s 2 may be a number that merits 0 degree of membership in more than a few. The other numbers in the database are such that they possibly satisfy the given condition to different degrees. You can see that the answer to this fuzzy query is a fuzzy set. Now, we switch gears a little, to talk more on fuzzy theory. This will help with material to follow.
Let us introduce you to fuzzy events, fuzzy means, and fuzzy variances. These concepts are basic to make a study of fuzzy quantification theories. You will see how a variable’s probability distribution and its fuzzy set are used together. We will use an example to show how fuzzy means and fuzzy variances are calculated.
Suppose you are a shareholder of company XYZ and that you read in the papers that its takeover is a prospect. Currently the company shares are selling at $40 a share. You read about a hostile takeover by a group prepared to pay $100 a share for XYZ. Another company whose business is related to XYZ’s business and has been on friendly terms with XYZ is offering $85 a share. The employees of XYZ are concerned about their job security and have organized themselves in preparing to buy the company collectively for $60 a share. The buyout price of the company shares is a variable with these three possible values, viz., 100, 85, and 60. The board of directors of XYZ have to make the ultimate decision regarding whom they would sell the company. The probabilities are 0.3, 0.5, and 0.2 respectively, that the board decides to sell at $100 to the first group, to sell at $85 to the second, and to let the employees buy out at $60.
Thus, you get the probability distribution of the takeover price to be as follows:
|
price |
100 |
85 |
60 |
|
probability |
0.3 |
0.5 |
0.2 |
From
standard probability theory, this distribution gives a mean(or expected price)
of:
100 x 0.3 + 85 x 0.5 + 60 x 0.2 = 84.5
and
a variance of :
(100-84.5)2 x 0.3 +(85-84.5)2 x 0.5 + (60-84.5)2 x 0.2 = 124.825
Suppose now that a security analyst specializing in takeover situations feels that the board hates a hostile takeover but to some extent they cannot resist the price being offered. The analyst also thinks that the board likes to keep some control over the company, which is possible if they sell the company to their friendly associate company. The analyst recognizes that the Board is sensitive to the fears and apprehensions of their loyal employees with whom they built a healthy relationship over the years, and are going to consider the offer from the employees.
The
analyst’s feelings are reflected in the following fuzzy set:
{0.7/100, 1/85, 0.5/60}
You recall that this notation says, the degree of membership of 100 in this set is 0.7, that of 85 is 1, and the degree of membership is 0.5 for the value 60.
The fuzzy set obtained in this manner is also called a fuzzy event. A different analyst may define a different fuzzy event with the takeover price values. You, as a shareholder, may have your own intuition that suggests a different fuzzy event. Let us stay with the previous fuzzy set that we got from a security analyst, and give it the name A.
At this point, we can calculate the probability for the fuzzy event A by using the takeover prices as the basis to correspond the probabilities in the probability distribution and the degrees of membership in A. In other words, the degrees of membership, 0.7, 1, and 0.5 are treated as having the probabilities 0.3, 0.5, and 0.2, respectively. But we want the probability of the fuzzy event A, which we calculate as the expected degree of membership under the probability distribution we are using.
Our
calculation gives the following:
0.7 x 0.3 + 1 x 0.5 + 0.5 x 0.2 = 0.21 + 0.5 + 0.1 = 0.81
Our next step is to calculate the fuzzy mean of the takeover price. Let us call it A_fuzzy_mean, to make reference to the fuzzy event used.
The
calculation is as follows:
A_fuzzy_mean = (1/0.81) x (100 x 0.7 x 0.3 + 85 x 1 x 0.5 + 60 x 0.5 x0.2) = 85.8
To get the fuzzy variance of the takeover price, you need to use values like (100-85.8)2 , which is the square of the deviation of the takeover price 100 from the fuzzy mean. A simpler way to calculate, which is mathematically equivalent, is to first take the fuzzy expected value of the square of the takeover price and then to subtract the square of the fuzzy mean. To make it easier, let us use p as the variable that represents the takeover price.
The
calculations are as below:
A_fuzzy_expected p2 = 1/(0.81) x (1002x 0.7 x 0.3 + 852x 1 x 0.5 + 602x 0.5 x 0.2) = 7496.91A_fuzzy_variance = 7496.91 - 85.82 = 7496.91 - 7361.64 = 135.27
Fuzzy logic is thus introduced into the realm of probability concepts such as events, and statistical concepts such as mean and variance. Further, you can talk of fuzzy conditional expectations and fuzzy posterior probabilities, etc. enabling you to use fuzziness in Bayesian concepts, regression analysis, and so on. You will then be delving into the field of fuzzy quantification theories. In what follows, we continue our discussion with fuzzy conditional expectations.
Suppose
you, as a shareholder of the XYZ company in the previous example come up with
the fuzzy set, we will call the fuzzy event:
B = {0.8/100, 0.4/85, 0.7/60}
The
probability for your fuzzy event is as follows:
0.8 x 0.3 + 0.4 x 0.5 + 0.7 x 0.2 = 0.58
B_fuzzy_mean and B_fuzzy_variance of the takeover price of XYZ stock work out as 85.17 and 244.35, respectively. But you want to see how these values change if at all when you take A, the analyst’s fuzzy event, as a given. You are then asking to determine the conditional probability of your fuzzy event, and your conditional fuzzy mean and fuzzy variance as well.
The
conditional probability of your fuzzy event is calculated as follows:
(1/0.81) x (0.8 x 0.7 x 0.3 + 0.4 x 1 x 0.5 + 0.7 x 0.5 x 0.2) = 0.54
This value is smaller than the probability you got before when you did not take the analyst’s fuzzy event as given. The a priori probability of fuzzy event B is 0.58, while the a posteriori probability of fuzzy event B given the fuzzy event A is 0.54.
The
conditional B_fuzzy_mean of the takeover price with fuzzy event A
as given works out as:
(1/0.54) x (100 x 0.8 x 0.7 x 0.3 + 85 x 0.4 x 1 x 0.5 + 60 x 0.7 x0.5 x 0.2) = 70.37
and the conditional B_fuzzy_variance of the takeover price with fuzzy event A, as given, amounts to 1301.76, which is over five times as large as when you did not take the analyst’s fuzzy event as given.
When you see the definitions of fuzzy means and fuzzy variances, you may think that regression analysis can also be dealt with in the realm of fuzzy logic. In this section we discuss what approach is being taken in this regard.
First, recall what regression analysis usually means. You have a set of x- values and a corresponding set of y values, constituting a number of sample observations on variables X and Y. In determining a linear regression of Y on X, you are taking Y as the dependent variable, and X as the independent variable, and the linear regression of Y on X is a linear equation expressing Y in terms of X. This equation gives you the line ‘closest’ to the sample points (the scatter diagram) in some sense. You determine the coefficients in the equation as those values that minimize the sum of squares of deviations of the actual y values from the y values from the line. Once the coefficients are determined, you can use the equation to estimate the value of Y for any given value of X. People use regression equations for forecasting.
Sometimes you want to consider more than one independent variable, because you feel that there are more than one variable which collectively can explain the variations in the value of the dependent variable. This is your multiple regression model. Choosing your independent variables is where you show your modeling expertise when you want to explain what happens to Y, as X varies.
In any case, you realize that it is an optimization problem as well, since the minimization of the sum of squares of deviations is involved. Calculus is used to do this for Linear Regression. Use of calculus methods requires certain continuity properties. When such properties are not present, then some other method has to be used for the optimization problem.
The problem can be formulated as a linear programming problem, and techniques for solving linear programming problems can be used. You take this route for solving a linear regression problem with fuzzy logic.
In a previous section, you learned about possibility distributions. The linear regression problem with fuzzy logic is referred to as a linear possibility regression problem. The model, following the description of it by Tarano, Asai, and Sugeno, depends upon a reference function L, and fuzzy numbers in the form of ordered pairs (a, b). We will present fuzzy numbers in the next section and then return to continue our discussion of the linear possibility regression model.
A fuzzy number is an ordered pair of numbers (a, b) with respect to a reference function L, which gives you the membership function. Here b has to be a positive number.
Here are the properties of L, the reference function:
1. It is a function of one variable and is symmetric about 0. That is, L(x) = L(-x).
2. It has a value of 1 at x = 0. In other words, L(0) = 1.
3. It is generally decreasing, when x is 0 or a positive number, meaning that its value drops as the value of its argument is increased. For example, L(2) < L(1). Thus L(x) has its values less than 1 for positive values of x. It does not make sense to have negative numbers as values of L, and so you ignore the values of x that cause such values for L.
4. The maximum value for the function is 1, at x = 0. It has a sort of a bell-shaped curve.
If A is a fuzzy number with the ordered pair (a, b) with b > 0, and if the reference function is L, you do the following:
You
write the fuzzy number as A = (a, b)L. You get the membership
of any element x, by taking the quantity (x - a) / b (which
reminds you of how you get a z-score), and evaluate the reference
function L at this argument. That is:
mA(x) = L( (x-a) / b)
Examples of a reference function L are:
|
Example 1: |
L(x) = max ( 0, 1- x2) |
You obtain the following shown in Table 16.8.
|
|||||||||||||||||||||||||||
This function is not strictly decreasing though. It remains a constant at 0 for x > 1.
|
Example 2: |
L(x) = 1/ (1 + x2 ) |
You get the values shown in table:
|
|||||||||||||||||||||||||||||||||
Let us now determine the membership of 3 in the fuzzy number A = (4, 10)L, where L is the function in the second example above, viz., 1/ (1 + x2).
First,
you get (x- 4) / 10 = (3 - 4) / 10 = - 0.1. Use this as the argument of
the reference function L. 1/ (1 + (- 0.1)2 ) gives 0.99. This
is expressed as follows:
mA(3) = L( (3-4) / 10) = 1/ (1 + (- 0.1)2 ) = 0.99
You can verify the values, mA(0) = 0.862, and mA(10) = 0.735.
With the right choice of a reference function, you can get a symmetrical fuzzy number A, such that when you plot the membership function in A, you get a triangle containing the pairs (x, mA(x)), with mA(x) > 0. An example is A = (5, 8)L, where L = max(1 - |x|, 0).
The numbers x that have positive values for mA(x) are in the interval ( -3, 13 ). Also, mA( -3 ) = 0, and mA(13) = 0. However, mA(x) has its maximum value at x = 5. Now, if x is less than -3 or greater than 13, the value of L is zero, and you do not consider such a number for membership in A. So all the elements for which membership in A is nonzero are in the triangle.
This
triangular fuzzy number is shown in figure:

Triangular membership function.
The height of the triangle is 1, and the width is 16, twice the number 8, midpoint of the base is at 5. The pair of numbers 5 and 8 are the ones defining the symmetrical fuzzy number A. The vertical axis gives the membership, so the range for this is from 0 to 1.
Assume that you have (n + 1)-tuples of values of x1, ... xn, and y. That is, for each i, i ranging from 1 to k, you have (x1, ... , xn, y), which are k sample observations on X1, ... , Xn, and Y. The linear possibility regression model is formulated differently depending upon whether the data collected is crisp or fuzzy.
Let
us give such a model below, for the case with crisp data. Then the fuzziness
lies in the coefficients in the model. You use symmetrical fuzzy numbers, Aj
= (aj, bj)L. The linear possibility
regression model is formulated as:
Yj = A0 + A1Xj1 + ... + AnXjn
The value of Y from the model is a fuzzy number, since it is a function of the fuzzy coefficients. The fuzzy coefficients Ajare chosen as those that minimize the width (the base of the triangle) of the fuzzy number Yj. But Aj is also determined by how big the membership of observed yj is to be, in the fuzzy number Yj . This last observation provides a constraint for the linear programming problem which needs to be solved to find the linear possibility regression. You select a value d, and ask that mY(y) [ge] d.
We close this section by observing that linear possibility regression gives triangular fuzzy numbers for Y, the dependent variable. It is like doing interval estimation, or getting a regression band. Readers who are seriously interested in this topic should refer to Terano, et al. (see references).
This
section discusses the fuzzy logic controller (FLC), its application and design.
Fuzzy control is used in a variety of machines and processes today, with
widespread application especially in Japan. A few of the applications in use
today are in the list in Table 16.10, adapted from Yan, et al.
|
Table 16.10
Applications of Fuzzy Logic Controllers (FLCs) and Functions Performed |
|
|
Application |
FLC function(s) |
|
Video camcorder |
Determine best focusing and lighting when there is movement in the picture |
|
Washing machine |
Adjust washing cycle by judging the dirt, size of the load, and type of fabric |
|
Television |
Adjust brightness, color, and contrast of picture to please viewers |
|
Motor control |
Improve the accuracy and range of motion control under unexpected conditions |
|
Subway train |
Increase the stable drive and enhance the stop accuracy by evaluating the passenger traffic conditions. Provide a smooth start and smooth stop. |
|
Vacuum cleaner |
Adjust the vacuum cleaner motor power by judging the amount of dust and dirt and the floor characteristics |
|
Hot water heater |
Adjust the heating element power according to the temperature and the quantity of water being used |
|
Helicopter control |
Determine the best operation actions by judging human instructions and the flying conditions including wind speed and direction |
A fuzzy logic controller diagram was shown in Chapter 3. Let us redraw it now and discuss a design example. Refer to figure Fuzzy control of a water heater. For the purpose of discussion, let us assume that this FLC controls a hot water heater. The hot water heater has a knob, HeatKnob(0-10) on it to control the heating element power, the higher the value, the hotter it gets, with a value of 0 indicating the heating element is turned off. There are two sensors in the hot water heater, one to tell you the temperature of the water (TempSense), which varies from 0 to 125° C, and the other to tell you the level of the water in the tank (LevelSense), which varies from 0 = empty to 10 = full. Assume that there is an automatic flow control that determines how much cold water (at temperature 10° C) flows into the tank from the main water supply; whenever the level of the water gets below 40, the flow control turns on, and turns off when the level of the water gets above 95.
Fuzzy control of a water heater.
The design objective can be stated as:
Keep the water temperature as close to 80° C as possible, in spite of changes in the water flowing out of the tank, and cold water flowing into the tank.
The range of values that inputs and outputs may take is called the universe of discourse. We need to define the universe of discourse for all of the inputs and outputs of the FLC, which are all crisp values. Table 16.11 shows the ranges:
|
||||||||||||||||||||
The inputs to the FLC are the LevelSense and the TempSense. We can use triangular membership functions to fuzzify the inputs, just as we did in Chapter 3, when we constructed the fuzzifier program. There are some general guidelines you can keep in mind when you determine the range of the fuzzy variables as related to the crisp inputs (adapted from Yan, et al.):
1. Symmetrically distribute the fuzzified values across the universe of discourse.
2. Use an odd number of fuzzy sets for each variable so that some set is assured to be in the middle. The use of 5 to 7 sets is fairly typical.
3. Overlap adjacent sets (by 15% to 25% typically) .
Both
the input variables LevelSense and TempSense are restricted to positive values.
We use the following fuzzy sets to describe them: XSmall, Small, Medium, Large,
XLarge
|
||||||||||||||
Fuzzy membership functions for LevelSense.
|
||||||||||||||
Fuzzy membership functions for TempSense.
In our example, we have just one output, which is the HeatKnob. We need to assign fuzzy memberships to this variable just as we did for the inputs. We use different variable names to make the example clearer later on.
|
||||||||||||||
Fuzzy membership functions for the output HeatKnob.
Now that you have the inputs and the output defined in terms of fuzzy variables, you need only specify what actions to take under what conditions; that is, you need to construct a set of rules that describe the operation of the FLC. These rules usually take the form of IF–THEN rules and can be obtained from a human expert (heuristics), or can be supplied from a neural network that infers the rules from behavior of the system. We mentioned this idea in Chapter 3.
Let us construct a rule base for our design example. For the two inputs, we define the matrix shown in Table 16.15. Our heuristic guidelines in determining this matrix are the following statements and their converses:
1. When the temperature is low, the HeatKnob should be set higher than when the temperature is high.
2. When the volume of water is low, the HeatKnob does not need to be as high as when the volume of water is high.
NOTE: In FLCs, we do not need to specify all the boxes in the matrix. That is
perfectly fine. No entry signifies that no action is taken, for example, in the
column for SenseTemp=XL, no action is required since the temperature is already
at or above the target temperature.
|
||||||||||||||||||||||||||||||||||||||||||||||||
Let us examine a couple of typical entries in the table: For SenseLevel = Medium (M) and SenseTemp = XSmall (XS), the output is HeatKnob = AWholeLot. Now for the same temperature, as the water level rises, the setting on HeatKnob also should rise to compensate for the added volume of water. You can see that for SenseLevel = Large(L), and SenseTemp = XSmall(XS), the output is HeatKnob = AWholeLot. You can verify that the rest of the table is created by similar reasoning.
Creating IF–THEN Rules
We can now translate the table entries into IF - THEN rules. We take these directly from Table 16.15:
1. IF SenseTemp IS XSmall AND SenseLevel IS XSmall THEN SET HeatKnob TO AGoodAmount
2. IF SenseTemp IS XSmall AND SenseLevel IS Small THEN SET HeatKnob TO ALot
3. IF SenseTemp IS XSmall AND SenseLevel IS Medium THEN SET HeatKnob TO AWholeLot
4. IF SenseTemp IS XSmall AND SenseLevel IS Large THEN SET HeatKnob TO AWholeLot
5. IF SenseTemp IS XSmall AND SenseLevel IS XLarge THEN SET HeatKnob TO AWholeLot
6. IF SenseTemp IS Small AND SenseLevel IS XSmall THEN SET HeatKnob TO ALittle
7. IF SenseTemp IS Small AND SenseLevel IS Small THEN SET HeatKnob TO AGoodAmount
8. IF SenseTemp IS Small AND SenseLevel IS Medium THEN SET HeatKnob TO ALot
9. IF SenseTemp IS Small AND SenseLevel IS Large THEN SET HeatKnob TO ALot
10. IF SenseTemp IS Small AND SenseLevel IS XLarge THEN SET HeatKnob TO ALot
11. IF SenseTemp IS Medium AND SenseLevel IS XSmall THEN SET HeatKnob TO VeryLittle
12. IF SenseTemp IS Medium AND SenseLevel IS Small THEN SET HeatKnob TO VeryLittle
13. IF SenseTemp IS Medium AND SenseLevel IS Medium THEN SET HeatKnob TO AGoodAmount
14. IF SenseTemp IS Medium AND SenseLevel IS Large THEN SET HeatKnob TO ALot
15. IF SenseTemp IS Medium AND SenseLevel IS XLarge THEN SET HeatKnob TO ALot
16. IF SenseTemp IS Large AND SenseLevel IS Small THEN SET HeatKnob TO VeryLittle
17. IF SenseTemp IS Large AND SenseLevel IS Medium THEN SET HeatKnob TO VeryLittle
18. IF SenseTemp IS Large AND SenseLevel IS Large THEN SET HeatKnob TO ALittle
19. IF SenseTemp IS Large AND SenseLevel IS XLarge THEN SET HeatKnob TO AGoodAmount
Remember that the output and inputs to the fuzzy rule base are fuzzy variables. For any given crisp input value, there may be fuzzy membership in several fuzzy input variables (determined by the fuzzification step). And each of these fuzzy input variable activations will cause different fuzzy output cells to fire, or be activated. This brings us to the final step, defuzzification of the output into a crisp value.
In order to control the HeatKnob, we need to obtain a crisp dial setting. So far, we have several of the IF–THEN rules of the fuzzy rule base firing at once, because the inputs have been fuzzified. How do we arrive at a single crisp output number ? There are actually several different strategies for this; we will consider two of the most common, the center of area (COA) or centroid method, and the fuzzy Or method. The easiest way to understand the process is with an example.
Assume that at a particular point in time, LevelSense = 7.0 and TempSense = 65. These are the crisp inputs directly from the sensors. With fuzzification (refer to Chapter 3 for a review), assume that you get the following fuzzy memberships:
|
crisp input — LevelSense = 7.0 |
|
fuzzy outputs with membership values - |
|
Medium: 0.4 |
|
Large: 0.6 |
|
all others : 0.0 |
|
crisp input — TempSense=65 |
|
fuzzy outputs with membership values - |
|
Medium: 0.75 |
|
Large: 0.25 |
|
all others: 0.0 |
This results in four rules firing:
1. TempSense = Medium (0.75) AND LevelSense = Medium (0.4)
2. TempSense = Large (0.25) AND LevelSense = Medium (0.4)
3. TempSense = Medium (0.75) AND LevelSense = Large (0.6)
4. TempSense = Large (0.25) AND LevelSense = Large (0.6)
First you must determine, for each of the AND clauses in the IF–THEN rules, what the output should be. This is done by the conjunction or minimum operator. So for each of these rules you have the following firing strengths:
1. (0.75) ⊥ (0.4) = 0.4
2. (0.25) ⊥ (0.4) = 0.25
3. (0.75) ⊥ (0.6) = 0.6
4. (0.25) ⊥ (0.6) = 0.25
By using the fuzzy rule base and the strengths assigned previously, we find the rules recommend the following output values (with strengths) for HeatKnob:
1. AGoodAmount (0.4)
2. VeryLittle (0.25)
3. ALot (0.6)
4. ALittle (0.25)
Now
we must combine the recommendations to arrive at a single crisp value. First,
we will use the fuzzy Or method of defuzzification. Here we use a disjunction
or maximum operator to combine the values. We obtain the following:
(0.4) ⊦ (0.25) ⊦ (0.6) ⊦ (0.25) = 0.6
The crisp output value for HeatKnob would then be this membership value multiplied by the range of the output variable, or (0.6) (10-0) = 6.0.
Another way of combining the outputs is with the centroid method. With the centroid method, there are two variations, the overlap composition method and the additive composition method. To review, we have the following output values and strengths.
1. AGoodAmount (0.4)
2. VeryLittle (0.25)
3. ALot (0.6)
4. ALittle (0.25)
We use the strength value and fill in the particular triangular membership function to that strength level. For example, for the first rule, we fill the triangular membership function, AGoodAmount to the 0.4 level. We then cut off the top of the triangle (above 0.4). Next we do the same for the other rules. The overlap method simply superimposes all of the truncated triangles onto the same area. You can lose information with this method. The additive method adds the geometrical figures on top of each other.
Defuzzification with the Centroid approach: Overlap and Additive composition.
In
order to get a crisp value, you take the centroid or center of gravity,
of the resulting geometrical figure. Let us do this for the overlap method
figure. The centroid is a straight edge that can be placed through the figure
to have it perfectly balanced; there is equal area of the figure on either side
of the straight edge. Splitting
up the geometry into pieces and summing all area contributions on either side
of the centroid, we get a value of 5.2 for this example. This is already in
terms of the crisp output value range:
HeatKnob = 5.2
Finding the centroid.
This completes the design for the simple example we chose. We conclude with a list of the advantages and disadvantages of FLCs.
The following list adapted from McNeill and Thro shows the advantages and disadvantages to FLCs for control systems as compared to more traditional control systems.
Advantages:
• Relates input to output in linguistic terms, easily understood
• Allows for rapid prototyping because the system designer doesn’t need to know everything about the system before starting
• Cheaper because they are easier to design
• Increased robustness
• Simplify knowledge acquisition and representation
• A few rules encompass great complexity
• Can achieve less overshoot and oscillation
• Can achieve steady state in a shorter time interval
Disadvantages:
• Hard to develop a model from a fuzzy system
• Require more fine tuning and simulation before operational
• Have a stigma associated with the word fuzzy (at least in the Western world); engineers and most other people are used to crispness and shy away from fuzzy control and fuzzy decision making
Fuzzy logic applications are many and varied. You got an overview of the different applications areas that exist for fuzzy logic, from the control of washing machines to fuzzy logic based cost benefit analysis. Further you got details on two application domains: fuzzy databases and fuzzy control.
This chapter dealt with extending database models to accommodate fuzziness in data attribute values and in queries as well. You saw fuzzy relations; in particular, similarity and resemblance relations, and similarity classes were reviewed. You found how possibility distributions help define fuzzy databases. You also learned what fuzzy events are and how to calculate fuzzy means, fuzzy variances, and fuzzy conditional expectations. Concepts related to linear possibility regression model were presented.
The
chapter presented the design of a simple fuzzy logic control (FLC) system to
regulate the temperature of water in a hot water heater. The components of the
FLC were discussed along with design procedures. The advantages of FLC design
include rapid prototyping ability and the capability to solve very nonlinear
control problems without knowing details of the nonlinearities.