Professional Documents
Culture Documents
Fuzzy Sets
Dealing with uncertainty
Probability theory and statistics
Bayesian statistics
Fuzzy setsnonfrequentist
approach
Fuzzy set
Set of objects without clear
boundaries or not well defined
partial membership
FUZZY RULE-BASED
SYSTEMS
Lecture 15
from: Fuzzy Rule-Based Modeling with
Applications to Geophysical, Biological and
Engineering Systems, by A. Bardossy and
L. Duckstein, CRC Press, 1995
A = {( x, A ( x); x X, A ( x) [ 0,1]}
1
40 - x
A ( x) =
25
0
Crisp set
A ( x) = 0 or 1
Example:
the set of young persons is a
fuzzy set
x 25
25 x 40
x > 40
linear
0
2
25
40
x
3
h level set
A(h) = { x | A ( x) h}
xA
Learningprocess of removing or
reducing fuzziness
Cardinality
car ( A) = i
C ( x ) = 1 A ( x )
i =1
intersection
D = A B
B
D
D ( x) = min ( A ( x), B ( x) )
union:
E = A B
E ( x) = max ( A ( x), B ( x) )
let D = A B
ab : algebraic product
ab
ab
a + b ab a + (1 a )(1 b)
max ( 0, a + b 1) ... many others
D ( x) = t A ( x) , B ( x)
a
b
t co-norm
Linguistic modifiers:
c( x, y ) = 1 t (1 x,1 y )
t ( x, y ) = 1 c(1 x,1 y )
linguistic variables
words, phrases, expressions
x 170 cm
e.g., tall 0
185 - x
A ( x) =
15
1
e.g.
VERY ( x) = ( x)2
called concentration
since [ 0,1] actually has effect
of decreasing membership
dilation modifier
MORE or LESS ( x) = ( x)
contrast modifier
2 ( x) 2
0 ( x) < 0.5
INDEED ( x) =
2
1 2 (1 ( x) ) 0.5 ( x) < 1.0
to translate back to natural language,
find closest Euclidean distance to
membership function of statement
10
B. Fuzzy Numbers
Special case of fuzzy sets
Involves arithmetic operations
A fuzzy subset A of real nos. is a
fuzzy number if:
at least 1 z such that: A ( z ) = 1
[normality]
a<c<b
for all
[convexity]
11
nonconvex
convex
supp( A) = { x | A ( x) > 0}
Trapezoidal
fuzzy no.
A ( x) =
xa
1 a <xa
1
2
a2 a1
A ( x) =
a3 x a < x a
3
a3 a2 2
0
a3 < x
(a1 , a2 , a3 )T
1
a1
a2
a3
13
x
14
a1
a2
a3
a4
0
x a1
x a1
a1 < x a2
a2 a1
1
a2 < x a3
a4 x
a3 < x a4
a4 a3
0
a4 < x
x
15
Fuzzy mean
we often need to defuzzify a fuzzy
seti.e., replace with a crisp value
could take element with highest
membership valuebut may not be
unique or representative of fuzzy set
e.g. 1
(3,3,9)T
3
Fuzzy mean:
M ( A) =
for A = ( a1 , a2 , a3 )T
M ( A) =
16
M ( A) =
2x + x
( x +1 x ) +16
=0
( x +1 x )
=0
+1 + 2 x
(x
+1 ) +
(x
+1 ) + ( x )
2
t A (t )dt
A (t )dt
L 1
(x )
a1 + a2 + a3
3
Fuzzy median:
18
17
A (t )dt =
A (t )dt
m ( A)
19
C. Fuzzy Rules
d ( A, B ) =
20
IF: a1 is Ai1
a2 is Ai 2
THEN: Bi
{AND
or simplified:
Ai1
Ai 2
premises
ak is Aik
OR XOR
Aik THEN:
21
Bi
consequence
22
(not A1 ) = 1 A1 (a1 )
( A1 AND A2 ) = A1 (a1 ) A2 (a2 )
( A1 OR A2 ) = A1 (a1 ) + A2 (a2 )
A1 (a1 ) A2 (a2 )
( A1 XOR A2 ) = A1 (a1 ) + A2 (a2 )
2 A1 (a1 ) A2 (a2 )
23
min-max inference
( A1 OR A2 ) = max A1 (a1 ), A2 ( a2 )
)
)
))
24
Example:
IF: (1,2,3)T AND
((1,2,6)T OR (4,5,7)T) AND (2.5,4,4.5)T
THEN: (0,1,2)T
If: a1=1.5
0.5
a2=4
0.5
0.8
0.8
a3=4.8
0.333
a4=3
product gives DOF=0.150
min-max gives DOF=0.333
25
k =1
k =1
Di = Ai ,k (ak ) = k
Degree of fulfillment for OR coupling
2 clauses
Di (1 ,..., K ) = Di ( Di (1,..., K 1 ), K )
26
27
K 1
Di = 1
1 Ai ,k (ak )
K
k =1
1 = A (a1 ) = 0.9
1
1
Di =
(a )
K Ai ,k k
k =1
2 = A (a2 ) = 0.9
3 = A (a3 ) = 0.5
3
4 = A (a4 ) = 0.1
4
28
5 = A (a5 ) = 0
5
29
Di = 1
= 0.355
Di =
= 0.613
31
Minimum combination
B ( x) = max
B ( x) = min min i , B ( x)
i >0
minimum
maximum
additive
33
B ( x) = min i B ( x)
i >0
i =1,..., I
{min ( ,
i
Bi ( x )
)}
)}
emphasize agreement--vague
B ( x) = max i B ( x)
i =1,..., I
34
35
Additive combination:
1) Weighted sum:
i i B ( x)
i B ( x)
i =1
B ( x) =
max
u
B ( x) =
i B (u )
i=1
max
u
[continuous]
= car( Bi ) = i ( j ) [discrete]
j
37
i min ( i , B ( x) )
min ( i , B (u ) )
max
i =1
B ( x) =
i =1
min ( i , B ( x) )
B ( x) =
i =1
B ( x) dx
i =1
i i B (u )
max
i =1
i min ( i , B (u ) )
i =1
39
10
Example:
23
<
x
0.5(
3)
3
7
B ( x ) =
0.4 4 x 23 < x < 4
2 7
4 x
min 0.4
,
0.5
(
3)
x
23
4 x
=
=
0.4
0.5
(
x
3)
@
x
7
2
40
cresting minimum
4 x 4 x
min 0.4,
=
min ( 0.5, ( x 3) ) = x 3
4 x
10
= x3 @ x =
2
3
10
<
x
x
(
3)
3
3
B ( x ) =
10
4 x
<x<4
2
3
41
0.5
crest
min
1 2
min
comb
3 4 5 6
1
0.5
max
comb
crest
max
1 2
42
3 4 5 6
x
43
11
f ( x) =
x
0.4
2
4 x
0.4
2
4 x
0.4
+0.5( x - 3)
2
0.5(5 x)
max
0<x 2
f ( x) =
x
2
4 x
0.2
2
4 x
0.2
+0.5( x - 3)
2
0.5(5 x)
0.2
so... Bi ( x) = 2 f ( x)
2< x3
3< x 4
4< x5
i B (u ) = 0.5
44
1
area under B1 : = 2
1
1
area under B2 : = 1
2
45
1 wtd.
0<x 2
sum
0.5
2< x3
1 2
3< x 4
4< x5
0.5
B ( x) = 2 f ( x)
crest.
wtd.
sum
1 2
46
norm. wtd.
sum
3 4 5 6
crest.
norm.
wtd. sum
3 4 5 6
x
47
12
E. Defuzzification
combination
same support
Disadvantage of additive methods
for repeating rules, gives different
48
B (b) = max B ( x)
x
M ( B) =
i
i =1
49
Defuzzification by maximum
b = D f ( B) = M ( B)
1) maximum
2) mean
3) median
i
i =1
M ( Bi )
1
i
50
i =1
i
i =1
THEN: ( M ( Bi ), i )
51
13
b = D f ( B ) = m( B )
52
F. Rule Systems
Rule system
IF Ai ,1 Ai ,2
(for i = 1,..., I )
53
Ai ,k fuzzy subsets of X k
Bi fuzzy subsets of Y
54
14
Example:
min 1 B1 ( x), 2 B2 ( x) = 0
57
are continuous
If nondegenerate and complete
A supp(i )
i =1
e.g., above 1 x 3; 2 x 4
1 x 4
58
59
15
for 1 x 2
Example:
for 2 x 3
Di values are (3 x ), 0,
x
1( x 1) + 3(0) + 2
3 = 5x 3
for 1 x 2 :
4x 3
x
( x 1) + 0 +
3
x
1(3 x) + 3(0) + 2
3 = 9 x
for 2 x 3 :
9 2x
x
(3 x) + 0 +
3
62
for 3 x 4
Di values are 0, ( x 3),
for 4 x 5
Di values are 0, (4 x),
x
resp.
3
x
resp.
3
6 x
resp.
3
6 x
resp.
3
61
6 x
1(0) + 3( x 3) + 2
3 7x 15
for 3 x 4 :
=
2x 3
6 x
0 + x 3+
3
6 x
1(0) + 3(5 x) + 2
3 57 11x
for 4 x 5 :
=
21 4x
6 x
0+5 x +
3
63
16
3
2.5
2
1.5
defuzzified
response
1
0.5
0
0
Proposition:
If: A = a1 , a1+ aK , aK+
64
Corollary:
Every nondegenerate rule system,
inference and combination method
with mean defuzzification can be
replaced by a rule system using:
65
AND operator
product inference
weighted combination
fuzzy mean defuzzification
e.g., least-squares
67
17
G. Membership Functions in
Rule Systems
What is a good rule?
How crisp should arguments and
responses be?
What shape for membership
functions?
If we are using normed weighted sum
combination and mean
defuzzificationDOESNT MATTER!
69
70
71
18
72
Calculate means :
fuzzy numbers :
H = (0.4,1.0,1.0)
L = (0.0,0.0,0.7)T
1
73
1.0
75
19
2
for
7
1 nutrients x
H (0.5) =
6
1
L (0.6) =
for
7
2 algae y
H (0.6) =
6
Use product inference for DOF :
AND rule fulfillment grade (i, j) :
DOF:
L (0.5) =
76
1
0.3
L =
L (0.6)
H (0.5)
1/18
1/42
L (0.5)
2/21
2/49
Transition table:
H (0.6)
1
0.35
1 0.7
2 0.7
2 2.4
1 2.4
0.35 +
0.35 +
0.3 +
0.3
21 3
49 3
42 3
x (1) = 18 3
1
2
2
1
0.35 + 0.35 +
0.3 +
0.3
18
21
49
42
= 0.4319
1 2.4
2 0.7
2 0.7
1 2.4
0.3 +
0.35 +
0.35 +
0.3
21 3
49 3
42 3
y (1) = 18 3
1
2
2
1
0.3 + 0.35 +
0.35 +
0.3
18
21
49
42
= 0.4222
78
Rule
DOF
HH LH
LH LL
LL HL
HL HH
1/18
2/21
2/49
1/42
there are
really 8 rules:
HHL AND H
[x]
[y]
77
oscillatory behavior
0.6
0.5
t
nutrients x(t) same as solution of
algae y(t)
coupled diff. eqs.
79
20
Counting algorithm:
1. Define support:
Training set:
T = {( a1 ( s),..., aK ( s ), b( s ) ) ; s = 1,..., S }
2. Assume
where mean i ,k
for each Ai ,k
1
=
ak (s)
Ni sR
i
80
+
3. Define support: i , i , i
T
81
i = min b( s )
sRi
i =
i+
1
Ni
b( s )
sRi
= max b( s )
sRi
+
IF i1 , i1 , i+1 AND iK
, iK , iK
82
)T
THEN: i , i , i+
)T
)T
83
21
Questions:
How to define supports?
Use split sampling methods?
Weighted counting algorithm
considers minimal DOF
calculate DOFs i ( s )
For each rule i:
i =
i ( s )>
i ( s ) b ( s )
i ( s ) >
i ( s )
i+ = max b( s )
i ( s )>
= min b( s )
i ( s ) >
84
min
R ( a1 ( s ),..., aK ( s ) ) =
i (s) M ( Bi )
i =1
i (s)
i =1
85
86
87
22
Example:
For comparison of the algorithms
Training set with 25 sets of
observation data (a1(s),b(s)),
s=1,,25
Develop rule system for the interval
[0,8]
Highly variable, nonlinear behavior
Training
Set
88
89
90
91
23
Least-squares algorithm
For = 0.5; smaller supports; crisper
L( x) = R ( x) =
1
L
1
( cos ( x ) + 1)
2
L-R fuzzy nos.
smooth
approximations
to triangular
fuzzy numbers
92
93
Least-squares
[correlation = 0.96]
training set
counting algorithm
weighted counting
algorithm
94
6th order
polynomial
[correlation = 0.89]
training set
least-squares
6th order polynomial
95
24
J. Application: Reservoir
Operation*
Consequence:
Actual release
Typical Rule:
IF pool elevation is Ai,1 AND
Net inflows is Ai,2 AND
Forecast demand is Ai,3 AND
Time of year is Ai,4
THEN release is Bi
Premises:
Reservoir pool elevations
Inflows [net]
Forecasted demands (power)
Time of year
Shresha, B., L. Duckstein, and E. Stakhiv. (1996).
Fuzzy Rule-Based Modeling of Reservoir
Operation, ASCE Journal of Water Resources
Planning and Management, 122(4), 262-269.
96
97
consequence
98
recreation
habitat
99
25
Capacity: 371,000 AF
Daily data from 1980 to 1992
Training set uses 1989
9 TFNs cover elevation 620 ft. to
677.2 ft.
8 TFNs: inflows from 0 to 180,000
day-second-ft
Supports cover entire range25%
overlap
100
101
102
103
26