Click here to load reader

Fuzzy Sets, Fuzzy Logic, and Fuzzy Systemsbelohlavek.inf.upol.cz/vyuka/flfs_II.pdf · and w. R is a fuzzy relation. Explicit rule: R(u,v,w) = max(0,1 −d(v,uw)), where d(v,uw) is

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

  • Fuzzy Sets, Fuzzy Logic, and FuzzySystems II

    SSIE 617 – Fall 2008

    Radim BELOHLAVEK

    Dept. Systems Sci. & Industrial Eng.Watson School of Eng. and Applied Sci.Binghamton University – SUNY

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 1 / 61

  • Fuzzy Relations

    Definition (n-ary fuzzy relation)

    An n-ary L-fuzzy relation between sets U1, . . . ,Un is an L-fuzzy set inU1 × · · · × Un. If U1 = · · · = Un, we speak of an n-ary L-fuzzy relation inU.

    – That is, an n-ary L-fuzzy relation R is a mappingR : U1 × · · · × Un → L. We assume again that L = 〈L, · · · 〉 is acomplete residuated lattice.

    – For ui ∈ Ui (i = 1, . . . , n), R(u1, . . . , un) is interpreted as a degree towhich u1, . . . , un are related.

    – Occasionally, we say just fuzzy relation or L-relation.

    – Obviously, if L = {0, 1}, the concept of an L-relation coincides withthat of (characteristic function of) ordinary relation.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 2 / 61

  • J. A. Goguen (1967)

    . . . the importance of fuzzy relations is almost self-evident. Science is, in asense, the discovery of relations between observables . . . Difficulties arise inso-called “soft” sciences because the relations involved do not appear tobe “hard” as they are, say, in classical physics . . .

    Example (fuzzy relations)

    – Similarity: Let U be a set of objects. Let ≈: U × U → [0, 1] assign toevery u, v ∈ U a degree (u ≈ v) ∈ [0, 1] to which u and v are similar.≈ is a binary fuzzy relation. Many measures of similarity for variouskinds of objects have been proposed in the literature.

    – Betweennes: Let U be a set of points in a plane. Let R(u, v ,w) ∈ Ldenote degree to which v lies approximately on the line connecting uand w . R is a fuzzy relation. Explicit rule:R(u, v ,w) = max(0, 1 − d(v , uw)), where d(v , uw) is the distancebetween point u and the line connecting u and w .

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 3 / 61

  • Example (fuzzy relations)

    Relational databases: Let D ⊆ U1 × · · · × Un be an n-ary relation. D canbe seen as a database (table) with columns corresponding to U1, . . . ,Un(Ui are called domains in relational databases). 〈u1, . . . , un〉 ∈ D meansthat 〈u1, . . . , un〉 is stored in the database (i.e. 〈u1, . . . , un〉 is one row ofthe table).

    name age education

    Adams A. 50 BusinessBrown B. 31 Computer ScienceCross C. 30 LawDobb D. 25 Computer EngineeringEdwards E. 32 Systems Science· · · · · · · · ·

    Let Q denote an approximate query such as “show all employees with agearound 30” or “show all candidates with education similar to ComputerEngineering” or “show all pictures similar to My Photograph”. Let for〈u1, . . . , un〉 ∈ D denote by RQ(u1, . . . , un) a degree to which〈u1, . . . , un〉 ∈ D satisfies query Q.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 4 / 61

  • Example (cntd.)

    Then RQ is a fuzzy relation. It can be depicted in a table with the firstcolumn of row 〈u1, . . . , un〉 containing the degree RQ(u1, . . . , un).Examples: For Q being “show all employees with age around 30”, the tabledescribing RQ (provided RQ(u1, u2, u3) = max(0, 1 − 0.25 · |30 − u2|)) is:RQ name age education

    0 Adams A. 50 Business0.75 Brown B. 31 Computer Science1.0 Cross C. 30 Law0 Dobb D. 25 Computer Engineering0.5 Edwards E. 32 Systems Science

    · · · · · · · · ·

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 5 / 61

  • exercise

    – Think of various vague relationships such as “being close”, “beingsimilar”, “being a prerequisite for”, etc. Try to formalize therelationships by means of fuzzy relations. Hint: In case of similarity ofobjects, try to find a suitable representation of objects and define thesimilarity degree based on the representation. For instance, if object xrepresented by a set Ax ⊆ F of features in F (such as AJohn = {male,married, MS}), we may define

    x ≈ y = |Ax ∩ Ay ||Ax ∪ Ay |

    if Ax ∩ Ay 6= ∅ and x ≈ y = 1 if Ax ∩ Ay = ∅.– Go back to the databases example. Think of various examples of

    databases. Formulate various approximate queries and show thecorresponding fuzzy relations.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 6 / 61

  • Representation of Binary Fuzzy Relations

    Analogously to ordinary binary relations, binary fuzzy relations can berepresented by matrices (tables). Example: Let X = {a, b, c},Y = {1, 2, 3, 4}. A binary fuzzy relation with L = [0, 1] given by

    R = {1/〈a, 1〉, 0.5/〈a, 2〉, 0.1/〈a, 4〉, 0.8/〈b, 2〉, 1/〈b, 4〉, 0.8/〈c , 1〉}R can be represented by table (left) or an [0, 1]-valued matrix MR (right).R 1 2 3 4

    a 1 0.5 0 0.1b 0 0.8 0 1c 0.8 0 0 0

    MR =

    1 0.5 0 0.10 0.8 0 10.8 0 0 0

    .Matrix MR representing fuzzy relation R ∈ L{x1,...,xm}×{y1,...,yn} is anm × n-matrix with entries mij defined by

    mij = R(xi , yj).

    Graph representation: R ∈ L{x1,...,xm}×{y1,...,yn} is represented by anoriented graph, m + n nodes correspond to x1, . . . , xm, y1, . . . , yn, ifR(xi , yj) > 0, we add an arrow from node corresponding to xi to nodecorresponding to yj and attach R(xi , yj) as a label to this arrow.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 7 / 61

  • Operations with Fuzzy Relations

    – Fuzzy relations are fuzzy sets. Therefore, any general operation withfuzzy sets (intersections, unions, a-cuts, . . . ) or relationship betweenfuzzy sets (inclusion, equality) can be applied to fuzzy relations aswell.

    – As an example, think of the database table above (or other). If RQ1and RQ2 are the fuzzy relations corresponding to the results ofapproximate queries Q1 (“show candidates with age around 30”) andQ2 (“show candidates with education similar to Computer Science”)then intersection RQ1 ⊗ RQ2 corresponds to the result of approximateconjunctive query Q1 AND Q2.

    – In addition to that, we introduce new operations such as compositionsof fuzzy relations, inverse fuzzy relations, extensions of fuzzyrelations, etc. This is on what we focus on the subsequent slides.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 8 / 61

  • Definition

    An inverse relation of a fuzzy relation R between U and V is a fuzzyrelation R−1 between V and U defined for u ∈ U, v ∈ V by

    R−1(v , u) = R(u, v).

    Example

    Let X = {a, b, c}, Y = {1, 2, 3, 4}, L = [0, 1], andR = {1/〈a, 1〉, 0.5/〈a, 2〉, 0.1/〈a, 4〉, 0.8/〈b, 2〉, 1/〈b, 4〉, 0.8/〈c , 1〉}.

    ThenR−1 = {1/〈1, a〉, 0.5/〈2, a〉, 0.1/〈4, a〉, 0.8/〈2, b〉, 1/〈4, b〉, 0.8/〈1, c〉}.

    Matrices of R and R−1:

    MR =

    1 0.5 0 0.10 0.8 0 10.8 0 0 0

    . MR−1 =

    1 0 0.80.5 0.8 00 0 0

    0.1 1 0

    .

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 9 / 61

  • Inverse Fuzzy Relations

    The following lemma shows obvious properties of inverse relations. Try toprove it.

    Lemma

    For R,R1,R2 ∈ LX×Y we have

    R = (R−1)−1,

    (⋂i

    Ri )−1 =

    ⋂i

    R−1i ,

    (⋃i

    Ri )−1 =

    ⋃i

    R−1i ,

    (R1 ⊗ R2)−1 = R−11 ⊗ R−12 ,

    (R1 → R2)−1 = R−11 → R−12 ,

    S(R1,R2) = S(R−11 ,R

    −12 ),

    (R1 ≈ R2) = (R−11 ≈ R−12 ).

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 10 / 61

  • Compositions of Fuzzy Relations

    David Hume (An Enquiry Concerning Human Understanding, 1758)

    From causes which appear similar, we expect similar effects. This is thesum total of all our experimental conclusions.

    The basic situation is this: Given an L-relation R between X and Y andan L-relation S between Y and Z , it might be desirable to obtain from Rand S a binary L-relation R ∗ S between X and Z . R ∗ S will be called thecomposition of R and S . In this general setting, a composition of binaryL-relations between X and Y , and Y and Z is therefore a mapping∗ : LX×Y × LY×Z → LX×Z , i.e. a mapping assigning to any R ∈ LX×Yand S ∈ LY×Z their composition R ∗ S ∈ LX×Z . We are interested incases where ∗ can be defined by logical formulas, i.e. in cases where thecomposition can be described verbally.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 11 / 61

  • Compositions of Fuzzy Relations

    Let X be a set of patients, Y be a set of symptoms (of diseases), and Zbe a set of diseases. Let R be a fuzzy relation between X and Y , S be afuzzy relation between Y and Z . R may represent results of a medicalexamination, i.e. for a patient x ∈ X and a symptom y ∈ Y (e.g. aheadache), R(x , y) is a degree to which x has a headache (notice thattypically, R is a noncrisp fuzzy relation). Similarly, S may represent expertknowledge (can be found in medical literature), i.e. for a symptom y ∈ Yand a disease z ∈ Z , S(y , z) is the truth value to which y is a symptom ofz (again, S is a typical fuzzy relation).Now, can we find out which patients have which diseases? The fuzzyrelation in question between X (patients) and Z (diseases) results as acertain composition R ∗ S of R and S , using appropriate compositionoperation ∗.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 12 / 61

  • Definition (composition of fuzzy relations)

    Let R and S be L-fuzzy relations between X and Y and between Y andZ . Fuzzy relations (R ◦ S), (R C S), (R B S), and (R �S) between X andZ are defined by

    (R ◦ S)(x , z) =∨

    y∈Y (R(x , y) ⊗ S(y , z)),(R C S)(x , z) =

    ∧y∈Y (R(x , y) → S(y , z)),

    (R B S)(x , z) =∧

    y∈Y (S(y , z) → R(x , y)),(R �S)(x , z) =

    ∧y∈Y (R(x , y) ↔ S(y , z)),

    for all x ∈ X , z ∈ Z .

    – (R ◦ S), (R C S), (R B S), and (R �S) are called the ◦-, C-, B-,�-compositions (products) of R and S .

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 13 / 61

  • – For L = {0, 1}, (R ◦ S) is just the (characteristic function) of theusual composition of R and S . (Show in detail!)

    – Describe the meaning of (R C S), (R B S), and (R �S). (Cf. nextpoint.)

    – meaning:– (R ◦ S)(x , z) = truth degree of

    “there exists y ∈ Y such that 〈x , y〉 is in R and 〈y , z〉 is in S .”– (R C S)(x , z) = truth degree of

    “for each y ∈ Y : if 〈x , y〉 is in R then 〈y , z〉 is in S .”– (R B S)(x , z) = truth degree of

    “for each y ∈ Y : if 〈y , z〉 is in S then 〈x , y〉 is in R.”– (R �S)(x , z) = truth degree of

    “for each y ∈ Y : 〈x , y〉 is in R iff 〈y , z〉 is in S .”– In terms of the patient-symptom-disease example, (R ◦ S)(x , z) is the

    degree to which x has a symptom which is characteristic of z ,(R C S)(x , z) is the degree to which every symptom of x ischaracteristic of z , etc.

    – One could define other compositions, e.g. R ∗ S(x , z) could express adegree to which most of the symptoms of x are characteristic for z .

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 14 / 61

  • Example

    Consider crisp relations R between X and Y and S between Y and Zgiven by the following matrices:

    MR =

    0 1 00 0 00 0 11 1 0

    , MS = ( 1 01 10 0

    )

    For matrices MR◦S , MRCS , MRBS , and MR � S representing R ◦ S , R C S ,R B S , and R �S we have:

    MR◦S =

    1 10 00 01 1

    ,MRCS = 1 11 1

    0 01 0

    ,MRBS = 0 10 0

    0 01 1

    ,MR � S = 0 10 0

    0 01 0

    .

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 15 / 61

  • Example

    Consider fuzzy relations R between X and Y and S between Y and Zgiven by the following matrices:

    MR =

    0 1 0.40.4 0.2 0.20.2 0.4 0.81 1 0

    , MS = ( 1 0.11 0.90 0.2

    )

    Consider Gödel (minimum) operations on [0, 1]. For matrices MR◦S ,MRCS , MRBS , and MR � S representing R ◦ S , R C S , R B S , and R �Swe have:

    MR◦S =

    1 0.90.4 0.20.4 0.41 0.9

    ,MRCS = 0 0.20 0.1

    0 0.11 0.1

    ,MRBS = 0 00.2 0.2

    0.2 0.41 0

    ,MR � S =

    0 00 0.10 0.11 0

    .Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 16 / 61

  • exercise

    – Determine MR◦S , MRCS , MRBS , and MR � S form the previousexample with Lukasiewicz and product structures.

    – Notice the similarity in calculation of MR◦S , MRCS , MRBS , andMR � S compared tothe matrix multiplication from linear algebra. In linear algebra, we have

    (MR·S)ij =∑

    l∈Y (MR)il · (MS)lj ,i.e. we compute “row of MR times column of MS”. The samehappens for MR◦S , MRCS , MRBS , and MR � S , but the operationsinvolved are different. For example, in MR◦S ,

    ∑is replaced by

    ∨and

    · is replaced by ⊗.– Define fuzzy relations R between patients and symptoms, and S

    between symptoms and diseases. Determine R ◦ S , R C S , R B S ,and R �S

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 17 / 61

  • Properties of Compositions of Fuzzy Relations

    We list selected properties. Proofs and more properties can be found inChapter 6 of Belohlavek R.: Fuzzy Relational Systems: Foundations AndPrinciples. Kluwer, New York, 2002. [available athttp://bingweb.binghamton.edu/~rbelohla/Chap6-Belohlavek-FuzzyRelationalSystems.pdf]

    Theorem (products and similarity)

    (R1 ≈ R2) ⊗ (S1 ≈ S2) ≤ (R1 ◦ S1) ≈ (R2 ◦ S2),(R1 ≈ R2) ⊗ (S1 ≈ S2) ≤ (R1 C S1) ≈ (R2 C S2),(R1 ≈ R2) ⊗ (S1 ≈ S2) ≤ (R1 B S1) ≈ (R2 B S2),(R1 ≈ R2) ⊗ (S1 ≈ S2) ≤ (R1 �S1) ≈ (R2 �S2).

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 18 / 61

    http://bingweb.binghamton.edu/~rbelohla/Chap6-Belohlavek-FuzzyRelationalSystems.pdfhttp://bingweb.binghamton.edu/~rbelohla/Chap6-Belohlavek-FuzzyRelationalSystems.pdf

  • Theorem (products and inverse relations)

    (R ◦ S)−1 = S−1 ◦ R−1,(R C S)−1 = S−1 B R−1,

    (R B S)−1 = S−1 C R−1,

    (R �S)−1 = S−1 �R−1.

    Theorem (products and associativity)

    R ◦ (S ◦ T ) = (R ◦ S) ◦ T ,R C (S B T ) = (R C S) B T ,

    R C (S C T ) = (R ◦ S) C T ,(R B S) B T = R B (S ◦ T ).

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 19 / 61

  • Theorem (products and distributivity)

    (⋂i

    Ri ) ◦ S ⊆⋂i

    (Ri ◦ S), R ◦ (⋂i

    Si ) ⊆⋂i

    (R ◦ Si ),

    (⋃i

    Ri ) ◦ S =⋃i

    (Ri ◦ S), R ◦ (⋃i

    Si ) =⋃i

    (R ◦ Si ),⋃i

    (Ri C S) ⊆ (⋂i

    Ri ) C S , R C (⋂i

    Si ) =⋂i

    (R C Si ),

    (⋃i

    Ri ) C S =⋂i

    (Ri C S),⋃i

    (R C Si ) ⊆ R C (⋃i

    Si ),

    (⋂i

    Ri ) B S =⋃i

    (Ri B S),⋃i

    (R B Si ) ⊆ R B (⋂i

    Si ),⋂i

    (Ri B S) ⊆ (⋃i

    Ri ) B S , R B (⋃i

    Si ) =⋂i

    (R B Si ).

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 20 / 61

  • Binary Fuzzy Relations on a Set

    Pierre Duhem (The Aim and Structure of Physical Theory, 1954)

    It is impossible to describe a practical fact without attenuating by the useof the word “approximately” or “nearly”; on the other hand, all theelements constituting the theoretical fact are defined with rigorousexactness.

    Bertrand Russell (The Philosophy of Logical Atomism, 1918)

    Everything is vague to a degree you do not realize till you have tried tomake it precise.

    We introduce reflexivity, symmetry, transitivity, and assymmetry of fuzzyrelations only (most frequently used).

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 21 / 61

  • Definition (basic properties)

    A binary fuzzy relation R on a set U is called reflexive, symmetric,transitive (w.r.t. ⊗), antisymmetric (w.r.t. fuzzy equality x ≈U y on U,see later), if it satisfies

    R(x , x) = 1,

    R(x , y) = R(y , x),

    R(x , y) ⊗ R(y , z) ≤ R(x , z),R(x , y) ∧ R(y , x) ≤ (x ≈X y),

    respectively.

    Note: Transitivity depends on what truth function ⊗ of conjunction weuse.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 22 / 61

  • – One could consider the properties in degrees. For example, a degreeRef(R) to which R is reflexive can be defined byRef(R) =

    ∧x∈U R(x , x). Then, R is reflexive iff Ref(R) = 1 (verify).

    – The definition presents a generalization of the ordinary properties ofrelations. That is, for L = {0, 1}, the properties defined abovecoincide with the ordinary properties. (Verify.)

    – More information on fuzzy relations in a set can be found in theliterature, e.g. Klir, Yuan: Fuzzy Sets and Fuzzy Logic. Prentice Hall,1995, or Belohlavek: Fuzzy Relational Systems. Kluwer, 2002.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 23 / 61

  • Example

    Consider fuzzy relations R and S on U = {u, v ,w , x} given by matrices

    MR =

    1 1 0.4 01 1 0.2 0

    0.4 0.2 1 00 0 0 1

    , MS =

    1 0.8 0.4 00.8 1 0.2 00.4 0.2 1 0.20 0 0.1 0.9

    .Determine whether R and S are reflexive, symmetric, transitive (w.r.t. Lukasiewicz t-norm).

    R: reflexivity yes (1s on main diagonal), symmetry yes (symmetric alongmain diagonal), transitivity no:R(v , u) ⊗ R(u,w) = 1 ⊗ 0.4 = 0.4 6≤ 0.2 = R(v ,w).

    S : reflexivity no (R(x , x) = 0.9), symmetry no(R(w , x) = 0.2 6= 0.1 = R(x ,w)), transitivity yes (check). But S is“almost reflexive” and “almost symmetric”.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 24 / 61

  • Definition (fuzzy equivalence)

    A binary relation ≈ on a set U is called a fuzzy equivalence if it isreflexive, symmetric, transitive.If, moreover, (u ≈ v) = 1 implies u = v , ≈ is called a fuzzy equality.

    More information about fuzzy equivalences canbe found in pp. 37–42 of[CH1] (Chapter 1 of Belohlavek, Vychodil: Fuzzy Equational Logic.Springer, 2005), available athttp://bingweb.binghamton.edu/~rbelohla/ssie517f2007.html.In particular,

    – Definition 1.69 and Remark 1.70, Example 1.71,

    – Theorem 1.72,

    – Fuzzy equivalences and partitions: Definition of an L-equivalenceclass, Definition 1.73, Theorem 1.75,

    – Inducing a fuzzy equivalence θS in U from a system S of fuzzy sets inU, Theorem 1.76, Remark 1.77.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 25 / 61

    http://bingweb.binghamton.edu/~rbelohla/ssie517f2007.html

  • Example (fuzzy equivalence and partition)

    θ u1 u2 u3 u4u1 1 0.9 0.8 1u2 0.9 1 0.7 0.9u3 0.8 0.7 1 0.8u4 1 0.9 0.8 1

    describes an L-equivalence on U = {u1, . . . , u4} with L = [0, 1] and Lukasiewicz operations on L (verify).Classes of θ: [u1]θ = [u1]θ = {1/u1, 0.9/u2, 0.8/u3, 1/u4},[u2]θ = {0.9/u1, 1/u2, 0.7/u3, 0.9/u4}, [u3]θ = {0.8/u1, 0.7/u2, 1/u3, 0.8/u4}.Therefore, {{1/u1, 0.9/u2, 0.8/u3, 1/u4}, {0.9/u1, 1/u2, 0.7/u3, 0.9/u4},{0.8/u1, 0.7/u2, 1/u3, 0.8/u4}} is an L-partition Πθ on U induced by θ.Note that an L-partition on U represents a system of similarity-basedclusters (fuzzy sets) of elements of U.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 26 / 61

  • Example (Leibniz equivalence)

    Consider set U consisting of Porsche 911, . . . , Honda Accord, and a set Sof fuzzy sets (attributes) AWD, expensive, and high MPG. Let

    car AWD expensive high MPG

    Porsche 911 1 1 0.2Toyota RAV4 1 0.7 0.7Toyota Corolla 0 0.4 1Subaru Outback 1 0.8 0.6Honda Civic 0 0.3 1Honda Accord 0 0.5 0.8

    Then with Lukasiewicz operations, the Leibniz similarity ≈ is given by911 RAV4 Corolla Outback Civic Accord

    Porsche 911 1 0.5 0 0.6 0 0Toyota RAV4 1 0 0.9 0 0Toyota Corolla 1 0 0.9 0.8Subaru Outback 1 0 0Honda Civic 1 0.8Honda Accord 1Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 27 / 61

  • Example (Leibniz equivalence)

    Rearranging the table yields:911 RAV4 Outback Corolla Civic Accord

    Porsche 911 1 0.5 0.6 0 0 0Toyota RAV4 0.5 1 0.9 0 0 0Subaru Outback 0.6 0.9 1 0 0 0Toyota Corolla 0 0 0 1 0.9 0.8Honda Civic 0 0 0 0.9 1 0.8Honda Accord 0 0 0 0.8 0.8 1

    The concept of fuzzy equivalence illustrates the two sides of fuzzy logic:symbolic (qualitative) one and numerical (quantitative) one. For example,transitivity of fuzzy equivalence ≈ says:

    – “If u and v are similar and v and w are similar then u and w aresimilar” which is the formula behind transitivity (symbolic, describesmeaning in natural lagnuage).

    – (u ≈ v) ⊗ (v ≈ w) ≤ (u ≈ w) (numerical, makes the symbolic/verbaldescription more precise).

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 28 / 61

  • Extension Principle for Fuzzy Systems

    – Proposed by Zadeh.

    – Represents one way of “’fuzzification” of systems.

    – Typical scenario: A given system performs a function f : X → Y .Given input x ∈ X , f (x) ∈ Y is the corresponding output. What ifinputs are not known precisely? What if, instead of x ∈ X , we onlyknow that the input is “approximately x” etc.? Such inputs can bedescribed by fuzzy sets in X . How do we apply f to inputs which arefuzzy sets?Two particular cases:

    – Interval computations (e.g., Vladik Kreinovich): When there isimprecision in measurement, it is more realistic to represent themeasured quantities by intervals rather than by numbers. Oneadvantage is better control of how error spreads, i.e. more robustcomputations. Note: intervals are particular cases of fuzzy sets (crispfuzzy sets).

    – Fuzzy neural networks.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 29 / 61

  • Definition (extension principle)

    Let f : X → Y be a function. By extension principle, f induces a functionf : LX → LY defined for A ∈ LX by

    (f (A))(y) =∨{A(x) | x ∈ X , f (x) = y}.

    – For simplicity, one uses just f (A) instead of f (A).– Input A and output f (A) are fuzzy sets. f (A)(y) can be seen as a

    degree to which there exists x in A which is mapped to y by f .

    Definition (extension principle, multiple inputs)

    Let f : X1 × · · · ×Xn → Y be a function. By extension principle, f inducesa function f : LX1 × · · · × LXn → LY defined for A1 ∈ LX1 , . . . ,An ∈ LXn by

    (f (A1, . . . ,An))(y) =∨{A1(x1) ∧ · · · ∧ An(xn) | x1 ∈ X1, . . . , xn ∈ Xn,

    f (x1, . . . , xn) = y}.Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 30 / 61

  • Example (extension principle)

    (1) Let X = {1, 2, 3, 4, 5}, Y = {a, b, c , d}, f be defined by f (1) = a,f (2) = b, f (3) = b, f (4) = d , f (5) = d . Determine f (A).

    – A = {0.5/1, 1/2, 0.5/3}. f (A) = {0.5/a, 1/b}.– A = {0.5/1, 0.4/4, 0.6/5}. f (A) = {0.5/a, 0.6/d}.– A = ∅. f (A) = ∅.– A = X . f (A) = {1/a, 1/b, 1/d}.

    (2) Let X = Y = R, f (x) = 3x ,A = {0.25/1, 0.5/2, 0.75/3, 1/4, 0.75/5, 0.5/6, 0.25/7}.f (A) = {0.25/3, 0.5/6, 0.75/9, 1/12, 0.75/15, 0.5/18, 0.25/21}.(3) Let X = Y = R, f (x) = 3x , A be a triangular fuzzy set given byparameters a, b, c . Then f (A) is a triangular fuzzy set given by parameters3a, 3b, 3c .

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 31 / 61

  • For f : X1 × · · · × Xn → Y , computing f (A1, . . . ,An) forA1 ∈ LX1 , · · · ,An ∈ LXn is demanding (see definition).

    For the particular case when Xi = R, Ai are intervals (note that we canconsider intervals as particular crisp fuzzy sets), and f are basic arithmeticoperations such as addition, subtraction, multiplication, extension principleyields well-known formulas of interval arithmetic (verify them using thedefinition of EP):

    – [a, b] + [c , d ] = [a + c , b + d ],

    – [a, b] − [c , d ] = [a− d , b − c],– [a, b] · [c , d ] =

    [ac, bd ] for a ≥ 0, c ≥ 0,[bd , ac] for b < 0, d < 0,[min{ad , bc}, max{ad , bc}] for ab ≥ 0, cd ≥ 0, ac < 0,[min{ad , bc}, max{ac, bd}] for ab < 0, cd < 0.

    .

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 32 / 61

  • Link to EP: Let f be addition of real numbers, A[a,b] be a crisp fuzzy setcorresponding to interval [a, b], i.e. A[a,b](x) = 1 if x ∈ [a, b],A[a,b](x) = 0 if x 6∈ [a, b]; same for A[c,d ]. Then one can see that usingEP, A[a,b]+A[c,d ] = A[a+c,b+d ]. The same holds true for subtraction andmultiplication.

    For division, the situation is technically bit complicated. One needs todistinguish cases taking care of possible division by 0.

    Question: Consider L = [0, 1], X1 = · · · = Xn = Y = R. Canf (A1, . . . ,An) be computed efficiently?

    Yes, in special cases: If f is continuous and if a-cuts of A1, . . . ,An arecompact subsets of R for a > 0.Note: Compactness is a topological notion. Particular cases (the onesimportant for applications) of compact subsets of R are closed intervals or,more generally, unions of closed intervals.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 33 / 61

  • Theorem (reducing extension principle to interval computation)

    Let f : Rn → R be a continuous function, let A1, . . . ,An ∈ [0, 1]R be suchthat for every b ∈ (0, 1], bAi is a compact subset of R (e.g. a closedinterval). Then for every a ∈ (0, 1]:

    af (A1, . . . ,An) = f (aA1, . . . ,

    aAn).

    – Note that, as an example, if Ai has a continuous membership function(such as triangular or trapezoidal fuzzy sets), then bAi is compact.

    – Therefore, under conditions of the theorem, we can compute a-cuts ofthe output from a-cuts of the input.

    – Examples (assume Ai are trapezoidal fuzzy sets):– a(A1 + A2) =

    aA1 +aA2, where on the right hand side, we use interval

    arithmetic,– a(A1 − A2) = aA1 − aA2,– a(A1 · A2) = aA1 · aA2,– a(c · A2) = c · aA1,– a(eA2) = e

    aA1 .

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 34 / 61

  • Example

    Determine a-cuts of fuzzy set C , for a = 1, 0.5, 0.1.

    – C = A + B, where A = Tri(b1, c1, d1) and B = Tri(b2, c2, d2) aretriangular fuzzy sets given by parameters b1, c1, d1 and b2, c2, d2:

    – A = Tri(1, 2, 3) and B = Tri(2, 4, 6).– A = Tri(0, 2, 4) and B = Tri(−7,−6,−5).– A = Tri(0, 2, 4) and B = 6, i.e. B = Tri(6, 6, 6).– A = 5, i.e. A = Tri(5, 5, 5), and B = 6, i.e. B = Tri(6, 6, 6).

    – C = A− B, where A = Tri(b1, c1, d1) and B = Tri(b2, c2, d2) aretriangular fuzzy sets given by parameters b1, c1, d1 and b2, c2, d2:

    – A = Tri(1, 2, 3) and B = Tri(2, 4, 6).– A = Tri(0, 2, 4) and B = Tri(−7,−6,−5).– A = Tri(0, 2, 4) and B = 6, i.e. B = Tri(6, 6, 6).– A = 5, i.e. A = Tri(5, 5, 5), and B = 6, i.e. B = Tri(6, 6, 6).

    – C = A · B, where A = Tri(b1, c1, d1) and B = Tri(b2, c2, d2) aretriangular fuzzy sets given by parameters b1, c1, d1 and b2, c2, d2:

    – A = Tri(1, 2, 3) and B = Tri(2, 4, 6).– A = Tri(0, 2, 4) and B = Tri(−7,−6,−5).– A = Tri(0, 2, 4) and B = 6, i.e. B = Tri(6, 6, 6).

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 35 / 61

  • Example (results for previous example)

    – C = A + B:

    – 1(C ) = [6, 6] = {6}, 0.5(C ) = [4.5, 7.5], 0.1(C ) = [3.3, 8.7].– 1(C ) = [−4,−4], 0.5(C ) = [−5.5,−1.5], 0.1(C ) = [−6.7,−1.3].– 1(C ) = [8, 8], 0.5(C ) = [7, 9], 0.1(C ) = [6.2, 9.8].– 1(C ) = [11, 11] = {11}, 0.5(C ) = [11, 11] = {11},

    0.1(C ) = [11, 11] = {11}.– C = A− B:

    – 1(C ) = [−2,−2], 0.5(C ) = [−2.5,−1.5], 0.1(C ) = [−2.9,−1.1].– 1(C ) = [8, 8], 0.5(C ) = [6.5, 9.5], 0.1(C ) = [5.3, 10.7].– 1(C ) = [−4,−4], 0.5(C ) = [−5,−3], 0.1(C ) = [−5.8,−2.2].– 1(C ) = [−1,−1], 0.5(C ) = [−1,−1], 0.1(C ) = [−1,−1].

    – C = A · B:– 1(C ) = [8, 8], 0.5(C ) = [4.5, 12.5], 0.1(C ) = [1.1 · 2.2, 2.9 · 5.8].– 1(C ) = [−12,−12], 0.5(C ) = [−19.5,−5.5],

    0.1(C ) = [3.8 · −6.9, 0.2 · −5.1].– 1(C ) = [12, 12], 0.5(C ) = [6, 18], 0.1(C ) = [0.2 · 6, 3.8 · 6].

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 36 / 61

  • Example (neural networks with imprecise inputs)

    Consider function

    f (x1, x2) =1

    1 + e−(w1·x1+w2·x2−θ).

    Such function occurs in multi-layer neural networks. x1, x2 ∈ R are inputsto a neuron, w1,w2 ∈ R are weights of connections from the inputs to theneuron, θ ∈ R is a threshold, 11+e−z is a transfer function of a neuron(sigmoid function). f (x1, x2) is then the neuron output given x1, x2 as theinputs. Neurons are organized and connected in layers, outputs of neuronsserve as inputs of other neurons. This is, basically, the architecture ofback-propagation type neural networks.

    Determine the output f (x1, x2) of a neuron given that w1 = 3, w2 = 2,θ = −2, x1 = A1 and x2 = A2 are triangular fuzzy sets given byparameters 1, 2, 3 (for A1) and 1, 3, 5 (for A2).

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 37 / 61

  • Example (neural networks with imprecise inputs, cntd.)

    For function

    f (x1, x2) =1

    1 + e−(w1·x1+w2·x2−θ),

    determine f (A1,A2) given that w1 = 3, w2 = 2, θ = −2, A1 and A2 aretriangular fuzzy sets given by parameters 1, 2, 3 (for A1) and 1, 3, 5 (forA2).Fuzzy set f (A1,A2) is determined by its a-cuts

    af (A1,A2). The usual wayto compute af (A1,A2) is to consider f (x1, x2) a composite function and toapply interval arithmetic to the functions from which f is composed.Example for a = 0.5:1. w1 · 0.5A1 = 3 · [1.5, 2.5] = [4.5, 7.5], w2 · 0.5A2 = 2 · [2, 4] = [4, 8],2. w1 · 0.5A1 + w2 · 0.5A2 − θ = −[8.5, 15.5] + 2 = [10.5, 17.5].3. 1

    1+e−(w1·0.5A1+w2·0.5A1−θ)

    = 11+e−[10.5,17.5]

    = [0.99997246, 0.99999997489].

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 38 / 61

  • Further Applications of Extension Principle

    – Extension principle is used in various applications of fuzzy sets inwhich computation with numbers is replaced by computation withfuzzy sets which represent imprecisely known numbers.

    – Such imprecisely known numbers are called fuzzy quantities, or fuzzynumbers or fuzzy intervals.

    – Fuzzy arithmetic is implemented e.g. in Mathematica.

    – Particular areas and literature:

    – Linear programming with inexact data: Fiedler M.: Linear OptimizationProblems with Inexact Data, Springer, 2006.

    – Engineering applications are covered in Hanss M.: Applied FuzzyArithmetic, An Introduction with Engineering Applications.

    – Decision making under uncertainty, many papers and books exist.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 39 / 61

  • Distance of Fuzzy Sets in RWhen using EP for to extend functions f defined for real numbers tofunctions f defined for fuzzy sets in R, one often needs to assess thedistance of two fuzzy sets A and B in R.The following function, called the generalized Hausdorff pseudo-metric, isoften used:

    d∞(A,B) = supa∈K

    dH(aA, aB)

    where dH is the well-known Hausdorff pseudometric defined by

    dH(aA, aB) = max{ sup

    x∈aAinf

    y∈aB|x − y |, sup

    y∈aBinf

    x∈aA|x − y |.}

    Usually, K is some subset of (0, 1] such as K = (0, 1],K = (0.1, 0.2, . . . , 0.9, 1].

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 40 / 61

  • Distance of Fuzzy Sets in R

    Example

    Determine d∞(A,B) for a triangular fuzzy set A given by parameters1, 3, 5 and a trapezoidal fuzzy set B given by parameters 2, 4, 5, 6.Consider K = 0.5, 1. We have

    dH(1A, 1B) = dH([3, 3], [4, 5]) = max{1, 2} = 2,

    dH(0.5A, 0.5B) = dH([2, 4], [3, 5.5]) = max{1, 1.5} = 1.5,

    hence d∞(A,B) = sup{2, 1.5} = 2.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 41 / 61

  • Compositional Rule of Inference (CRI)

    CRI is a technique used in so-called fuzzy rule-based systems, the basiccomponents of fuzzy controllers.

    Definition (CRI)

    Let R be an L-relation between sets X and Y , A be an L-set in X . TheL-set B obtained from A and R by compositional rule of inference isdefined by

    B(y) =∨x∈X

    A(x) ⊗ R(x , y),

    or just B = A ◦ R, for short.

    – In fuzzy logic, CRI is considered an inference rule. Sometimes variouswrong claims are being made such as “CRI generalizes the rule ofmodus ponens”.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 42 / 61

  • – B(y) is a truth degree of “there is x ∈ X such that x is in A and x isrelated to y via R (〈x , y〉 is in R)”.

    – In fact, A ◦ R can be seen as a ◦-composition of fuzzy relations: LetW = {1} and define a fuzzy relation Q between Wand X by Q(1, x) = A(x) for every x ∈ X . Then, for B = A◦R we have

    B(y) = (Q ◦ R)(1, y)for every y ∈ Y .

    – Also, A ◦ R can be looked at as matrix multiplication. Let |X | = m,|Y | = n, let MA be a 1 ×m matrix representing A, MR be an m × nmatrix representing R. Then MA ◦MR is a 1 × n matrix representingA ◦ R.

    – If X = Y and ≈ is a fuzzy equivalence relation (similarity) in X , then(A◦ ≈)(y) =

    ∨x∈X A(x)⊗ (x ≈ y), i.e. (A◦ ≈)(y) is the truth degree

    of “there is x in A which is similar to y”. This interpretation of CRI =applications of fuzzy logic in information retrieval. If A is a collectionof “prototypes” a user is interested in, A◦ ≈ is the collection ofobjects similar to some of the prototypes. See next example.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 43 / 61

  • Example

    ≈ 911 RAV4 Outback Corolla Civic AccordPorsche 911 1 0.5 0.6 0 0 0Toyota RAV4 0.5 1 0.9 0 0 0Subaru Outback 0.6 0.9 1 0 0 0Toyota Corolla 0 0 0 1 0.9 0.8Honda Civic 0 0 0 0.9 1 0.8Honda Accord 0 0 0 0.8 0.8 1

    Consider Lukasiewicz operations.User asks: I am interested in to Honda Civic, show me similar cars. UsingCRI, the answer is A◦ ≈ with A = {1/Honda Civic}. In particular,{1/Honda Civic}◦ ≈= {1/H. Civic, 0.9/T. Corolla, 0.8/H. Accord}.User asks: I am interested in Honda Civic and little bit (to degree 0.4) inSubaru Outback. The answer is:{1/H. Civic, 0.4/S. Outback}◦ ≈={1/H. Civic, 0.9/T. Corolla, 0.8/H. Accord, 0.4/S. Outback, 0.3/T. RAV4}.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 44 / 61

  • Fuzzy Rule-Based Systems and Fuzzy Control

    Material:

    Handouts (available at http://bingweb.binghamton.edu/~rbelohla/FuzzyRuleBasedSystems.pdf).

    Chapter 11.4 (up to the end of p. 319), Chapters 12.1, 12.2, 12.3 of Klir,Yuan: Fuzzy Sets and Fuzzy Logic. Theory and Applications. PrenticeHall, 1995 (available athttp://bingweb.binghamton.edu/~rbelohla/KlirYuan1995.PDF).

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 45 / 61

    http://bingweb.binghamton.edu/~rbelohla/FuzzyRuleBasedSystems.pdfhttp://bingweb.binghamton.edu/~rbelohla/FuzzyRuleBasedSystems.pdfhttp://bingweb.binghamton.edu/~rbelohla/KlirYuan1995.PDF

  • Fuzzy Rule-Based Systems and Fuzzy Control

    Fuzzification and defuzzification

    Chapter 12 of Klir, Yuan: Fuzzy Sets and Fuzzy Logic. Theory andApplications. Prentice Hall, 1995 (available athttp://bingweb.binghamton.edu/~rbelohla/KlirYuan1995.PDF).

    – Provide interface to fuzzy rule-based systems.

    – Inputs, particularly in fuzzy control, are numbers in most cases(temperature from sensors, etc.).

    – Outputs in fuzzy control need to be numbers (action, e.g. r.p.m. of aventilator).

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 46 / 61

    http://bingweb.binghamton.edu/~rbelohla/KlirYuan1995.PDF

  • Fuzzification = transformation of inputs which are elements of the inputspace to inputs which are fuzzy sets in the input space. Note: Inputs tofuzzy rule-based systems need to be fuzzy sets in the input space.

    Case of one input variable x1:

    – If the value of x1 is a1, the input fuzzy set A′1 is set to

    – singleton A′1 = {1/a1}, or– “narrow fuzzy set” with core {a1}, e.g. a triangular fuzzy set with

    parameters a1 − ε, a1, a1 + ε, for small εCase of n input variables x1, . . . , xn:

    – If the values of x1, . . . , xn are a1, . . . , an, the input fuzzy setsA′1, . . . ,A

    ′n are set to

    – singleton A′1 = {1/a1}, . . . , A′n = {1/an} or– “narrow fuzzy sets” with cores {ai}, e.g. triangular fuzzy sets with

    parameters ai − ε, ai , ai + ε.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 47 / 61

  • Defuzzification = transformation of a fuzzy set (output B ′ of inference)to a “typical” value y from the output space Y , i.e. a value whichcharacterizes B ′ well.

    Several approaches exist. We assume that the universe Y ⊆ R is finite, i.e.Y = {y1, . . . , yk}. A defuzzification method can be seen as a functionD : [0, 1]Y → Y assigning an element D(B) ∈ Y to a fuzzy setB ∈ [0, 1]Y .

    Basic defuzzification methods:

    – Center of gravity (COG, also center of area, centroid):

    D(B) =Pk

    i=1 B(yi )yiPki=1 B(yi )

    .

    If Y = [a, b] ⊆ R is a real interval, thenD(B) =

    R ba B(y)ydyR ba B(y)dy

    ,

    which means that D(B) is the y -th coordinate of the center of gravityof the area delineated by B (area under B).

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 48 / 61

  • – Center of maxima (COM): put M(B) = {z ∈ Y |B(z) = h(B)},where h(B) =

    ∨y∈Y B(y) is the height of B. Then

    D(B) = min(M(B))+max(M(B))2 ,i.e. D(B) is the average of the least and the greatest value in Y atwhich B has its maximum.

    – Mean of maxima (MOM): put M(B) = {z ∈ Y |B(z) = h(B)},where h(B) =

    ∨y∈Y B(y) is the height of B. Then

    D(B) =P

    y∈M y

    |M| ,

    i.e. D(B) is the average of all values in Y at which B has itsmaximum.

    COG is most popular because it is not sensitive to changes in thedefuzzified fuzzy set B.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 49 / 61

  • Example

    Let Y = {0, 1, . . . , 10}. LetB = {0/0, 0.5/1, 1/2, 1/3, 1/4, 0.5/5, 0/6, 0/7, 0.5/8, 1/9, 0.5/10}

    Then

    – by COG:D(B) = 0·0+0.5·1+1·2+1·3+1·4+0.5·5+0·6+0·7+0.5·8+1·9+0.5·100+0.5+1+1+1+0.5+0+0+0.5+1+0.5 =

    306 = 5.

    – by COM: M = {2, 3, 4, 9},D(B) = 2+92 = 5.5.

    – by MOM: M = {2, 3, 4, 9},D(B) = 2+3+4+94 =

    184 = 4.5.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 50 / 61

  • Fuzzy Rule-Based Systems: Example

    Consider X = Y = {0, 1, . . . , 10} and a system R consisting of three rules

    IF x is A1 THEN y is B1,IF x is A2 THEN y is B2,IF x is A3 THEN y is B3.

    Let the corresponding fuzzy sets A1,B1, A2,B2, A3,B3 be given by:

    x/y 0 1 2 3 4 5 6 7 8 9 10

    A1(x) 0 0.5 1 0.5 0 0 0 0 0 0 0B1(y) 0 0.5 0.75 1 1 0.75 0.5 0 0 0 0

    A2(x) 0 0 0.25 0.75 1 0.75 0.25 0 0 0 0B2(y) 0 0 0 0 0 0 0.5 1 0.5 0 0

    A3(x) 0 0 0 0 0 0 0.5 1 0.5 0 0B3(y) 0 0 0 0 0 0 0 0 0.5 1 0.5

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 51 / 61

  • Determine the corresponding fuzzy relations R1,R2,R3, and R.

    Recall: Ri (x , y) = Ai (x) ∧ Bi (y), R = R1 ∪ R2 ∪ R3.

    10 0 0 0 0 0 0 0 0 0 0 09 0 0 0 0 0 0 0 0 0 0 08 0 0 0 0 0 0 0 0 0 0 07 0 0 0 0 0 0 0 0 0 0 06 0 0.5 0.5 0.5 0 0 0 0 0 0 05 0 0.5 0.75 0.5 0 0 0 0 0 0 04 0 0.5 1 0.5 0 0 0 0 0 0 03 0 0.5 1 0.5 0 0 0 0 0 0 02 0 0.5 0.75 0.5 0 0 0 0 0 0 01 0 0.5 0.5 0.5 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0

    R1 0 1 2 3 4 5 6 7 8 9 10

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 52 / 61

  • 10 0 0 0 0 0 0 0 0 0 0 09 0 0 0 0 0 0 0 0 0 0 08 0 0 0.25 0.5 0.5 0.5 0.25 0 0 0 07 0 0 0.25 0.75 1 0.75 0.25 0 0 0 06 0 0 0.25 0.5 0.5 0.5 0.25 0 0 0 05 0 0 0 0 0 0 0 0 0 0 04 0 0 0 0 0 0 0 0 0 0 03 0 0 0 0 0 0 0 0 0 0 02 0 0 0 0 0 0 0 0 0 0 01 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0

    R2 0 1 2 3 4 5 6 7 8 9 10

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 53 / 61

  • 10 0 0 0 0 0 0 0.5 0.5 0.5 0 09 0 0 0 0 0 0 0.5 1 0.5 0 08 0 0 0 0 0 0 0.5 0.5 0.5 0 07 0 0 0 0 0 0 0 0 0 0 06 0 0 0 0 0 0 0 0 0 0 05 0 0 0 0 0 0 0 0 0 0 04 0 0 0 0 0 0 0 0 0 0 03 0 0 0 0 0 0 0 0 0 0 02 0 0 0 0 0 0 0 0 0 0 01 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0

    R3 0 1 2 3 4 5 6 7 8 9 10

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 54 / 61

  • 10 0 0 0 0 0 0 0.5 0.5 0.5 0 09 0 0 0 0 0 0 0.5 1 0.5 0 08 0 0 0.25 0.5 0.5 0.5 0.5 0.5 0.5 0 07 0 0 0.25 0.75 1 0.75 0.25 0 0 0 06 0 0.5 0.5 0.5 0.5 0.5 0.25 0 0 0 05 0 0.5 0.75 0.5 0 0 0 0 0 0 04 0 0.5 1 0.5 0 0 0 0 0 0 03 0 0.5 1 0.5 0 0 0 0 0 0 02 0 0.5 0.75 0.5 0 0 0 0 0 0 01 0 0.5 0.5 0.5 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0

    R 0 1 2 3 4 5 6 7 8 9 10

    Determine A ◦ R for A1 = {1/5}, A2 = {0.5/3, 1/4}.B ′1 = A

    ′1 ◦ R = {0.5/6, 0.75/7, 0.5/8}

    B ′2 = A′2 ◦ R = {0.5/1, 0.5/2, 0.5/3, 0.5/4, 0.5/5, 0.5/6, 0.1/7, 0.5/8}

    What are the corresponding defuzzified value for A′1 (using COG)?D(B ′1) =

    0.5·6+0.75·7+0.5·80.5+0.75+0.5 =

    12.251.75 = 7.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 55 / 61

  • Determine the output fuzzy sets and their defuzzified values (with COG)for all singleton inputs from X . That is, for x ∈ X , determine B ′ = A′ ◦ Rfor A′ = {1/x} and determine D(B ′) (defuzzification of B ′).

    inp. output fuzzy set defuzzified valuex {1/x} ◦ R D({1/x} ◦ R)10 ∅ (empty fuzzy set) Not Defined9 ∅ (empty fuzzy set) Not Defined8 {0.5/8, 0.5/9, 0.5/10} 97 {0.5/8, 1/9, 0.5/10} 96 {0.25/6, 0.25/7, 0.5/8, 0.5/9, 0.5/10} 8.3755 {0.5/6, 0.75/7, 0.5/8} 74 {0.5/6, 1/7, 0.5/8} 73 {0.5/1, 0.5/2, 0.5/3, 0.5/4, 0.5/5, 0.5/6, 0.75/7, 0.5/8} 4.652 {0.5/1, 0.75/2, 1/3, 1/4, 0.75/5, 0.5/6, 0.25/7, 0.25/8} 3.91 {0.5/1, 0.5/2, 0.5/3, 0.5/4, 0.5/5, 0.5/6} 3.50 ∅ (empty fuzzy set) Not Defined

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 56 / 61

  • The function G represented by the rule based system, i.e.G (x) = D({1/x} ◦ R):

    x 0 1 2 3 4 5 6 7 8 9 10D({1/x} ◦ R) ND 3.5 3.9 4.65 7 7 8.375 9 9 ND ND

    With rounding to closest values in Y :

    109 × × ×8 ×7 × ×65 ×4 × ×3 ×210

    R 0 1 2 3 4 5 6 7 8 9 10

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 57 / 61

  • Computing the output fuzzy sets for singleton inputs from X using the“geometric method”, i.e. determining degrees to which rule fire, cuttingthe output fuzzy sets and making union of the cut fuzzy sets.

    That is, for input x ∈ X :– determine ai = Ai (x) (degree to which i-th rule fires),

    – determine B ′i = ai ∧ Bi (i.e., B ′i (y) = ai ∧ Bi (y)),– determine the output: B ′ = B ′1 ∪ B ′2 ∪ B ′3.

    Example: input x = 3:a1 = A1(3) = 0.5, a2 = A2(3) = 0.75, a3 = A3(3) = 0,B ′1 = a1 ∧ B1 = {0.5/1, 0.5/2, 0.5/3, 0.5/4, 0.5/5, 0.5/6},B ′2 = a2 ∧ B2 = {0.5/6, 0.75/7, 0.5/8},B ′3 = a3 ∧ B2 = ∅,B ′ = B ′1 ∪ B ′2 ∪ B ′3 = {0.5/1, 0.5/2, 0.5/3, 0.5/4, 0.5/5, 0.5/6}, 0.75/7, 0.5/8},which is the same fuzzy set as the one computed by projection of 1/x viaR (see the table with singleton inputs and fuzzy set outputs).

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 58 / 61

  • Universal Mapping Property of Fuzzy Rule-BasedSystems

    Let X1, . . . ,Xn (input space) and Y (output space) be closed real intervals.Given a rule base R (including fuzzy sets Aij and Bi which representmeaning of linguistic terms in the rules, with R being the correspondingfuzzy relation), an inference method ◦ (such as CRI), a fuzzificationmethod F (such as singleton), and a defuzzification method ◦ (such asCOG), there is an associated function G : X1 × · · · × Xn → Y defined by

    G (x1, . . . , xn) = D(〈F (x1), . . . ,F (xn)〉 ◦ R)).That is, for x1, . . . , xn, we take their fuzzifications A

    ′1 = F (x1), . . . ,

    A′n = F (xn) (e.g. singletons), use the rule base and the inference methodto compute the output fuzzy set B ′ = 〈F (x1), . . . ,F (xn)〉 ◦ R and setG (x1, . . . , xn) to be the result of defuzzification of B

    ′.

    Question: What types of functions can we represent this way? Namely,function G represents a control strategy. So, are there any limitations towhat control strategies can be implemented using fuzzy-rule basedsystems?

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 59 / 61

  • Universal Mapping Property of Fuzzy Rule-BasedSystems

    For several particular choices of the inference mechanism, fuzzification anddefuzzification method, one an prove the following theorem (we omitdetails):

    Theorem (UMP of fuzzy rule-based systems)

    Let f : X1 × · · · × Xn → Y be a continuous function. For every ε > 0there exists a fuzzy rule-based system such that for the associated functionG and any x1 ∈ X1, . . . , xn ∈ Xn we have

    |f (x1, . . . , xn) − G (x1, . . . , xn)| ≤ ε.

    That is, any continuous function can be approximated by a fuzzyrule-based system with arbitrary precision.

    This theorem justifies theoretically the universality of fuzzy controllers.

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 60 / 61

  • Fuzzy Logic as Logic

    – overview of logical aspects of fuzzy logic

    – fuzzy logic in broad sense vs. in narrow senseFL in broad sense: principles and methods developed in fuzzy settheoryFL in narrow sense: mathematical logic (studies notions such asaxioms, provability, entailment) which allows a partially ordered scaleof truth degrees

    – start with overview of formal treatment of classical propositional logichttp://bingweb.binghamton.edu/~rbelohla/logic.pdf

    – then overview of two approaches to fuzzy logic in narrow sense (slides18–24 from http://bingweb.binghamton.edu/~rbelohla/CLA2006tutorialBelohlavekI.pdf)

    – case study in detail: attribute implications in fuzzy setting (slides1–20 from http://bingweb.binghamton.edu/~rbelohla/CLA2006tutorialBelohlavekIII.pdf)

    Radim Belohlavek (SSIE BU) Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems Fall 2008 61 / 61

    http://bingweb.binghamton.edu/~rbelohla/logic.pdfhttp://bingweb.binghamton.edu/~rbelohla/CLA2006tutorialBelohlavekI.pdfhttp://bingweb.binghamton.edu/~rbelohla/CLA2006tutorialBelohlavekI.pdfhttp://bingweb.binghamton.edu/~rbelohla/CLA2006tutorialBelohlavekIII.pdfhttp://bingweb.binghamton.edu/~rbelohla/CLA2006tutorialBelohlavekIII.pdf