Fuzzy Rules and Reasoning

You might also like

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

8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Fuzzy Rules
and Fuzzy Reasoning
(chapter 3)

Kai Goebel, Bill Cheetham


GE Corporate Research & Development
goebel@cs.rpi.edu
cheetham@cs.rpi.edu

(adapted from slides by R. Jang)

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Fuzzy Reasoning: The Big Picture


Useful for: Automatic Control
Expert Systems
Pattern Recognition
Time Series Prediction
Data Classification
There are different schemes to accomplish these
goals depending on our understanding and
boundary conditions of the world.
Extending:
• crisp domains to fuzzy domains: Extension Principle
• n-ary fuzzy relations: Fuzzy Relations
• fuzzy domains to fuzzy domains: Fuzzy Inference (fuzzy
2 rules, compositional rules of inference)

Page 1

1
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Outline
Extension principle
Fuzzy relations
Fuzzy IF-THEN rules
Compositional rule of inference
Fuzzy reasoning

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Extension Principle
Extends crisp domains of mathematical
expressions to fuzzy domains
A is a fuzzy set on X :
A = µ A ( x1 ) / x1 + µ A ( x 2 ) / x 2 + + µ A ( xn ) / xn

The image of A under f( ) is a fuzzy set B:, i.e., B=f(A)


B = µ B ( x1 ) / y1 + µ B ( x 2 ) / y 2 + + µ B ( xn ) / yn
where yi = f(xi), i = 1 to n.

If f( ) is a many-to-one mapping, then


4
µ B ( y ) = m ax µ A ( x )
−1
x= f ( y)

Page 2

2
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Extension Principle: Example


A=0.1/-2+0.4/-1+0.8/0+0.9/1+0.3/2

f(x)=x2-3
B=0.1/1+0.4/-2+0.8/-3+0.9/-2+0.3/1
=0.8/-3+(0.4v0.9)/-2+(0.1v0.3)/1
=0.8/-3+0.9/-2+0.3/1
5

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Extension Principle, continuous vars.


Let µ A ( x ) = bell ( x ;1.5 ,2 ,0.5)

( x − 1) 2 − 1 if x ≥ 0
and f ( x ) =
x if x < 0

Page 3

3
8/28/2003

Soft Computing: 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 depends on y (x and y are events)
• If x is large, then y is small (x is an observed reading
and Y is a corresponding action)
• y is much greater than x (x and y are numbers)
y−x
if y ≥ x
µR (x, y ) = x+ y+2
0 if y < x
If X={3,4,5} and Y={3,4,5,6,7}
• Express fuzzy relation as a relation matrix
0 0 .1 1 0 .2 0 0 .2 7 0 .3 3
R = 0 0 0 .0 9 0 .1 7 0 .2 3
7
0 0 0 0 .0 8 0 .1 4

Soft Computing: 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) is
µ R R ( x , z ) = ∨ [ µ R ( x , y ) ∧ µ R ( y , z )]
1 2 1 2
y

Note: calculation very similar to matrix multiplication


Properties:
• Associativity: R ( S T ) = ( R S ) T
• Distributivity over union:
R (S T ) = ( R S ) ( R T)
• Week distributivity over intersection:
R (S T ) ⊆ (R S) (R T )
• Monotonicity:
S ⊆ T (R S) ⊆ (R T)

Page 4

4
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Max-min Composition: Example


Let
R1=“x is relevant to y”
R2=“y is relevant to z”
where X={ 0 .9 0.1
0 .1 0.3 0 .5 0 .7 1 0 .2 0 .3
R2 =
R1 = 0 .4 0 .2 0 .8 0 .9 2 0.5 0 .6
0 .6 0.8 0 .3 0 .2 3} 0 .7 0.2
Y={α β χ δ} Z={a b}

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Max-min Composition: Example

Calculate:
2 is relevant to a
X={ 0 .9 0.1
0 .1 0.3 0 .5 0 .7 1 R2 =
0 .2 0 .3
R1 = 0 .4 0 .2 0 .8 0 .9 2 0.5 0 .6
0 .6 0.8 0 .3 0 .2 3} 0 .7 0.2
Y={α β χ δ} Z={a b}

µR
1 R2 (2, aµ) =
R1 R 2 (2 , a ) = m ax ( 0 .4 ∧ 0 .9 , 0 .2 ∧ 0 .2 , 0 .8 ∧ 0 .5 , 0 .9 ∧ 0 .7 )
10
(max(min(0.4,0.9),min(0.2,0.2),min(0.5,0.8), min(0.7,0.9))

Page 5

5
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Max-Star Composition
Max-product composition:
µR 1 R2 ( x , z ) = ∨ [ µ R1 ( x , y ) µ R 2 ( y , z )]
y

In general, we have max-* composition:


µ R1 R2 ( x , z ) = ∨ [ µ R1 ( x , y ) * µ R 2 ( y , z )]
y

where * is a T-norm operator.

Even more generally, we have (S-norm)-(T-norm)


compositions
11

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Linguistic Variables (knowledge rep.)


Precision vs. significance
A linguistic value is characterized by the variable name (age), the
term set, the universe of discourse, a syntactic rule, and a semantic
rule.
The variable name is just that:
age
The term set is the set of its linguistic values:
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, ...}
The syntactic rule refers to how the linguistic values are generated.
The semantic rule defines the membership value of each linguistic
variable.
12

Page 6

6
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Operations on Linguistic Values


Concentration: CON ( A ) = A 2

Dilation: DIL ( A ) = A 0 . 5
Contrast 2 A2 , 0 ≤ µ A( x ) ≤ 05
.
INT( A) =
Intensification: ¬2(¬A) , 05
2
. ≤ µ A( x) ≤ 1

13

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Linguistic Values (Terms)

More or less old: DIL(old) Not young and not old


14
Extremely old: CON(CON(CON(old))) Yout but not too young

Page 7

7
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Fuzzy IF-THEN Rules


General format:
IF x is A THEN y is B
if <antecedent> then <consequent>
Examples:
• 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.

15

Soft Computing: 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 entails B


y y

B B

x x
A A
16

Page 8

8
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Fuzzy If-Then Rules


Two ways to interpret “If x is A then y is B” which describes a
relation between two variables x and y.
• A coupled with B: (A and B)
~
R = A→ B = A× B = µ A ( x ) ∗ µ B ( y )|( x , y )
• A entails B: (not A or B)
- Material implication ¬A ∪ B
¬A ∪ ( A ∩ B)
- Propositional calculus

- Extended propositional calculus


(¬ A ∩ ¬ B ) ∪ B
- Generalization of modus ponens

{
µ R ( x , y ) = su p c µ A ( x ) * c ≤ µ B ( y ) a n d 0 ≤ c ≤ 1
~
}
• Note: these all reduce to not A or B in two-valued logic
17

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Fuzzy IF-THEN Rules


Fuzzy implication function:
µ R ( x , y ) = f ( µ A ( x ), µ B ( y )) = f ( a , b )

A coupled with B

µ R ( x , y ) = min( µ A ( x ), µ B ( y )) µ R ( x , y ) = 0 ∨ ( µ A ( x ) + µ B ( y ) − 1)

µR ( x , y) = µ A ( x) µB ( y ) µ A ( x ) if µ B ( y ) = 1
µ R ( x , y ) = µ B ( y ) if µ A ( x ) = 1
18 0 otherw ise

Page 9

9
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Fuzzy IF-THEN Rules


A coupled with B
Let
µ A ( x ) = bell ( x ;4 ,3,10)
µ B ( y ) = bell ( y ;4 ,3,10 )

algebraic bounded drastic


min
product product product

19

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Fuzzy IF-THEN Rules


A entails B
(not an exhaustive list)

µ R ( x , y ) = m in (1,1 − µ A ( x ) + µ B ( y ))
µA ( x)
(
µ R ( x , y ) = max min ( µ A ( x ) , µ B ( y )),1 − µ A ( x ) ) µ R ( x , y ) = min 1,
µB ( y )

µ R ( x , y ) = m ax (1 − µ A ( x ) , µ B ( y ))

20

Page 10

10
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Fuzzy IF-THEN Rules


A entails B
Let
µ A ( x ) = bell ( x ;4 ,3,10)
µ B ( y ) = bell ( y ;4 ,3,10 )

Zadeh’s Zadeh’s Boolean Gougen’s


arithmetic rule max-min rule Fuzzy Implication Fuzzy Impl.

21

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Compositional Rule of Inference


Same idea as max-min composition
Derivation of y = b from x = a and y = f(x):
y y

b b

y = f(x) y = f(x)

a x x
a
a and b: points
a and b: intervals
y = f(x) : a curve
y = f(x) : an interval-valued
22
function

Page 11

11
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Compositional Rule of Inference, contd.


To find the resulting interval y=b
(which corresponds to x=a)
• construct a cylindrical extension of a
• find intersection with curve
• project intersection to y-axis

23

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Recall: Cylindrical Extension

Base set A Cylindrical Ext. of A

µc ( A ) ( x , y ) = µ A ( x )

24

Page 12

12
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Recall: 2D MF Projection
Two-dimensional Projection Projection
MF onto X onto Y

µ R ( x, y ) µ A( x) = µB( y) =
max µ R ( x, y ) max µ R ( x , y )
y x
25

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Compositional Rule of Inference


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

26

Page 13

13
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Putting it together: Comp. rule of Inf.


Cylindrical extension with base A
µc ( A ) ( x , y ) = µ A ( x )
Intersection of c(A) with F
[
µc ( A )∩ F ( x , y ) = min µc ( A ) ( x , y ), µ F ( x , y ) ]
[
= min µ A ( x ) , µ F ( x , y ) ]
Projection onto y-axis
[
µ B ( y ) = max x min µ A ( x ) , µ F ( x , y ) ]
[
= ∨ x µ A ( x ) ∧ µF ( x , y ) ]
Representation: B = A F
Note: extension principle is special case of compositional
rule of inference
27

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Crisp Reasoning
Modus Ponens:

Fact: x is A
Rule: IF x is A THEN y is B
Conclusion: y is B

28

Page 14

14
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Fuzzy Reasoning
Single rule with single antecedent
Fact: x is A’
Rule: if x is A then y is B
Conclusion: y is B’
(Generalized Modus Ponens)
Graphic Representation:

29

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

FR - Single Rule, Single Antecedent


Graphical Representation:
- find degree of match w between µA(x) and µA’(x)
intuitively: degree of belief for antecedent which
gets propagated; result should be not
greater than w
A’ A B
w

X Y
A’
B’

30 X Y
x is A’ y is B’

Page 15

15
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Fuzzy Reasoning: Single Antecedent


Let A, A’, and B be fuzzy sets of X, X, and Y,
respectively.
Assumption: the fuzzy implication A->B is
expressed as a fuzzy relation R on XxY
The fuzzy set B induced by
fact: x is A’ and
premise: IF x is A then y is B
[
µ B ' ( y ) = max x min µ A ' ( x ) , µ R ( x , y ) ]
[
= ∨ x µ A' ( x ) ∧ µR ( x , y ) ]
31
or: B ' = A' R = A' ( A → B )

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

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

[ ] [
µC ' ( z ) = ∨ x , y µ A ' ( x ) ∧ µ B ' ( y ) ∧ µ A ( x ) ∧ µ B ( y ) ∧ µC ( z ) ]
= ∨ x,y [µ A'
( x ) ∧ µ B ' ( y ) ∧ µ A ( x ) ∧ µ B ( y )] ∧ µ C ( z )
{ [
= ∨ x µ A' ( x ) ∧ µ A ( x ) ]} ∧ {∨ [ µ ( y ) ∧ µ ( y )]} ∧ µ
x B' B C
(z)
w1 w2

C ' = [ A' ( A → C )] ∩ [ B ' ( B → C )]


32

Page 16

16
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

FR - Single Rule, Multiple Antecedents

Graphical Representation
- w1 denotes degree of compatibility between A and A’
and w2 between B and B’
- w1 v
w2 is degree of fulfilment of the rule
A’ A B’ B T-norm C2
w1
w
w2
Z
X Y
A’ B’
C’
Z
x is A’ X y is B’ Y z is C’
33

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Fuzzy Reasoning
Multiple rules with multiple antecedent
Fact: x is A’ and y is B’
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
Conclusion: z is C’
Graphic Representation: (next slide)

34

Page 17

17
8/28/2003

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

Fuzzy Reasoning
Graphics representation:
A’ A1 B’ B1 C1
w1
Z
X Y
A’ A2 B’ B2 C2
w2

Z
X Y
T-norm
A’ B’
C’
Z
x is A’ X y is B’ Y z is C’
35

Soft Computing: Fuzzy Rules and Fuzzy Reasoning

last slide

36

Page 18

18

You might also like