# 7. Decision Making

Document Sample

```					       7. Decision Making

2012                        1
7.1. Fuzzy Inference System (FIS)
Fuzzy inference is the process of formulating the mapping from a
given input to an output using fuzzy logic. Fuzzy inference systems
have been successfully applied in fields such as automatic control,
data classification, decision analysis, expert systems, and
computer vision.

Inference
Input   Fuzzifier                     Defuzzifier   Output
Engine

Fuzzy           if then Rule base
Knowledge base

2012                                                                2
Step1: Fuzzification
• Fuzzifier converts a crisp input into a fuzzy variable (linguistic
variable) using the membership functions stored in the fuzzy
knowledge base.
• Definition of the membership functions must:
– reflect the designer's knowledge
– provide smooth transition between member and nonmembers of
a fuzzy set
– simple to calculate

• Typical shapes of the membership function are Gaussian,
trapezoidal and triangular.

2012                                                                     3
For example assume we want to evaluate the health of a person
based on his height and weight.
The input variables are the crisp numbers of the person’s height
and weight.
Fuzzification is a process by which the numbers are changed into
linguistic words

2012                                                                      4
Fuzzification of Height:

Fuzzification of Weight

2012                         5
Step2: Infgerence Engine (Rules)
•    Rules   reflect experts decisions.
•    Rules   are tabulated as fuzzy words
•    Rules   can be grouped in subsets
•    Rules   can be redundant
•    Rules   can be adjusted to match desired results

Rules function
• Rules are tabulated as fuzzy words
– Healthy (H)
– Somewhat healthy (SH)
– Less Healthy (LH)
– Unhealthy (U)

2012                                                      6
Step2:Rules
Using If-Then type fuzzy rules converts the fuzzy input to the
fuzzy output.

2012                                                               7
In our example:
Rules function
• Rules are tabulated as fuzzy words
– Healthy (H)
– Somewhat healthy (SH)
– Less Healthy (LH)
– Unhealthy (U)

2012                                     8
2012   9
Step3: Calculate
• For a given person, compute the membership of his/her
weight and height
• Assume that a person height is 6’ 1”, and weight is 140 lb

Membership of Height

Membership of Weight

2012                                                         10
Step4: Activate Rules

2012                      11
2012   12
Step5: compute Decision Function

f = {U, LH, SH, H}
f = {0.3, 0.7, 0.2, 0.2}

2012                                     13
f = {U, LH, SH, H}
f = {0.3, 0.7, 0.2, 0.2}

2012                              14
Step6: Compute Final Decision (defuzzify)
Defuzzification converts the fuzzy output of the inference engine
to a crisp output, among other methods two methods are often
used:
–Maximum Method (not often used)
– Centroid of area

2012                                                                  15
Maximum Method:
Fuzzy set with the largest membership value is selected.

In our example: Fuzzy decision
• Final Decision (FD) = Less Healthy
• If two decisions have same membership max, use the average
of the two.

2012                                                             16
Centroid Method:

By geometric decomposition
The centroid of a plane figure X can be computed by dividing it into a finite
number of simpler figures , computing the centroid Ci and area Ai of each part,
and then computing

2012                                                                         17
but

2012    18
example:
We examine a simple two-input one-output problem that includes
three rules:

Rule: 1
IF      brakes are    good
OR      driver is     sleepy
THEN risk      is     low
Rule: 2
IF      brakes are    thin
THEN risk      is     normal
Rule: 3
THEN risk      is     high

2012                                                               19
Step1: Fuzzification
The first step is to take the crisp inputs (state of the brakes and
the state of the driver), and determine the degree to which these
inputs belong to each of the appropriate fuzzy sets.

2012                                                                    20
Step2:Rules’ Evaluation

o The second step is to take the fuzzified inputs, and apply
them to the antecedents of the fuzzy rules.

o If a given fuzzy rule has multiple antecedents, the fuzzy
operator (AND or OR) is used to obtain a single number that
represents the result of the antecedent evaluation.

o This number (the truth value) is then applied to the consequent
membership function.

2012                                                                  21
2012   22
o Now the result of the antecedent evaluation can be applied to
the membership function of the consequent.

o The most common method of correlating the rule consequent
with the truth value of the rule antecedent is to cut the
consequent membership function at the level of the antecedent
truth. This method is called clipping (alpha-cut).

o Since the top of the membership function is sliced, the clipped
fuzzy set loses some information.

o However, clipping is still often preferred because it involves less
complex and faster mathematics, and generates an aggregated
output surface that is easier to defuzzify.

2012                                                                      23
Step 3: Aggregation of the rule outputs
oWe then take the membership functions of all rule consequents
previously clipped and combine them into a single fuzzy set.
o The input of the aggregation process is the list of clipped
consequent membership functions, and the output is one fuzzy set
for each output variable.

2012                                                               24
Step 4: Defuzzification
o The last step in the fuzzy inference process is defuzzification.

o Fuzziness helps us to evaluate the rules, but the final output of a
fuzzy system has to be a crisp number.

o The input for the defuzzification process is the aggregate output
fuzzy set and the output is a single number.

Maximum Method
Risk is high

2012                                                                   25
Centroid Method:
Degree of
Membership
1.0
0.8
0.6
0.4
0.2

0.0
0   10   20   30   40   50   60      70   80   90   100
67.4               Z

2012                                                                   26
7.2. MATLAB Fuzzy Logic Toolbox

 Introduction
 Graphical User Interface (GUI) Tools
 Example: Dinner for two

2012                                       27
Introduction
The Matlab fuzzy logic toolbox facilitates the development of
fuzzy-logic systems using:
• graphical user interface (GUI) tools
• command line functionality
The tool can be used for building
• Fuzzy Expert Systems
• Adaptive Neuro-Fuzzy Inference Systems (ANFIS)

2012                                                              28
Graphical User Interface (GUI) Tools
There are five primary GUI tools for building, editing, and
observing fuzzy inference systems in the Fuzzy Logic Toolbox:
•    Fuzzy Inference System (FIS) Editor
•    Membership Function Editor
•    Rule Editor
•    Rule Viewer
•    Surface Viewer

2012                                                              29
Graphical User Interface (GUI) Tools

2012                                          30
Graphical User Interface (GUI) Tools
Fuzzy Inference System (FIS) Editor

Define number of
input and output
variables

inference                               names of input,
functions                               output variables

2012                                                 31
Graphical User Interface (GUI) Tools
Membership Function Editor

Select & edit
attributes of
membership
function

Display & edit                             Name & edit
values of current                           parameters of
variable                                 membership
function

2012                                                32
Graphical User Interface (GUI) Tools
Rule Editor

Rules –
automatically
updated

Create and edit
rules

2012                                            33
Graphical User Interface (GUI) Tools
Rule Viewer

Shows how input
variable is used in
rules

Shows how output
variable is used in
rules; shows
output of fuzzy
system

2012                                                   34
Graphical User Interface (GUI) Tools
Surface Viewer

Shows output
surface for any
system output
versus any one (or
Specify input and                              two) inputs
output variables

2012                                                  35
Now apply MATLAB Fuzzy Logic Toolbox for the same example
Use the Fuzzy-instruction and adjust no. of inputs and outputs
and method of defuzzification

2012                         Hany Selim                            36
Step1: Fuzzification Breaks functions

2012                       Hany Selim   37
Driver functions

2012               38
Risk function (output)

2012                     39
Rules

2012      Hany Selim   40
Define input and find output

output

input

2012                       Hany Selim      41
Surface Viewer:

2012                42
Try the example:
Example: Tip Calculator
Golden rules for tipping:
1. IF the service is poor OR the food is bad,      THEN tip is cheap (5%)*.

2. IF the service is good,                         THEN tip is average (15%).

3. IF the service is excellent OR the food is delicious,
THEN tip is generous (25%)

Use Gaussian functions for service, and
Use Trapezoidal functions for food, and
Use Triangular functions for tip

*Peak of Triangular function
•    Universe of discourse for Service and Food=1 to 10
•    Calculate Tip for Service=3 and food=6

2012                                                                         43
Areas in which Fuzzy Decision-making Systems can be used
They include the following:
Manufacturing: Scheduling and planning materials flow, resource
allocation, routing, and machine and equipment design.
Traffic systems: Routing and signal switching.
planning.
Computers: Memory allocation, task scheduling, and hardware
design.
Process industries: Monitoring, performance assessment, and
failure diagnosis.
Science and medicine: Medical diagnostic systems, health
monitoring, and automated interpretation of experimental data.
Business: Finance, credit evaluation, and stock market analysis.

2012                                                                  44

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 36 posted: 8/13/2012 language: English pages: 44