Nothing Special   »   [go: up one dir, main page]

WQ - Perspective - Reshaping The World With Fuzzy Logic v4

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

WorldQuant

04.27.18

Perspectives

Reshaping
the World
with Fuzzy
Logic
Decision making often eludes
data-driven binary computing.
That opens the door to
systems, from machine
learning to self-driving cars,
that mirror the way humans
wrestle with the uncertainties
and ambiguities of life.

WorldQuant, LLC
1700 East Putnam Ave.
Third Floor
Old Greenwich, CT 06870
www.weareworldquant.com
WorldQuant Reshaping the World with Fuzzy Logic
Perspectives 04.27.18

“AS FAR AS THE LAWS OF MATHEMATICS REFER TO REALITY, the outputs and need to identify patterns and make groups.
they are not certain. And as far as they are certain, they do not Fuzzy logic falls into the category of unsupervised learning
refer to reality.” — Albert Einstein methods. It is applicable to machine learning because it provides
multivalued answers.2
Einstein’s observation about math and reality raises the question
of just how well math and science describe the world. Math and In machine learning, clustering involves grouping objects that
science are logical and organized, and they describe the world are similar. Fuzzy logic can be used to determine so-called fuzzy
in the same way. They try to fit every process and phenomenon clusters, in which each data point can belong to more than one
into their equations and precise rules. But the world we live in is cluster. (A hard cluster exists when a data point belongs only to
messy, uncertain, often ambiguous and rarely black and white. a single cluster.) Fuzzy variables in machine learning denote the
Thanks to math and science, we have observed and quantified degree of membership of a given data point in the cluster’s search
physical tendencies and relationships that have proved to be space. In other applications, fuzzy decision trees can be used in
powerfully predictive and that we have been able to define through machine-guided decision making by applying a number of fuzzy
mathematical logic and describe through scientific laws. But the rules simultaneously. Such an approach makes more sense with
truth of this logic and these laws is only a matter of degree and fuzzy rules than with standard bivalent — that is, true or false
could change at any moment.1 As Scottish philosopher David — rules. Fuzzy decision trees resemble standard decision trees,
Hume once noted, just because the sun has always risen doesn’t but the options at each branching point are managed using fuzzy,
necessarily mean it will do so tomorrow. This level of “grayness” rather than bivalent, logic. Replacing standard decision trees with
is the key idea behind the development of fuzzy logic theory, fuzzy ones allows the use of smaller trees with fewer leaves and
which can increasingly be found in many engineering and scientific internal nodes to encapsulate a richer amount of information.
applications today.
What Is Fuzzy Logic?
The theory of fuzzy logic is based on the notion of relative
membership grades and inspired by processes of human The concept of fuzzy logic was introduced by Lotfi Zadeh of the
perception and cognition that are uncertain, imprecise, partially University of California, Berkeley, in the 1960s.3 Zadeh was
true or lacking in sharp boundaries. Fuzzy logic allows for the working on the problem of helping computers understand natural
inclusion of vague human assessments in computing problems. It language, which, like many other human activities, is not easily
translated into absolute terms of 0 and 1. (Whether everything is
also provides an effective means for conflict resolution of multiple
ultimately describable in binary terms is a philosophical question
criteria and a better assessment of options. New computing
worth pursuing. In practice, much of the data we might want
methods based on fuzzy logic can be used in the development of
to feed into a computer exists in in-between states. The same
intelligent systems for decision making, identification, pattern
frequently applies to the results of computing.) It may help to see
recognition, optimization and control. fuzzy logic as the way human reasoning normally works, with
binary and Boolean logic as special cases.
Indeed, fuzzy logic, once thought to be an obscure mathematical
curiosity, can be found in many engineering and scientific In fuzzy logic, 0 and 1 are extreme cases of truth (or fact) and
applications. It has been used in facial pattern recognition, encompass various states of in-between truth, so that, for
air conditioners, washing machines, vacuum cleaners, example, at 72 inches, or six feet, a man’s height would not
transmissions, power systems, weather forecasting, models be “tall” or “short” but “25 percent of tallness,” with a 0.25
for new-product pricing or project risk assessment, medical membership grade. The concept of membership grade is
diagnosis and treatment plans, and autonomous systems such as important in fuzzy logic, quantifying where a single data point lies
self-driving cars. within a fuzzy set, in which 0 means it is not a member of that set
and 1 that it is fully a member.
Fuzzy logic has also been used in machine learning, an aspect
of artificial intelligence (AI) in which we help computers gain Fuzzy logic seems closer to the way our brains actually work.
knowledge and learn how to perform tasks. Machine learning We aggregate data and form a number of partial truths that
can be supervised learning, where we know both the inputs and we aggregate further into higher truths, which, when certain
the outputs, or unsupervised learning, where we don’t know thresholds are exceeded, trigger results such as motor reactions.

Copyright © 2018 WorldQuant, LLC WorldQuant Perspectives April 2018 2


WorldQuant Reshaping the World with Fuzzy Logic
Perspectives 04.27.18

A similar kind of process can be found in neural networks, expert


systems and other AI applications. Fuzzy logic is essential to
the development of humanlike capabilities for AI, sometimes
Fuzzy logic allows for
referred to as artificial general intelligence: the representation of the inclusion of vague
generalized human cognitive abilities in software so that the AI human assessments in
system can find a solution when it faces an unfamiliar task.
computing problems.
Why Fuzzy Logic?
In all domains, from marketing to engineering, we need to The common fuzzy logic system processes data in three
deal with uncertainty in order to solve problems and make sequential stages: fuzzification, inference and defuzzification. In
decisions. Fuzzy logic is a system that helps us do all of these the fuzzification step, a crisp, or well-defined, set of input data
things better by programming machines to think as humans do. is gathered and converted to a fuzzy set using fuzzy linguistic
It may not give us accurate reasoning, but it provides us with variables — that is, fuzzy linguistic terms. Second, an inference
acceptable reasoning. is made based on a set of rules. Last, in the defuzzification step
the resulting output is mapped using so-called membership
Fuzzy logic accepts that we are unable to provide a precise
functions. A membership function is a curve that maps how each
number for many uncertainties in life. Information is often
point in the input space is related to a membership grade. Using
imperfect, and data has errors. By replacing binary either/or
the height example, various heights in a given set would receive
options with if/then possibilities, fuzzy logic expands choices and
a membership grade between 0 and 1; the resulting curve would
considers subjective attributes.
not define “tall” but instead would trace the transition from not tall
The basis of fuzzy logic is also the basis of human communication. to tall.
Because fuzzy logic is built on structures of qualitative description
used in everyday language — what’s known as linguistic Practical Applications of Fuzzy Logic
variables, such as “short,” “medium” or “tall” in the height example
Fuzzy logic was initially used in control systems such as camera
— it is easier to understand. Moreover, because the mathematical
lenses. Today it lies behind many mechanical systems we take for
concepts behind fuzzy reasoning are relatively simple, it
represents an intuitive approach without far-reaching complexity. granted. For example, in a conventional air conditioner controller,
the thermostat compares the temperature the user selects on the
A fuzzy logic system can be defined as the nonlinear mapping of dial with the actual room temperature and turns the AC on or off.
an input dataset to scalar output data, a consequence of Zadeh’s This maintains a certain temperature level. However, the actual
initial algebra.4 Such a system consists of four main parts: a room temperature does not always correspond to the subjective
fuzzifier, a set of rules, an inference engine and a defuzzifier. temperature felt by people in the room. Empirical analysis of how
people adjust the temperature dial on air conditioners shows a
Componentsof
Components of aa Fuzzy
Fuzzy Logic
LogicSystem
System number of tendencies:
• People tend to put the temperature dial lower than necessary,
then forget to turn it up again, wasting energy.
INPUTS
Fuzzifier Defuzzifier
OUTPUTS • If someone changes the temperature regularly, the
Rule base
temperature control should be sensible — that is, the AC
controller should react more quickly.
• Room temperature that varies a lot suggests the room is used
Fuzzy Linguistic Fuzzy a lot. Hence, control should be sensible.
Input Sets Inference Output Sets
There’s another variable to consider. Regularly turning the AC
on or off will shorten the life of the device and cause ineffective
energy usage. To prevent this from happening, air conditioner
Figure 1 manufacturers make use of a temperature band called hysteresis

Copyright © 2018 WorldQuant, LLC WorldQuant Perspectives April 2018 3


WorldQuant Reshaping the World with Fuzzy Logic
Perspectives 04.27.18

— the tendency of the value of a physical property to lag the An Air-Conditioning Rule Base
force creating it — between the on and off operations. A large
Inputs Outputs
hysteresis will cause the temperature at which the output changes
Rule Temp Changes Brightness Correction Hysteresis
from off to on to be lower than the set point by the amount of the # Difference
hysteresis. If the hysteresis is small, the output will change near 1 Too cold Not frequent Low Warmer Large
the set point, making the temperature control more responsive.
2 Too warm Not frequent Low Cooler Large
Thus, the hysteresis needs to have a suitable value.
3 Normal Frequent Low — Small

Because this kind of knowledge is difficult to model 4 Normal Not frequent Medium Warmer Small

mathematically or code in a conventional algorithm, fuzzy logic 5 Normal Not frequent High Cooler —
has been used. The fuzzy logic system corrects the signal before
the set point is reached and sets its hysteresis. To accomplish Table 1
this, the system uses three input variables:
Fuzzy Logic in Autonomous Vehicles
• The difference between the set temperature and the actual
room temperature. When this difference is large, the system Air conditioners are relatively straightforward. In autonomous
boosts the signal so that the desired temperature is reached vehicle control systems, however, a large number of embedded
faster (see Table 1, Rules 1 and 2) and sets the hysteresis to systems interact with one another with the aim of controlling a car
large so minor disturbances do not cause unnecessary without the involvement of a human driver. Despite the complexity
on/off switches. of this task, some car manufacturers have made considerable
• The number of set temperature changes. To satisfy users progress in autonomous systems, although development
who try to set the room temperature very precisely (Rule 3), the programs continue. Recently, Tesla introduced Autopilot, which
hysteresis is set to small. can take full control of the vehicle’s steering wheel, throttle and
• The brightness. When lights are on and the brightness is at a brakes. Alphabet’s Google and Uber Technologies have also been
medium level, the temperature is set slightly higher (Rule 4) testing self-driving cars. Typically, there are three important
and the hysteresis is set lower. If the room is hit by direct modules in a self-driving car: speed control, steering-wheel
sunlight, the set temperature is automatically reduced (Rule 5). control and adaptive cruise control. We will outline the design of
the speed control module with a fuzzy logic system that has three
Table 1 shows the rule base that defines the strategy of the AC input variables — speed, range of view and road quality — and
system. Each row represents a rule. The left column under “If” two output variables: throttle and brake.
shows all input variables of the rules; the right column under
“Then” shows all the output variables. Step 1: Fuzzification
Membership functions allow us to graphically represent a fuzzy
In this rule base, each linguistic label, such as “too cold,” “too set. These functions can assume specific shapes, such as
warm,” “frequent,” “medium” or “high,” is represented by a triangular, trapezoidal, piecewise linear, Gaussian or singleton,
predefined membership function. and help represent the degree of truth in the valuation process
of particular phenomena where multiple answers are possible.
The type of membership function is dependent on context and is
Fuzzy decision trees generally chosen according to the user’s experience or the nature
resemble standard decision of the data. In our example, we choose the triangle shape to
trees, but the options at express the membership functions of fuzzy sets, seen in Figures 2
through 6.
each branching point are
managed using fuzzy, rather Each of these linguistic variables — speed, range of view, road
quality and the level of braking and throttle — have corresponding
than bivalent, logic. linguistic values; for example, speed can be low, average or
high, as in Figure 2. Each linguistic value is a fuzzy set with a

Copyright © 2018 WorldQuant, LLC WorldQuant Perspectives April 2018 4


WorldQuant Reshaping the World with Fuzzy Logic
Perspectives 04.27.18

membership function showing the membership grade of each requires a rules base to control the output variable. A fuzzy rule
value in the universe of discourse of the fuzzy set. is a simple “if–then” rule with a condition and a conclusion. For
instance, if speed is high, range of view is low and road quality
In this case, the membership functions for input and output is rough, then the brake is average. Experts or training data can
variables are generated either from recommendations from provide these rules or you can extract rules from the data itself,
experts such as automobile engineers or through clustering through clustering methods. The fuzzy rules in this example are
methods. More specifically, as we see in Figure 2, we have three listed in Table 2.
linguistic labels of speed: low, average and high. For each crisp
value of volatility along the x-axis, we may get its membership A Rules Base for Speed Control
grade in corresponding fuzzy sets by taking the corresponding
y-axis values. Note that an important characteristic of fuzzy logic Inputs Outputs
is that a numerical value does not have to be fuzzified using only Rule Speed Range Road Brake Throttle
# of View Quality
one membership function. In other words, a value can belong
to multiple sets at the same time. In Figure 3, a range-of-view 1 High Low Smooth Hard Not applied

value of 12.5m can be considered both “low” and “average” at the 2 High Low Rough Average Not applied
same time, with different degrees of membership, at 0.25 and 3 High Average Rough Soft Not applied
0.75, respectively. 4 High High Smooth Not applied Soft
Membership Functions 5 High High Rough Not applied Average
6 Average Average Rough Not applied Hard
Low Avg High Low Avg High
1 1
7 Average Average Smooth Not applied Soft
0.75 8 Average Low Rough Soft Not applied
9 Low High Average Not applied Average
0.25 10 Low High Smooth Not applied Hard

0 10 20 30 50 70 0 5 10 15 20 25 30
Table 2
Figure 2: Speed Figure 3: Range of View
Rough Avg Smooth So Avg Hard
Each rule shows how the speed-control module reacts when input
1 1
variables such as speed, range of view and road quality take on
0.8
certain values. For instance, Rule 2 can be read as follows: If the
car is moving fast, the range of view is low and the road is rough,
then the system will brake with average force.

-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
Step 3: Inference
Figure 4: Road quality Figure 5: Throttle The purpose of this step is to map a given input to an output using
So Avg Hard
knowledge-based rules and fuzzy set operators.
1

Fuzzy set operators

After inputs are fuzzified, we can determine the degree to which


each part of the antecedent is satisfied for each rule. (The
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 antecedent is the “if” part of the rule.) If the antecedent of a given
rule has more than one part, the fuzzy operator is applied to obtain
Figure 6: Brake a number that represents the result of the antecedent for that rule.
This number is then applied through a fuzzy operator to the output
Step 2: Constructing Knowledge-Based Rules function — a process known as implication. The input to the fuzzy
Like the thermostat, a speed-control module for self-driving cars operator is two or more membership values from fuzzified input

Copyright © 2018 WorldQuant, LLC WorldQuant Perspectives April 2018 5


WorldQuant Reshaping the World with Fuzzy Logic
Perspectives 04.27.18

Step 4: Defuzzification
Because fuzzy logic is The input for the defuzzification process is a fuzzy set (the
built on structures of aggregate output fuzzy set), and the output is a single number.
However, the aggregation output encompasses a range of output
qualitative description values, which must be defuzzified in order to produce a single
used in everyday language, output value for the set. This is the purpose of the defuzzifier
component of a fuzzy logic system.
it is easier to understand.
For example, assume that inference provides the result in Figure
7. The shaded area belongs to the output fuzzy result. The goal
variables. The output is a single truth value. Fuzzy set operators is to obtain a single crisp value. There are a number of different
can also be used to combine the results of individual rules. methods of defuzzification, such as the center of the area, center
of sums, center of maximum and mean of maximum. Perhaps the
The rules in fuzzy logic are usually “If A and/or B, then C,” which most popular defuzzification method is the center of the area. The
means that we need to define operators “and” and “or.” The most star, with the value 0.35, shows the level of braking applied to the
commonly used fuzzy operators for “or” and “and” are max and wheels in a specific context.
min, respectively, which Zadeh proposed in the early years of his
work on fuzzy logic. Defuzzification
Defuzzificationof
of a Fuzzy
FuzzySet
Set

Figure 2, Figure 3 and Figure 4 show the operator min at work, So Avg Hard
evaluating the antecedent for a brake-decision calculation 1
involving Rule 2: If speed is high, range of view is low and road
quality is rough, then brake is average. The given numeric inputs
are speed = 70 miles per hour, range of view = 12.5, road quality
= -0.4. The three different pieces of the antecedent yield fuzzy
membership values of 0.75, 0.25 and 0.8, respectively. The fuzzy
“and” operator selects the minimum of the three values, 0.25, and
the fuzzy operation for this rule is complete.
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
Fuzzy inference
Figure 7
Every rule has a weight (between 0 and 1), which is applied to the
value of the antecedent. To make it simple, we choose the weight Conclusion
of 1, which has no effect at all on the implication process.
Because of the rapid development of modern information
A consequent is a fuzzy set represented by a membership technologies, it is possible today to collect, store, transfer and
function, which is reshaped using a function associated with a combine huge amounts of data at relatively low costs. However,
number representing the antecedent. The input for the implication exploiting the information contained in those data archives
process is the antecedent value, and the output is a fuzzy set. in an intelligent way turns out to be difficult. In knowledge
Implication is implemented for each rule and then combined discovery and data mining, there is a tendency to focus on purely
into a single fuzzy set to make a decision for the final output, a data-driven approaches. However, in order to get truly useful
process called aggregation. The input of the aggregation process results, we must take into account background knowledge,
is the list of output functions generated by the implication non-numeric information and uncertainties, and we must focus on
process for each rule. The output of the aggregation process is comprehensible models. Fuzzy logic helps to make a link between
a fuzzy set for each output variable. The whole process — from traditional knowledge-driven approaches and purely data-driven
crisp inputs, implications of all rules and aggregation — is called ones because aspects of knowledge representation and reasoning
fuzzy inference. have dominated research in fuzzy set theory for some time.

Copyright © 2018 WorldQuant, LLC WorldQuant Perspectives April 2018 6


WorldQuant Reshaping the World with Fuzzy Logic
Perspectives 04.27.18

Fuzzy logic, with its ability to handle uncertainties, has been are used in an inference module to generate the output, which is a
widely applied to many engineering and scientific tasks. The fuzzy set. To produce the final output as a crisp number, the fuzzy
examples of the air-conditioner controller and the speed-control set output then undergoes defuzzification to a single value.
module in a self-driving car show us how fuzzy logic can be
All in all, fuzzy logic is not only a theory but another way to look
applied to systems in which information and noise go hand in at the world. Fuzzy logic presents practical ways to solve many
hand. The inputs of the speed-control system are actually crisp problems in various fields. The answer does not always require
numbers that are then fuzzified into fuzzy sets. Rules are derived complicated equations; sometimes it just needs some common
that show hidden relationships within the input data. These rules sense and a little fuzzy thinking.◀

Endnotes
1. A. Zadeh. “Fuzzy Sets.” Information and Control 8, no. 3 3. “Fuzzy Control Programming, Technical Report.”
(1965): 338-53. International Electrotechnical Commission (1997).

2. Eyke Hüllermeier. “Does Machine Learning Need Fuzzy 4. Jerry M. Mendel, “Fuzzy Logic Systems for Engineering:
Logic?” Fuzzy Sets and Systems 281 (2015): 292-99. A Tutorial,” Proceedings of the IEEE 83, no. 3 (1995):345-77.

Thought Leadership articles are prepared by and are the property of WorldQuant, LLC, and are being made available for informational and educational
purposes only. This article is not intended to relate to any specific investment strategy or product, nor does this article constitute investment advice or convey
an offer to sell, or the solicitation of an offer to buy, any securities or other financial products. In addition, the information contained in any article is not
intended to provide, and should not be relied upon for, investment, accounting, legal or tax advice. WorldQuant makes no warranties or representations,
express or implied, regarding the accuracy or adequacy of any information, and you accept all risks in relying on such information. The views expressed
herein are solely those of WorldQuant as of the date of this article and are subject to change without notice. No assurances can be given that any aims,
assumptions, expectations and/or goals described in this article will be realized or that the activities described in the article did or will continue at all or in
the same manner as they were conducted during the period covered by this article. WorldQuant does not undertake to advise you of any changes in the
views expressed herein. WorldQuant and its affiliates are involved in a wide range of securities trading and investment activities, and may have a significant
financial interest in one or more securities or financial products discussed in the articles.

Copyright © 2018 WorldQuant, LLC WorldQuant Perspectives April 2018 7

You might also like