Sunteți pe pagina 1din 28

Fuzzy Rules and Fuzzy Reasoning

Chapter 3: Fuzzy Rules


and Fuzzy Reasoning
J.-S. Roger Jang ( )
CS Dept., Tsing Hua Univ., Taiwan
Modified by Dan Simon
Cleveland State University

Fuzzy Rules and Fuzzy Reasoning

Outline
Extension principle
Fuzzy relations
Fuzzy if-then rules
Compositional rule of inference
Fuzzy reasoning

Fuzzy Rules and Fuzzy Reasoning

Extension Principle
A is a fuzzy set on X :

A A ( x1 ) / x1 A ( x2 ) / x2 A ( x n ) / x n
The image of A under f(.) is a fuzzy set B:

B A ( x1 ) / y1 A ( x2 ) / y2 L A ( xn ) / yn
where yi = f(xi), for i = 1 to n.
If f(.) is a many-to-one mapping, then

B ( y ) max A ( x )
x f

( y)

Fuzzy Rules and Fuzzy Reasoning

Example: Extension Principle


Example 1

y = x2

(x)

0 1 2 3

-1 0 1 2 3

(y)

(y)

0 1
4

(x) Example 2

0 1

Fuzzy Rules and Fuzzy Reasoning

Fuzzy Relations
A fuzzy relation R is a 2D MF:

R {(( x , y ), R ( x , y ))|( x , y ) X Y}
Examples:
x is close to y (x and y are numbers)
x depends on y (x and y are events)
x and y look alike (x and y are persons or
objects)
If x is large, then y is small (x is an observed
instrument reading and y is a corresponding
control action)
5

Fuzzy Rules and Fuzzy Reasoning

Example: x is close to y
A Crisp Relation

40

30

30

20

20

40

10
0

A Fuzzy Relation

10
0

5
X

10

5
X

10

Fuzzy Rules and Fuzzy Reasoning

Example: X is close to Y

1
0.5
0
10
5
Y

(b) Cylindric

Membership Grades

Membership Grades

(a) Fuzzy Relation F on X and Y

0 0

(c) Minimum of (a) and (b)

10

1
0.5
0
10
5
Y

0 0

(d) Projec

Fuzzy Rules and Fuzzy Reasoning

Max-Min Composition
The max-min composition of two fuzzy relations R1
(defined on X and Y) and R2 (defined on Y and Z):

R1 R2 ( x , z ) [ R1 ( x , y ) R2 ( y , z )]
y

(max)

(min)

R (S T ) ( R S ) T
Associativity:
Distributivity over union:
R ( S T ) ( R S ) ( R T )

Weak distributivity over intersection:


R ( S T ) ( R S ) ( R T )
Monotonicity:
8

S T (R S) (R T )

Fuzzy Rules and Fuzzy Reasoning

Max-Star Composition
Max-product composition:

R R ( x , z ) [ R ( x , y ) R ( y , z )]
1

In general, we have max * compositions:

z ) [ R1 ( x ,
where *
isRa1 T-norm
R2 ( x , operator.
y

y ) * R2 ( y , z )]

Fuzzy Rules and Fuzzy Reasoning

Example 3.4 Max * Compositions


R1: x is relevant to y

R2: y is relevant to z
How relevant is
x=2 to z=a?
10

y= y= y= y=
x=1 0.1 0.3 0.5 0.7
x=2 0.4

0.2

0.8

0.9

x=3 0.6

0.8

0.3

0.2

z=a z=b
y= 0.9
y= 0.2

0.1

y=

0.5

0.6

y=

0.7

0.2

0.3

Fuzzy Rules and Fuzzy Reasoning

Example 3.4 (contd.)


x

0.9

0.4
0.2
0.2
0.5
0.8
0.9 0.7

2
3

R1 oR2 (2, a) 0.7 (max-min composition)


R1 oR2 (2, a) 0.63 (max-product composition)
11

Fuzzy Rules and Fuzzy Reasoning

Linguistic Variables
A numerical variable takes numerical values:
Age = 65
A linguistic variables takes linguistic values:
Age is old
A linguistic value is a fuzzy set.
All linguistic values form a term set (set of terms):
T(age) = {young, not young, very young, ...
middle aged, not middle aged, ...
old, not old, very old, more or less old, ...
not very young and not very old, ...}
12

Fuzzy Rules and Fuzzy Reasoning

Operations on Linguistic Values

13

Concentration:

CON ( A) A2

Dilation:

DIL( A) A0.5 (more or less)

Contrast
intensification:

2 A2 ,
0 A ( x ) 0.5
INT ( A)
2

2
(

A
)
, 0.5 A ( x ) 1

intensif.m

(very)

Fuzzy Rules and Fuzzy Reasoning

Linguistic Values (Terms)

How are
these
derived from
the above
MFs?
14

complv.m

Fuzzy Rules and Fuzzy Reasoning

Fuzzy If-Then Rules


General format:
If x is A then y is B
This is interpreted as a fuzzy set

Examples:

15

If pressure is high, then volume is small.


If the road is slippery, then driving is dangerous.
If a tomato is red, then it is ripe.
If the speed is high, then apply the brake a little.

Fuzzy Rules and Fuzzy Reasoning

Fuzzy If-Then Rules


Two ways to interpret If x is A then y is B
A is coupled with B:

A entails B:

(x is A) (y is B)

(x is not A) (y is B)

A
16

Fuzzy Rules and Fuzzy Reasoning

Fuzzy If-Then Rules


Example:
if (profession is athlete) then (fitness is high)
Coupling: Athletes, and only athletes, have high
fitness.
The if statement (antecedent) is a necessary
and sufficient condition.
Entailing: Athletes have high fitness, and nonathletes may or may not have high fitness.
The if statement (antecedent) is a sufficient
but not necessary condition.
17

Fuzzy Rules and Fuzzy Reasoning

Fuzzy If-Then Rules


Two ways to interpret If x is A then y is B:
A coupled with B: (A and B T-norm)
~

R A B A B A ( x ) B ( y )|( x, y )
A entails B: (not A or B)
- Material implication
- Propositional calculus
- Extended propositional calculus
- Generalization of modus ponens
18

Fuzzy Rules and Fuzzy Reasoning

Fuzzy If-Then Rules


Fuzzy implication R ( x , y ) f ( A ( x ), B ( y )) f ( a, b)
A coupled with B (bell-shaped MFs, T-norm operators)
Example: only fit athletes satisfy the rule

19

fuzimp.m

Fuzzy Rules and Fuzzy Reasoning

Fuzzy If-Then Rules


A entails B (bell-shaped MFs)
Arithmetic rule: (x is not A) (y is B) (1 x) + y
Example: everyone except non-fit athletes satisfies the rule

20

fuzimp.m

Fuzzy Rules and Fuzzy Reasoning

Compositional Rule of Inference


Derivation of y = b from x = a and y = f(x):
y

y = f(x)

y = f(x)
a

21

a and b : points

a and b : intervals

y = f(x) : a curve

y = f(x) : interval-valued function

Crisp : if x = a, then y=b

Fuzzy : if (x is a) then (y is b)

Fuzzy Rules and Fuzzy Reasoning

Compositional Rule of Inference


A is a fuzzy set of x and y = f(x) is a fuzzy relation:

22

cri.m

Fuzzy Rules and Fuzzy Reasoning

Fuzzy Reasoning
Single rule with single antecedent
Rule: if x is A then y is B
Premise: x is A, where A is close to A
Conclusion: y is B
Use max of intersection between A and A to get B
A A

B
w

x is A
23

B
X

y is B

Fuzzy Rules and Fuzzy Reasoning

Fuzzy Reasoning
Single rule with multiple antecedents
Rule: if x is A and y is B then z is C
Premise: x is A and y is B
Conclusion: z is C

Use min of (A A) and (B B) to get C


A A

B B

C
w

x is A
24

y is B

C
Y

z is C

Fuzzy Rules and Fuzzy Reasoning

Fuzzy Reasoning
Multiple rules with multiple antecedents
Rule 1: if x is A1 and y is B1 then z is C1
Rule 2: if x is A2 and y is B2 then z is C2
Premise: x is A and y is B
Conclusion: z is C

Use previous slide to get C1 and C2


Use max of C1 and C2 to get C (next slide)

25

Fuzzy Rules and Fuzzy Reasoning

Fuzzy Reasoning
Multiple rules with multiple antecedents
A

A1

B B1

C1
w1

A A2

B B2

C2
w2

B
C

x is A
26

y is B

z is C

Fuzzy Rules and Fuzzy Reasoning

Fuzzy Reasoning: MATLAB Demo


>> ruleview mam21 (Matlab Fuzzy Logic Toolbox)

27

Fuzzy Rules and Fuzzy Reasoning

Other Variants
Some terminology:
Degrees of compatibility (match between
input variables and fuzzy input MFs)
Firing strength calculation (we used MIN)
Qualified (induced) MFs (combine firing
strength with fuzzy outputs)
Overall output MF (we used MAX)

28

S-ar putea să vă placă și