Fuzzy Representation and Conversions
Using fuzzy set theory, it's possible to define fuzzy values that are stored in single fuzzy variables. These fuzzy variables can be combined to create a more intuitive concept known as linguistic variables.
To initialize these fuzzy values from crisp numbers, the membership function is used. Converting from crisp to fuzzy is known as fuzzification, and the opposite is known as defuzzification.
Fuzzy Variables and Values
A fuzzy variable can be considered as a term, associated with a single float representing a fuzzy truth value. There is nothing complex about this intrinsically; it's just a symbol/number pair. For example, the variables shown in Table 30.1 might represent an enemy in a deathmatch.
These variables are conceptually independent from each other. To give each concept a more intuitive definition, fuzzy variables can be combined.
Linguistic variables are a more sophisticated representation, and prove more humanlike. They harness the power of fuzzy logic to model real concepts without being limited to one fuzzy variable, or tied to the precision of crisp variables.
A linguistic variable is a high-level concept, such as health (see Table 30.2). However, instead of being associated with only one fuzzy variable, it corresponds to a collection of them—each a symbol/real number pair. Each symbol is known as a term; the group of fuzzy terms is known as the term set.
These fuzzy variables are used in conjunction with each other to express the linguistic variable. Taken alone, they do not have the same meaning.
The linguistic variable is defined over base variables. The base variables correspond to the set of values over which the terms are defined. Base variables can correspond to continuous crisp values and fuzzy terms (see Figure 30.4).
Figure 30.4. The linguistic variable allegiance defined as a collection of membership functions defined over a single base variable (love).
Fuzzification is the process of creating a fuzzy variable from a crisp value. This is done by using fuzzy sets. The membership function defines the value of a fuzzy variable, as shown in Figure 30.5. The universe of discourse is in fact the range of the crisp value. Evaluating the membership function in terms of this crisp value results in the degree of membership.
Figure 30.5. Using the membership function to determine a fuzzy value in terms of a crisp value in the universe of discourse.
Naturally, the speed of the fuzzification depends entirely upon the efficiency of the membership function. For simple functions, it's faster to evaluate it dynamically with a native implementation. Using more complex membership functions may warrant the use of lookup tables to speed up the process.
The process of defuzzification aims to do the exact opposite of fuzzification: convert a fuzzy value to a crisp value. This is relatively straightforward for atomic fuzzy values, but can get trickier for linguistic variables. The problem is to find a single crisp value for a concept expressed as a set of fuzzy values.
This process fundamentally involves the loss of information; only in the simplest case can the conversion process be lossless (although not all techniques exhibit this property). Each method will therefore have its own set of assumptions and flaws. It's also the case that different approaches to defuzzification are appropriate for certain types of problems (see Figure 30.6). There is no unique equation, because even humans defuzzify linguistic concepts in problem-dependent ways.
There are two major approaches to defuzzification:
When simple atomic sets are used as the fuzzy sets, the maximum approach works just fine. It's simple to implement, and faster by an order of magnitude. Indeed, we don't even need to compute the maxima, because we often know it (used to define the membership function). Centroid methods can be seen as more mathematically correct, but this seems out of place compared to the informal nature of fuzzy reasoning.