selected mathematical and statistical methods in …...selected mathematical and statistical methods...

20
Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty of Sciences, University of Novi Sad Trg Dositeja Obradovića 4, 21000 Novi Sad, Serbia [email protected] Some specific methods with applications in biology, ecology and related natural sciences will be presented. The stress will be on less known methods with a wide potential in applications. In the first part, correspondences between two sets will be considered as a tool for investigating various connections among their elements. One of the sets is called the set of objects and another is the set of attributes and the correspondence shows which object posseses which attribute. In this context, an algebraic discipline called formal concept analysis will be presented. Furthermore, binary relations illustrating internal connections within one set will be elaborated. Equivalence relations and ordering relations have a special role in applications. Equivalence relations correspond to partitions of the set into disjoint classes. Classification of organisms is based on partitions of sets and equivalence relations and every taxon represents an equivalence class. Ordering relations often appear in applications as natural orderings on a set of objects. Two elements can be comparable or uncomparable under an ordering. Finally, some new methods connected to fuzzy sets and fuzzy relations will be presented. These concepts allow possibility to erase strong borders between sets, and instead of strong belongingness of elements to sets, grades of belongingness are introduced. In this context fuzzy cluster analysis are explained and software packages in which this method is implemented are listed. 1. Correspondences and relations

Upload: others

Post on 29-Jul-2020

19 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

Selected mathematical and statistical methods in biology

Andreja Tepavčević

Department of Mathematics and Informatics, Faculty of Sciences, University of Novi Sad

Trg Dositeja Obradovića 4, 21000 Novi Sad, Serbia

[email protected]

Some specific methods with applications in biology, ecology and related natural sciences will be presented. The stress will be on less known methods with a wide potential in applications. In the first part, correspondences between two sets will be considered as a tool for investigating various connections among their elements. One of the sets is called the set of objects and another is the set of attributes and the correspondence shows which object posseses which attribute. In this context, an algebraic discipline called formal concept analysis will be presented. Furthermore, binary relations illustrating internal connections within one set will be elaborated. Equivalence relations and ordering relations have a special role in applications. Equivalence relations correspond to partitions of the set into disjoint classes. Classification of organisms is based on partitions of sets and equivalence relations and every taxon represents an equivalence class. Ordering relations often appear in applications as natural orderings on a set of objects. Two elements can be comparable or uncomparable under an ordering. Finally, some new methods connected to fuzzy sets and fuzzy relations will be presented. These concepts allow possibility to erase strong borders between sets, and instead of strong belongingness of elements to sets, grades of belongingness are introduced. In this context fuzzy cluster analysis are explained and software packages in which this method is implemented are listed.

1. Correspondences and relations

Page 2: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

2 A. Tepavčević

Let A and B be non-empty sets. A correspondence R of sets A and B is a subset of a direct product of these sets, i.e., R A B⊆ × . If for elements and we have that

, then a and b are in the correspondence and we can write it also by . Therefore, a correspondence is a connection of some elements in set

a A∈ b∈B( )a b R, ∈ aRb

A with some elements in B and we define it by set of ordered couples of elements which are connected in this context.

Example 1. Let be a set of four species of fungi of genus Amanita, where by

{ ,A p r q s= , , }p we denote Amanita

phaloides, by Amanita rubescens, by q Amanita pantherina and by Amanita citrina. Let

rs { }B a b= , c, be a

set of some characteristics that may posses fungi of genus Amanita. Namely, with we denote the characteristic "stem has a ring", with - "a mushroom has a cap with striate margin” and - "there is remaining of the veil on the cap". Let the correspondence

ab

cR be defined as follows:

Species x is in the correspondence R with the characteristic , if mushroom y x has a characteristic . y

Then, we can obtain R as a subset of the set in the following way:

A B×

{( ) ( ) ( ) ( ) ( ) ( ), ( , ), ( , )}R p a r a r c q a q b q c s a s c= , , , , , , , , , , , .

Each of the ordered couples from the set R means that a species of mushrooms has a specific characteristic. In example: means that the species Amanita pantherina has a cap with striate margin. Since , this means that Amanita rubescens does not posses this characteristics.

( )q b R, ∈( )r b R, ∈/

A binary relation (relation) is a correspondence on a single set only. Therefore, the

relation A

ρ on a set is a subset of the set (denoted also by ). The relation is a connection between some elements of a set . If elements and b from (the ordering of elements is here important) are in a relation

A A A× 2AA a A

ρ , we denote this by ( )a b ρ, ∈ or as a bρ .

In the sequel, we start from a correspondence on sets and A B , and use it to define two particular relations on sets A and B .

Let R be a correspondence from a set A to a set B ( R A B⊆ × ). Let ρ be a relation defined on using the correspondence A R in the following way:

( ) if and only if { | ( ) } { | ( ) }x y z B x z R z B y z Rρ, ∈ ∈ , ∈ = ∈ , ∈ .

In other words, elements x and y are in the relation ρ if they are in the correspondence R with same elements from B .

BSimilarly, we can define a relation on θ :

( ) if and only if { | ( ) } { | ( ) }x y z A z x R z A zθ, ∈ ∈ , ∈ = ∈ , ∈y R .

Example 2. Let be a set of following fungi growing on wood: - Agrocybe aegerita, - Pleurotus ostreatus, - Polyporus sulphureus, - Fistulina

1 2 3 4 5 6 7 8 9 10{ }A a a a a a a a a a a= , , , , , , , , ,

1a

3a 4a2a

Page 3: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

Selected mathematical and statistical methods in biology 3

hepatica, - Auricularia auricula-judae, -Polyporus squamosus, -Meripilus giganteus, -Flammulina velutipes,

- Panus tigrinus, -Pholiota destruens.

5aa

1 2

6a

7 8a

}9a 10a

4 5Let 3 6 7{B b b

b

b

b,

3

7

b b,

5b

b b= , , , ,

2b

be a set of some characteristics that can be used for mushroom identification: - "mushroom has gills underneath", - "mushroom has pores or tubes underneath", - "mushroom has a red cap", - "mushroom has a yellow cap", - "mushroom with decurrent gills", - "mushroom with cup having free gills or with adnexed to shortly adnate gills", -"fungi has a tough, gelatinous, elastic texture".

1b

4b

6b

Let R be a correspondence defined as in Example 1:

( ) if the species s a chara isticif and only ha cterx y R x y, ∈ .

The correspondence R is given in the following table, where elements of the set are in the table heading left and elements of the set

AB are in the table heading up, and if ( )x y R∈, then

in the place of intersection of the x row and y column a small circle is placed.

R 1b 2b 3b 4b b 6b 7b5

1a o o

2a o o

3a o o

4a o o

5a o

6a o

7a o

8a o o o

9a o o

10a o o

Table 1

Now, we can consider the relation ρ on A obtained from the correspondence R as follows: two fungi species are in the relation ρ if they have same characteristics. Obviously, we

Page 4: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

4 A. Tepavčević

have that every fungi is in relation with itself, moreover we have that 1 10 10 and a a a a1ρ ρ , 2 9 9 2 and a a a aρ ρ , 6 7 7 and a a a a6ρ ρ . Since we have that there are mushrooms which are in correspondence with other different mushrooms, this shows that using the characteristics from the set B only we can not guarantee the correct identification of mushrooms. In order to be sure that we are able to identify all mushrooms from the set A , we have to enlarge set B , i.e., we have to take into account some other characteristics and then to consider the correspondence from the set to this larger set. AFurther, we can consider also a relation on the set θ B determined by the correspondence R . Two characteristics are in a relation if sets of mushrooms having these properties coincide. In this example each characteristic is in relation only to itself. This means that there are no characteristics that are possessed by the same species of mushrooms. If this would happen (that two or more characteristics are possessed by the same species of mushrooms) this would mean that not all of the properties from the set

θθ

B are necessary for the identification of mushrooms from the set , i.e., we would be able to determine the mushrooms using the smaller number of characteristics.

A

Now, in order to be able to identify all mushrooms from , we have to add some more characteristics into the set

AB . Now we

taker a new set 1 8 9 10{ }B B b b b, , ,

1

= ∪

8b

10b

where new characteristics are as follows: is the characteristic "cap, and especially its margin is covered with whitish irregular scales”, - "cap is eccentric and asymmetric and stem is short and eccentrically attached to cap" and - "flesh changes color when broken or bruised ".

9b

The related correspondence R on sets and A 1B is given in the following table:

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

1a o o

2a o o o

3a o o

4a o o

5a o

6a o

Page 5: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

Selected mathematical and statistical methods in biology 5

7a o o

8a o o o

9a o o

10a o o o

Table 2

Now, there are no different species of mushrooms with the identical properties from the set 1B . Therefore, it is possible to identify fungi from the set A according to characteristics from the set 1B only.

2. Formal concept analysis

Formal concept analysis is a technique that is used to identify similarities in data, starting from a correspondence. It is used in data analysis, knowledge processing, in various disciplines. It is developed at TU Darmstadt, Germany by R. Wille and B. Ganter. After publishing several research papers in which the theory is developed, B. Ganter and R. Wille in 1999 published a book Formal Concept Analysis - Mathematical Foundations, Springer, 1999. This book contains the detailed explanation of this theory and its applications.

A formal context consists of two sets and ( , , )K G M I= G M and a relation (correspondence) I between and G M . The elements of are called objects and the elements of G M attributes of the context. For a set of objects, we define: A G⊆

' { | ( , ) for all }A m M g m I g A= ∈ ∈ ∈

(the set of attributes common to the objects in A ), and for a set B M⊆ of attributes we define

' { | ( , ) for all }B g G g m I m B= ∈ ∈ ∈

(the set of objects common to all the attributes in .B )

A formal concept of the context is a pair ( ,( , , )K G M I= )A B , where , A G⊆ B M⊆ , satisfying ' and ' .A B B= = A

A is then called the extent and B the intent of the concept . ( , )A B

Further, the set of all concepts of a formal context is considered and it is denoted by

( , , )K G M I=( , , )B G M I .

A natural order can be introduced in the set of all concepts, as follows:

If ( , )A B and are two concepts of the same context, then ( , )C D ( , )A B is a subconcept of

Page 6: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

6 A. Tepavčević

( , )C D if or A C⊆

C D

.D B⊆

Then, also ( , is a superconcept of ) ( , )A B , and we write ( , ) ( , )A B C D≤ . The relation ≤ is called the hierarchical order of the concepts.

( , , )B G M I can be drown as a diagram and posses a special structure (such diagram is called a lattice and it is out of scope of this article).

Example 3. Let the set of objects consist of following mushrooms:

G

{ }Boletus edulis, Agaricus xanthoderm Morchella esculenta= a,G . Further, let set of attributes be as follows:

{ }saprophy= te, edible, basidiomycetaM .

I is the correspondence "mushroom species x has property y ".

The correspondence I is presented in the Table 3.

Table 3. Now we look at some formal concepts of the context

. Since ( , ,K G M )I={ } { }Bo is ' edible, basidiomyceta=letus edul and { } { }edi yceta ' Boletus edulis=ble, basidiom , we have that

{ } { }( )B is , edible, basidiomycetaoletus edul is one concept. Also, since { } { }Bo is, Agaricus xanthoderma ' basidiomyceta=letus edul and

{ } { }ba eta ' Boletus edulis, Agaricus xanthoderma=sidiomyc ,

{ } { }( )B dulis, Agaricus xanthoderma , basidiomycetaoletus e is another concept and so on. There are 8 different concepts.

XXMorchella esculenta

XXAgaricus xanthoderma

XXBoletusedulis

basidiomycetaediblesaprophyte

XXMorchella esculenta

XXAgaricus xanthoderma

XXBoletusedulis

basidiomycetaediblesaprophyte

Page 7: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

Selected mathematical and statistical methods in biology 7

3. Equivalence and ordering relations

3.1 Equivalence relations

Let ρ be a relation on a set . We define special properties of relations which are important in applications.

A

The relation ρ is reflexive relation on A if every element from A is in relation with itself, i.e., if the following is satisfied:

( )( )x A x x ρ∀ ∈ , ∈ .

The relation ρ is symmetric on if from " A x is in relation with y " it always follows that y is in relation with x , i.e.,

( )( ) ( ) ( )x y A x y y xρ ρ∀ , ∈ , ∈ ⇒ , ∈ .

The relation ρ is transitive on if from the facts that A x is in relation with y and y is in relation with , it follows that z x is in relation with , i.e., z

( )(( ) ( ) ( )x y z A x y y z x z )ρ ρ ρ∀ , , ∈ , ∈ ∧ , ∈ ⇒ , ∈ .

The relation ρ is anti-symmetric if ( )x y, and ( are not together in )y x, ρ unless x y= , i.e.,

( )(( ) ( ) )x y A x y y x x yρ ρ∀ , ∈ , ∈ ∧ , ∈ ⇒ = .

There are relations which are symmetric and antisymmetric at the same time: one example is ordinary equality relation.

There are two special types of relations well known according to good applicability in various fields: equivalence relations and ordering relations.

A relation ρ on a set is an equivalence relation (equivalence) on this set if it is reflexive, symmetric and transitive.

A

Common examples of equivalence relations we can find in taxonomy. Wherever we divide a set into some classes, there is a connected equivalence relation, as in the following examples.

Example 4. Let be a set of some animals on a habitat and Aρ a relation "to be the same species with". This relation is an equivalence relation.

Example 5. Let B be a set of all species of mushrooms that were found in a wood and the relation "to be the same genus with”. This is also an equivalence relation.

θ

Let be a set, A ρ an equivalence relation on and A x A∈ . The equivalence class xC determined by an element x is the set of all elements from that are in the relation A ρ with x , i.e.,

{ |xC y A y}xρ= ∈ .

For every element from the set A there is an equivalence class determined by this element. Every element belongs to the equivalence class determined by it, that follows by the

Page 8: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

8 A. Tepavčević

reflexivity and the definition of the class. Therefore, every element from belongs to some of these equivalence classes. On the other hand, every equivalence class contains elements from the set

A

A only. Hence, we can conclude that the union of all equivalence classes is equal to the set . Some of these classes can be equal. To be more precise, two classes are either equal or disjoint (which means that their intersection is the empty set). Since the set is a union of sets (the equivalence classes) which are mutually disjoint, these sets make a partition of the set .

A

A

A

Let be a set and A ρ an equivalence relation on it. The set of all equivalence classes of the relation ρ , { | is called a quotient set and it is denoted by }AxC x∈ A ρ/ .

In the example 4, one quotient set (according to the definition) form all animals that are of the same species with some observed animal. These are all animals of the same species. Hence, each equivalence class is formed by all the animals of the same species. The quotient set is set of all animal species on this habitat.

In example 5, one equivalence class is formed by all the species belonging to the same genus and the quotient set is set of all mushroom genera found in this wood.

Every classification of objects to some classes is based on equivalence relations. Cluster analysis or clustering, which is an assignment of a set of observations into subsets (called clusters) so that observations in the same cluster are similar in some sense (and different from observations from different clusters) is based on equivalence relations.

3.2 Ordering relations

A relation ρ on a set is an ordering relation (order) if it is reflexive, anti-symmetric and transitive. Usual relations , on the set of real numbers

A≤ ≥ R and ≤ , and | (divisibility

relation) on the set of natural numbers are ordering relations. The inclusion of a collection of all subsets of a set is also an ordering relation. Relations < and on sets

≥N

> R and are anti-symmetric and transitive, but not reflexive. Moreover, no element is in relation with itself. This last property is called irreflexivity. A relation which is irreflexive, antisymmetric and transitive is called strong ordering relation.

N

Example 6. Let be a set of people making a wider family and

Aρ is the relation "to be descendant of”. The relation ρ is

strong ordering relation on the set A, because it is irreflexive, anti-symmetric and transitive.

Ordering and strong ordering relations can be presented graphically, by a special type of diagram. In the diagram, elements of the sets are presented by small circles and the relation by a line connecting these circles. Two elements x and y are connected by a line if and only if they are in a direct connection (i.e., if x and y are in this relation, and there is no different from

zx and y such that x is in the relation with , and is in the relation with z z y . If x is in

the relation with y , then we represent this in a diagram by an arrow from x to y . In mathematics there is an agreement that the arrow is dropped and that x is on the line below y in the diagram.

Example 7. At a family meeting there are 14 people: three brothers , A B and C ; their wives , andG respectively, their mother

E FX and father Y , and also mother

of the mother Z . There are also children: and are P Q

Page 9: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

Selected mathematical and statistical methods in biology 9

children of A and ; E R and are children of S B and , and is a child of C and G . A diagram of strong ordering relation “to be descendant of” on this set of people is given in Figure 1.

FT

From the diagram we can deduce the relation as follows: x is in the relation with if and only if y x is below in the diagram and there is a sequence of lines in the same direction connecting them. In this way, from the diagram in Figure 1 we can read that T is a descendant of

y

Z , and that is not a descendant of G Z since they are not connected by

a line, etc.

Figure 1.

Elements a and are comparable according to an ordering or a strong ordering

relation b

ρ if either ( )a b ρ, ∈ or ( )b a ρ, ∈ . If a and b are not comparable, we say that they are incomparable.

Now, we return back to the relations defined in Section 1. Let R be a correspondence

from a set A to a set A and B Bρ and and relations defined on θ , respectively, using R as follows:

( ) if a y } { | (x nd onl if { | ( ) ) },y z B x z R Bz y z Rρ, ∈

nd onl

)

,

{

∈ = ∈ ∈,

}

and

( ) if a y | ( )x if { | ( }y z A ∈z x =R z Aθ, ∈ ∈ ∈ , ∈z .y R,

ρThe relation is an equivalence relation on and the relation is an equivalence relation on

A θB . The relation ρ unifies elements which are similar taking into account the

starting correspondence R . Now, we can consider equivalence classes of ρ and the set of all equivalence classes (quotient set) A ρ/ A ρ/. On we can define the following relation:

A ρ/ and let be a relation defined on Let xC andC be two equivalence classes from ≤y

A ρ/ as follows: if and onlx y y if C C x yρ≤ . We can prove that this relation is well defined,

since if x yρ , then every element from xC is in relation with every element from . After checking reflexivity, anti-symmetry and transitivity, we can conclude that ≤ is an ordering relation on the set of all equivalence classes

yC

A ρ/ . Analogue situation we have when we consider the relation on θ B . Since this is also an equivalence relation, we can take the quotient set, and the ordering relation on this quotient set can be defined similarly.

Now, we return back to the set all concepts of a formal context ( , , )B G M I defined in Section 2. The relation “to be subconcept of” defined on B( , , )G M I as follows: if and are two concepts then ( , is a subconcept of ( , if or ( , )A B ( ,C D) )A B )C D A C⊆

Page 10: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

10 A. Tepavčević

D B⊆ is an ordering relation.

4. Theory of fuzzy sets and fuzzy relations The set is one of the basic notions in mathematics. The set usually contains some elements.The main relationship between sets and elements is membership. In classical set theory, an element either belongs to a set or it does not belong to the set. There is no other options. However, in applications there are situations in which it is not so easy to single out all elements satisfying some property from a set, in case the property is not precisely defined. In example, if we would like to consider a set of all small bird species, it would not be so simple. The hummingbird would obviously belong to the set of small birds, and also the wren, and maybe the canary, but what about a dove or a duck? For this set is difficult, or impossible that it is determined in a way that all people would accept this choice of elements. Situations in which for an object it is difficult to make a proper classification are very common. This type of problems can be overcome mathematically by introducing a new type of sets: fuzzy sets. These are sets with un-clear borders in which a grade of belongingness or grade of membership of an element to a set is introduced. In this context, grade of membership is a real number between 0 and 1. For an element that fully belongs to a set the grade of membership is set to be 1 and if an element totally does not belong to a set, the grade of membership is set to be 0. For elements that partially belong to the set (as e.g. a duck to a set of small bird species), the grade of membership would be a number between 0 and 1. An element that according to an estimation belongs more to the set then the other element, would have a higher grade of membership. For example, the grade of membership of a hummingbird and wren to a set of small birds might be 1, for a dove the grade of membership might be 0.4, for a duck it might be 0.2. Obviously, for a king vulture, the grade of membership to the set of small birds would be 0.

The formal definition of a fuzzy set (sometimes called a fuzzy subset) would be introduced in the sequel.

A set X we are starting with is called a universe. A fuzzy subset of a set A X is determined by a function : [0,1]XAμ → ,1], where [0 is the interval of real numbers. This

function is called a membership function. For every x X∈ ( ), the value A xμ is called a grade of membership of an element x to the set A . Hence, elements belong to a fuzzy set with higher or lower grade of membership. It is common to identify a fuzzy set with its membership function, and this notation will be also used here.

Example 8. Let X be a set of bird species { }X A B C D E= , , , , , such that A is a hoopoe, B is a

hummingbird, is a duck, is a swallow and C D E is a wren. If we consider "a set of small birds", would hardly belong to that set (i.e. the corresponding membirship degree would be near 0) ,

A

B would belong to that set (membership grade would be 1 and C , and would belong to that fuzzy set with the membership grade between 0 and 1, taking into account that if bird is smaller its membership grade is higher.

D E

One fuzzy set in this context is defined by following membership function:

:0.01 1 0.2 0.5 0.9

A B C D Eμ ⎛ ⎞

⎜ ⎟⎝ ⎠

,

Page 11: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

Selected mathematical and statistical methods in biology 11

i.e., ( ) 0.5,Dμ = etc.

Fuzzy sets have been introduced in 1965 by Lotfi Zadeh. Since then, they are applied in numerous fields. Fuzzy logic (a type of many valued logic based on fuzzy sets) is a basic tool for fuzzy controllers, fuzzy expert systems, fuzzy databases, etc. Fuzzy controllers are based on fuzzy relations and fuzzy correspondences.

One of the most important notions in this framework is the notion of a cut-set of a fuzzy set. Let : [0,X 1]μ → be a fuzzy set of a set X and let . Then a [0,1]p∈ p -cut set is a

classical subset of X usually denoted by pμ and defined by

{ }| ( )p x X x pμ μ= ∈ ≥ .

Fuzzy correspondences (relations) are defined as mappings from direct products of sets to a [0,1] real interval. They are in fact fuzzy sets on a direct product of sets. As for classical relations, we will mostly use binary fuzzy relations.

Let and A B be sets, and [0 a real interval. A mapping is a fuzzy correspondence. In a natural way, to every fuzzy correspondence there corresponds a matrix having elements from [0 , with rows indexed by elements from

,1] : [R A B× → 0,1]

,1] A and columns indexed by elements from B .

R For a and , a value A∈ b B∈ ( , )a b is determined by the grade of relationship between elements and (which is the grade of membership of the ordered couple ( , to the correspondence

a b )a bR ).

If is a fuzzy correspondence, then for every , a : [R A B× → 0,1] [0,1]p∈ p -cut correspondence is a classical correspondence pR on and A B defined by:

{ }( , ) | ( , )pR a b A B R a b p= ∈ × ≥ .

Futher important notions are x -row fuzzy sets and -column fuzzy sets, defined as follows. y

If is a fuzzy correspondence, then a fuzzy set defined by : [R A B× → 0,1] 1]: [0,xR B →

( ) ( , )xR y R x y= is an x -row fuzzy set of the correspondence R , and a fuzzy set

defined by

: [0,yR A→ 1]

( )y ( , )R x R x= y is an y -column fuzzy set.

If A and B are finite sets, { }1,..., mA x x= and { }1,..., nB y y= , we can present a fuzzy

correspondence in a matrix:

Page 12: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

12 A. Tepavčević

1 1 1 2 1

2 1 2 2 2

1 2

( , ) ( , ) . . . ( , )( , ) ( , ) . . . ( , )

. . . . . .

. . . . . .

. . . . . .( , ) ( , ) . . . ( , )

n

n

m m m n

R x y R x y R x yR x y R x y R x y

R

R x y R x y R x y

⎡ ⎤⎢ ⎥⎢ ⎥⎢ ⎥

= ⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥⎢ ⎥⎣ ⎦

.

x -row fuzzy sets are then presented in rows of this matrix and similarly y -column fuzzy sets are in columns of this matrix.

If we have a relation on a set , then we obtain a square matrix. A

There are many problems in artificial intelligence that are based on fuzzy relations and correspondences, like fuzzy control theory and fuzzy databases. In real applications we often have a situation when output values are determined in advance by input values, and the problem is to find a fuzzy relation which performs such a transition. A fuzzy controller is rule based and fuzzy IF-THEN rules appear in this context. Rules are implications of the following type:

IF WASHING IS HEAVILY SOILED THEN ADD MORE DETERGENT

(in the control system of wash machine)

In this approach, each rule is of the type:

IF U is B THEN V is . D

This can be translated into a form

the pair ( , )B D of ( , takes the value in )U V R ,

where R is a fuzzy relation.

Consequently, if U takes fuzzy input values from a set A , then we have that is in relation , where .

( , )U VG G A R= ∩

Considering and G R as fuzzy relations on sets X and as a fuzzy set on the same universe, we obtain the following equality:

A

Page 13: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

Selected mathematical and statistical methods in biology 13

( , ) ( ) ( , )G x y A x R x y= ∧ .

The Mamdani approach to fuzzy controllers starts from a fuzzy relation R which is deduced from actual control process, and which from input values creates output values using the following compositional rule of inference:

( ) sup( ( ) ( , ))A Rx X

y x R x yμ μ∈

= ∧o

Here output values are determined in advance by input values so the problem is to find a fuzzy relation that satisfies the equation above.

We can present these problems schematically, as a usual matrix equation, taking into account that instead of usual number operations and ⋅ , we have here operations su and inf on

interval (that sometimes we also denote, respectively by and ). + p

[0,1] ∨ ∧

Therefore, we have a problem of the type: Knowing two vectors that contain input and output values (two sequences of values of finite fuzzy sets) 1[ ,..., ]nx x and 1[ ,..., ]my y , problem is to find a fuzzy relation satisfying:

1 1[ ,..., ] [ ,..., ]n mx x R y y∧ = .

If first fuzzy set is a fuzzy set on a set , and the second fuzzy set is a fuzzy set on a set A B , then R is a correspondence on A and B (i.e. a subset of A B× ).

Sometimes this relational equation does not have a solution, and sometimes it has more than one solution. In applications, it is an important problem to find the greatest solution of the equation.

In the sequel we give an example of such a problem and a solution.

Example 9. Let [0.8,0.9,0.4,0.1]μ = be a fuzzy set on a set

{ }, , ,A a b c d=

A ,1]

. We consider this fuzzy set as a function from

to [0 and values are defined respectively by the order elements are listed:

( ) 0.8, ( ) 0.9, ( ) 0.4, ( ) 0.1a b c dμ μ μ μ= = = = .

Further, let [0.9,0.6,0.2]ν = be a fuzzy set on a set

{ }, ,B p q r= , defined by ( ) 0.9, ( ) 0.6, ( ) 0.2p q rν ν ν= = = .

The problem is to find a fuzzy correspondence that from input values defined by μ creates the output values defined by ν . We have to solve the following relational equation:

Page 14: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

14 A. Tepavčević

( , ) ( , ) ( , )( , ) ( , ) ( , )

[0.8,0.9,0.4,0.1] [0.9,0.6,0.2]( , ) ( , ) ( , )( , ) ( , ) ( , )

R a p R a q R a rR b p R b q R b rR c p R c q R c rR d p R d q R d r

⎡ ⎤⎢ ⎥⎢ ⎥∧ =⎢ ⎥⎢ ⎥⎣ ⎦

This matrix equation is equivalent with the following system of equations: (0.8 ( , )) (0.9 ( , )) (0.4 ( , )) (0.1 ( , )) 0,9R a p R b p R c p R d p∧ ∨ ∧ ∨ ∧ ∨ ∧ =

(0.8 ( , )) (0.9 ( , )) (0.4 ( , )) (0.1 ( , )) 0,6R a q R b q R c q R d q∧ ∨ ∧ ∨ ∧ ∨ ∧ =

(0.8 ( , )) (0.9 ( , )) (0.4 ( , )) (0.1 ( , )) 0,2R a r R b r R c r R d r∧ ∨ ∧ ∨ ∧ ∨ ∧ =,

where we take into account that is the supremum and the infimum on [0 real interval.

∨ ∧,1]

Analysing the first equation, by the fact that all members (except the second one) are less than 0, , we can conclude that

9( , )R b p must be greater or equal to 0, . Analysing the

second equation, we have that either 9)( ,R a q or ( , )R b q must

be equal to (and no one can be greater than 0,6). Further, analysing the third equation, we have that some of the elements

0,6

( , )R a r , ( , )R b r and ( , )R c r must be equal to (and no one is greater than 0,2). Therefore, one of the

solution of this relational equation is e.g. 0,2

0.5 0.6 0.20.9 0.6 0.20.7 0.8 0.20.8 0.5 0.9

R

⎡ ⎤⎢ ⎥⎢ ⎥=⎢ ⎥⎢ ⎥⎣ ⎦

.

This solution satisfies the conditions mentioned above, so we just enter the determined elements, others are taken randomly. This is not a unique solution of the equation, there are infinitely many of them.

Page 15: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

Selected mathematical and statistical methods in biology 15

A further application of fuzzy relations and correspondences that will be presented here is in connection with methods described in Section 3 for ordinary relations. First, a special type of fuzzy relations will be defined and used in the framework of relations determined by fuzzy correspondences.

Let be a fuzzy relation. Then the fuzzy relation : [R A A× → 0,1] R is: reflexive if for all ( , ) 1R x x = x A∈ ; symmetric if ( , ) ( , )R x y R y x= , for all ,x y A∈ ; transitive if ( , ) ( , ) ( , )R x y R y z R x z∧ ≤ , for all , ,x y z A∈ ; antisymmetric if , for all ( , ) ( , ) 0R x y R y x∧ = , ,x y A x y∈ ≠ .

The fact is that cut-relations of a fuzzy relation satisfying special properties above are ordinary relations satisfying analogous properties.

The fuzzy relation R is

-fuzzy similarity (equivalence) relation if it is reflexive, symmetric and transitive; -fuzzy quasi-ordering relation if it is reflexive and transitive; -fuzzy ordering relation if it is reflexive, antisymmetric and transitive.

Cut relations of fuzzy similarity relations are ordinary equivalence relations. Cut relations of fuzzy quasi-ordering and ordering relations are, ordinary quasi ordering and ordering relations (respectively).

If ρ is a fuzzy correspondence from a set to a set A B , : [0A B ,1]ρ × → , then a quasi-ordering relation on θ B can be defined similarly as in construction on ordinary relations, and then a fuzzy equivalence can be defined analogously as in ordinary case.

5. Many valued contexts

Another application of fuzzy correspondences are many-valued contexts. In section 2 we presented ordinary contexts, which are based on ordinary correspondences and relations. In classical formal concept analysis either an object has an attribute or it does not have the attribute. In the case of many valued contexts, an object can have an attribute to some extent. A many valued context is an ordered quadruple , where G , ( , , , )G M W I M and are sets and

WI G M W⊆ × × is a ternary relation. Here, as above, G is a set of objects and M

is a set of attributes. What makes a difference here is a set W , that contains attribute values. I is a ternary relation between , G M and satisfying the following condition: W

If ( , , ) and ( , , ) then .g m w I g m v I w v∈ ∈ =

This means that an attribute for an object should have a unique attribute value. Therefore, it is possible to consider a special mapping instead of :J G M W× → I . If is an ordered set of attribute values, this represents a fuzzy correspondence.

W

This is the way how we can consider many valued contexts as fuzzy correspondences.

In the following, we continue Example 3.

Page 16: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

16 A. Tepavčević

Example 10. Let the set of objects consist of following mushrooms:

G

{ }Boletus edulis, Agaricus xanthoderm Morchella esculentaG = a, and the set of attributes contains following characteristics, as in Example 3:

{ }saprophyte, edible, basidiomycetaM = .

Let { }0, , , ,1W s m g= be a set of attribute values, with the

following meaning:

0 - an object does not have an attribute at all

s - an object has an attribute to a small extent

m - an object has an attribute to a middle extent

g - an object has an attribute to a large extent

1 - an object has an attribute (completely).

The attribute values are ordered in the following way:

0< < < <1s m g .

In the following table a mapping is defined, taking into account mushrooms and their characteristics and attribute values:

:J G M W× →

Table 4

Now, we can read from the table that e.g. Morchella esculenta is edible to a middle extent (this practically means that it is edible when cooked). Now, we can consider a cut-correspondence, e.g. for m -cut, and then we obtain a usual context, identical to the one from Example 3.

0m1Morchella esculenta

1s1

Agaricus xanthoderma

11s Boletusedulis

basidiomycetaediblesaprophyte

0m1Morchella esculenta

1s1

Agaricus xanthoderma

11s Boletusedulis

basidiomycetaediblesaprophyte

Page 17: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

Selected mathematical and statistical methods in biology 17

6. Cluster analysis Cluster analysis (clustering) is a method for assigning a set of different objects into groups (clusters), taking care objects in each group to be as similar as possible, and to be as different as possible from objects in other groups. Frases "as similar as possible" and "as different as possible" are related to a selected measure of similarity or distance. According to these criteria, some groups, called clusters are produced . Therefore, the cluster is a group of objects, which is separated as an entity because of the relatively high similarity (low diversity) within the group and relatively low similarities (big difference) with members of other groups. In most methods of cluster analysis the final result is a partition of the set of considered objects. Then each cluster can be divided further into smaller clusters using the same methods, and so on.

Clustering is a method of statistical data analysis with wide applications, e.g. machine learning, data mining, pattern recognition, image analysis, information retrieval, bioinformatics, etc.

Methods of cluster analysis are of the two main types:

1. agglomerative methods (methods in which objects are grouped into clusters according to characteristics considered.

2. divisive (the methods of dividing a set of objects into several groups (clusters)).

Final results is an equivalence relation (partition of a set of objects we started with).

There are several different types of methods of cluster analysis. Here we present two:

1. Method of k-means clustering

2. Method of fuzzy k-means clustering

Usualy we start from a set of objects we would like to classify into different groups and we have a set of characteristics of these objects. Usualy these characteristics are numerical, although there are methods that allow classification by qualitative characteristics.

K- means clustering

This technique is used in general when we already have some hypotheses concerning the number of clusters. So, we chose a number k in advance. Then this method will produce exactly clusters that are as distinct as possible. kThis method starts with random clusters, and then move objects between obtained clusters with the goal to minimize variability within clusters and to maximize variability between clusters. Clusters are defined by their centers (so firstly we chose random centers). Then, k -means algorithm assigns each point to the cluster whose center is nearest. Then, centers are calculated again, so that the center is the average of all the points in the cluster (the arithmetic mean for each characteristic separately).

k

k

Page 18: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

18 A. Tepavčević

So, we start from k random cluster centers, which determine clusters. With we denote the cluster centers and with clusters determined by the center . Now we consider all objects and we calculate the distance (using some of the similarity or distance measures) of each object from each of the centers. For each object we determine the center with the minimum distance. Then, we join the object to the nearest center. In case there are more centers with the same distance we randomly chose one of them. Now we have all objects divided between clusters. Further we calculate new center coordinates for each cluster (that are average coordinates of all objects in the cluster). Then we continue the procedure in the same way: again we consider all objects and calculate distances from the new centers. And then again assign objects to the closest clusters. In case clusters are identical to those in the previous step, we stop the procedure and adopt the obtained division. If clusters are different then in the previous step, we continue the procedure until some convergence criterion is met (usually that the clusters have not changed).

k , 1,...,ic i k=

ic( )K ci

k

k

The main advantages of this algorithm are its simplicity and speed and thus it is possible to apply it on large datasets. Its disadvantage is that we do not obtain the same result with different initial random assignments. Another disadvantage is that we can use it only with numerical characteristics, since the mean has to be calculated.

Example 11. We start from a set of 8 objects with two defined characteristics and our aim is to apply -means algorithm to obtain two clusters. This is same as we would like to define an equivalence relation on the set of objects with two equivalence classes.

k

Let { }1 2 3 4 5 6 7 8, , , , , , ,A a a a a a a a a= be a set that contains eight

species of mushrooms, and let { }1 2,K k k= be a set

containing two numerical characteristics (e.g. let be an average size of the cap in centimeters and let be an average size of the spores in microns).

1k

2k

1k 2k

1a 3 4

2a 2 1

3a 10 9

4a 4 4

5a 5 5

6a 9 4

7a 8 9

8a 3 2

Now we apply -means algorithm to obtain two clusters. In k

Page 19: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

Selected mathematical and statistical methods in biology 19

order to calculate distances we use Manhattan (or city-block) distance, where the distance between two objects is calculated simply as the sum of absolute differences on all coordinates. E.g. distance between objects with characteristics and ( is calculated as (10,9) )4.4

10 4 9d = − +

8 7

4 11− = .

Now, we start from two randomly chosen cluster centers, . 1 2(3,3), c (5,6)c = =

In the first step we obtain the following clusters: and . 1 1 1 2 4( ) { , , , }K K c a a a a= = 2 2 3 5 6( ) { , , , }c a a a a= =K K

Now we calculate new centers of the obtaining clusters as average characteristics.

1 2 4 8a a a= =1 (3,2.75)4

ac + + +

3 5 6 7 (8a+= =

5 8}a

2 ,6.75)4

a a ac + +

7

.

Now, we have new cluster centres and we assign again the objects to the cluster to which it is closest. Now, we obtain slightly different clusters:

1 1 1 2 4( ) { , , , ,K K c a a a a= = , . 2 2 3 6( ) { , , }K K c a a a= =

Again we calculate centers of new clusters:

1 2 4 5 81 (3.4,3.2)

5a a a a ac + + + += = ,

3 6 72 (9,7.33)

3a a ac + += =

And again we assign objects to the clusters: , . 1 1 1 2 4 5( ) { , , , , }K K c a a a a a= = 8 2 2 3 6( ) { , , }c a a a= = 7K K

Since the obtained clusters are identical to those in the previous step, we stop the procedure and adopt the obtained division.

Fuzzy k-means clustering

The fuzzy -means clustering technique (better known as fuzzy -means) is an extension of the k-means clustering algorithm described above. The difference between two techniques is that the ordinary -means make a partition of the starting set to the subsets, while the fuzzy -means clustering produce a family of fuzzy sets instead of a family of ordinary sets. In other words, while in the usual k -means clustering an object belongs to only one cluster, in the fuzzy

k c

k c

Page 20: Selected mathematical and statistical methods in …...Selected mathematical and statistical methods in biology Andreja Tepavčević Department of Mathematics and Informatics, Faculty

20 A. Tepavčević

k -means clustering a particular object can belong to more than one cluster with a certain grade of membership. Therefore, in the fuzzy clustering, each object has a degree of belonging to clusters, rather than belonging completely to only one cluster. Usually objects on the edge of a cluster belong to the cluster with a smaller degree than the objects in the center of the cluster. For each object the degree of membership to the i -th cluster is calculated. Usually, the sum of those membership degrees for any given is defined to be 1.

a ( )ik aa

The algorithm of the fuzzy -means clustering is very similar to the one of -means clusters: k kFirst we choose a number of clusters. Then we assign randomly for each object a grade of membership to every cluster. Then we compute the center for each cluster (using the grades of membership). Then we compute grades of membership of each element to every cluster taking into account previously computed centers of clusters. Finally, we repeat last two steps until some convergence criterion is met (usually that the grades of membership to clusters have not changed or that the change of membership grades between two iterations is less than the given threshold) . This procedure has advantages when compared to k -means algorithm, in some applications it is more convenient to have clusters with not clear border. The disadvantage is similar as for -means procedure: that the final result depends on the initial choice of membership grades.

k

Ordinary -means clustering is implemented in almost all statistical and mathematical software and fuzzy -means clustering is also incorporated in some of them, like R-package, S-plus and Matlab.

kk

References [1] Bernhard Ganter, Rudolf Wille, Formal concept analysis, Springer, 1999. [2] George J. Klir, Bo Juan, Fuzzy Sets and fuzzy logic, Theory and applications, Prentice

Hall INC. 2002 (seventh printing). [3] David N. Pegler, Mushrooms and toadstools, Mitchell Beazley Publishers Limited, 1983. [4] Andreja Tepavčević, Zorana Lužanin, Mathematical methods in taxonomy, University of

Novi Sad, 2006. [5] Ronald R. Yager, Dimitar Filev, Essentials of fuzzy modeling and control, John Wiley &

Sons, Inc. 1994.