Copyright to IFAC Artificial Intelligence in Real-Time Control, Kuala Lumpur, Malaysia, 1997
Fuzzy Arithmetic-Based Interpolative Reasoning M. Setnes*
U. Kaymak
H.R. van Nauta Lemke
H.B. Verbruggen
Control Laboratory, Delft University of Technology, P.O.Box 5031, 2600GA Delft, The Netherlands. tel: +31-15-2783371 fax: +31-15-2786679 email:
[email protected]
model, and the linear structure of the rule consequents allows for data-driven parameter estimation by Least-Squares techniques. However, the TS models are often less transparent than Mamdani models and it may be difficult to give a linguistic interpretation of the information that is described in the rule base, often requiring a transformation into linguistic rules [2]. For this reason, Mamdani rules are typically used in modeling human expert knowledge, while TS models are frequently preferred in data-driven modeling [1] .
Abstract FAIR - Fuzzy Arithmetic based Interpolative Reasoning is presented. Linguistic rules of the Mamdani type with fuzzy numbers as consequents are used in an inference mechanism similar to that of the Takagi-Sugeno model. The inference result is a weighted sum of fuzzy numbers calculated by means of the extension principle. Both fuzzy and crisp inputs and outputs can be used, and chaining of rule bases is supported without increasing the fuzziness in each step. This provides a setting for the modeling of dynamic fuzzy systems by fuzzy recursion. The matching in the rule antecedents is done by means of a compatibility measure. Different compatibility measures can be used for different antecedent variables, and reasoning with sparse rule bases is supported. Application of FAIR to the modeling of a nonlinear dynamic system is presented as an example. Copyright © 1998 IFAC
In this paper we present Fuzzy Arithmetic-based Interpolative Reasoning (FAIR) that combines desirable properties of both Mamdani and TS models. It offers a framework for working with fuzzy and qualitative data as well as with crisp data, and supports data-driven identification and chaining of rule bases. The rules are Mamdani rules with fuzzy numbers as consequents. The degree of satisfaction of a rule's antecedent is calculated using compatibility measures that can be chosen to facilitate reasoning with sparse rule bases in which the partitioning of the antecedent product space is not complete. Both fuzzy and crisp inputs and outputs are supported and the chaining of rule bases does not increase the fuzziness of the output. FAIR offers flexibility in processing rules with multiple antecedent clauses by allowing different compatibility measures to be used for different clauses. Also, the firing of rules can be prohibited by thresholds. The inference structure is that of TS models, and the output is a weighted sum of fuzzy numbers. The arithmetic operations on the consequent fuzzy numbers are done by the extension principle [6]. The possibility to process rules with fuzzy inputs and outputs provides a setting for linguistic description and interpretation, and modeling of systems based on heuristics and expert knOWledge. The fuzzy numbers in the rule consequents and the used inference structure opens for data-driven estimation of the consequent fuzzy numbers using e.g. Least-Squares (LS) techniques.
1 Introduction The most common approach to fuzzy reasoning is the Compositional Rule of Inference (CRI) [13]. This inference was used in the first reported implementations of fuzzy control by Mamdani [8], applying the minimum operator for both the and-connective and the implication, and the maximum operator for the aggregation. CRI is computationally demanding and the inference result is a subset of the fuzzy sets that are defined in the rule consequents. The result is difficult to interpret as it is often a subnormal and nonconvex fuzzy set with a support wider than the supports of the individual fuzzy rule consequents. This increase in fuzziness from input to output makes the chaining of rule bases difficult and the use of CRI unsuitable for dynamic fuzzy systems. Hence, the outputs of fuzzy systems are defuzzified even in cases where this is not directly desired, and the fuzzy system is reduced to a nonlinear mapping from its inputs to its outputs.
Section 2 discusses the antecedent matching. The FAIR inference and the aggregation of rule contributions is described in Section 3, and consequent estimation is discussed in Section 4. In Section 5, FAIR is applied to the modeling of the pressure in a fermenter tank. using fuzzy identification data. Finally, Section 6 concludes the paper.
Another popular model is the Takagi-Sugeno (TS) fuzzy model [11]. TS rules have fuzzy antecedent parts and linear functions in the consequents. The rule base can be seen as a set of local linear models. The overall output is an interpolation between the outputs of the local models, obtained by a weighted sum. As the output is a crisp number, no defuZzification is needed. The quantitative properties of the TS fuzzy model are often preferred to those of the Mamdani
2 Antecedent matching FAIR uses a compatibility measure to determine the degree of satisfaction of a rule's antecedent for a given input. In CRI,
"This research is partly supported by the Research Council of Norway
379
the role of this compatibility is implicitly built into the application of the sup -t composition between an input and the relation defining the rule [4]. In FAIR, the role of the compatibility measure is explicit, and the compatibility measure can be selected to fit the application. For rules with mUltiple antecedent clauses, different compatibility measures may be used for different clauses. Decomposition of the inference in two distinct operations, a compatibility measure and a consequent modification, is known also from plausible reasoning [9] and approximate analogical reasoning [12].
describe a local relation between inputs and outputs: ~:
ir
N
y. = LbiGi
,
(3)
i=l
where bi is the nonnalized degree of activation of the ith rule calculated as f3i (4) bi = N ' I:i=l f3i where f3i is the degree of satisfaction of the premise of the ith rule. The weighted sum is obtained by applying the extension principle which allows arithmetic operations on crisp real numbers to be extended to fuzzy subsets of IR [5]. Assume that Gi are represented by triangular membership functions as in Fig. 1. Let Cil, Ci2 and Ci3 be the parameters that describe the lower bound of the support interval, the core element and the upper bound of the support interval, respectively [5] . Then, the fuzzy set y. is given by a triangular membership function whose parameters are equal to {I:i bic;l, I:i bi Ci2, I:i bi Ci3}. In the following, only triangular fuzzy numbers Gi will be considered.
Set-theoretic compatibility measures specify no compatibility when the fuzzy sets are disjoint. They can not be used to reason with sparse rule bases, as the conclusion can not be detennined when the input does not intersect with the rule's antecedent. In such cases, geometric compatibility measures must be applied [7]. Based on experience gained from a study of fuzzy set compatibility measures [10], we apply, in the following, the fuzzy analog of the Jaccard index to assess the compatibility of fuzzy sets:
IAnBI
(2)
Here ~ is the ith rule and Xl, ... ,X n are the inputs, where the tilde denotes that the variable can take fuzzy values. Ail , ... ,Ain are the antecedent fuzzy sets, and ~ denotes a matching between a (fuzzy) input Xj and the corresponding antecedent fuzzy set A ij . The y denotes the output, Gi is a fuzzy number [6] representing the consequent of the rule, and N denotes the number of rules in the rule base. The aggregated output of the model is calculated by taking the weighted sum of the rule consequents:
Assigning a degree of agreement between an input fuzzy set and the antecedent fuzzy set of a rule is an important component in the application of FAIR. A variety of fuzzy set compatibility measures is reported in literature [14, 3]. Two major classes are the set-theoretic and the geometric compatibility measures. Set-theoretic compatibility measures between fuzzy sets are generalizations of the classical set-theoretic similarity functions. Fuzzy set operations like union, intersection, complement, difference and fuzzy set cardinality, are used to define various compatibility measures. Geometric compatibility measures are based on the proximity of fuzzy sets.
S(A,B) = IAUBI'
H Xl ~ Ail and ... and xn ~ Ain thenyis Gi , i = 1,2, . . . ,N.
(1)
c
Here nand U are the intersection and union operators, respectively, A and B are fuzzy sets, and I . I denotes the scalar cardinality of a fuzzy set [6] . We use the minimum and the maximum to model the intersection and the union, respectively. This measure captures the average similarity of a pair of fuzzy sets, and S(A, B) E [0,1], where S(A, B) = 1 corresponds to equal fuzzy sets (i.e. I'A(X) = I'B(X), 't/x EX), and S(A, B) = 0 to cases where A and B are disjoint. When one of the antecedent variables is crisp, the membership of that input to the respective antecedent fuzzy set is taken as the degree of satisfaction for that part of the antecedent. For sparse rule bases, the so-called dissemblance index [5] from the class of geometric compatibility measures is a suitable candidate that captures the average proximity of fuzzy sets, in analogy to (1).
Figure 1: A triangular fuzzy set G is defined by the parameters { Cl, C2, C3}, describing the lower bound of the support, the core and the upper bound of the support, respectively, or alternatively by {CL, C2, CR}, describing the left spread, the core and the right spread of the fuzzy set, respectively.
A compatibility measure is used to calculate the degree of satisfaction of a rule's antecedent for a given input, and thus its degree of contribution to the overall output Y·. For rules with multiple antecedent variables, the total satisfaction of a rule ~ is an aggregation of the individual matches in each variable. In principle, any t-nonn can be used for the aggregation operator.
3 FAIR inference The structure of a FAIR model is similar to that of a zero-order TS model [11]. It consist of a set of fuzzy rules each of which
380
During the recursive simulation of the model in (6), the inferred output y* (k + 1) is used as input for the next time step (8). This can be seen as a chaining of rule bases, where the fuzzy output of one rule base acts as input for another. The weighted sum of the rule contributions used in FAIR, ensures that the fuzziness of the output always remains bounded.
Based on empirical studies, we use the product operator in the following. Hence,
f3i
= IT;': 1 S(Xj, Aij),
i
= 1,2, ... , N.
(5)
Since the consequent of each rule is a fuzzy number, the overall output y* is also a fuzzy number. The weighting by f3i and normalization by Li f3i ensures that the fuzziness of y* never exceeds that of the fuzziest consequent in the rule base:
4 Determination of FAIR models
11 supp(fj*) II~ max 11 supp(Ci ) 11,
•
In addition to identification by means of methods such as cluster analysis and expert knowledge [1], the fuzzy numbers in the consequents of the FAIR rules can be effectively identified from measurements by LS estimation. The identification data can be fuzzy, where the fuzziness can be interpreted as e.g. possibility distributions or represent uncertainty or qualitative measurements. Consider a fuzzy model as in (2). There are many ways to obtain the antecedent part. A common approach in fuzzy control is to select some standard partition of the domain of the input variables like Small, Medium and Big, and then optimize from that. Other methods are e.g. partitioning based on expert knowledge or data driven approaches like clustering [1]. In the following, we assume that the antecedent part of the rule base is known. The output of the model for an input Xk = [Xl (k), X2(k) , . . . , xn(k)] is given by bkTC where bk is a vector in llN = [0, I]N whose elements
where supp denotes the support of a fuzzy set, supp(A) = {x E XIJLA(x) > O}, and 11 . 11 denotes the length of the support interval. Example 3.1 Consider a first order dynamic system that predicts the fuzzy state y(k + 1) of the output at time k + 1 from the current state y(k) and a crisp input u(k) :
y(k
+ 1) =
f(fj(k),u(k)).
(6)
Let R denote the set of all fuzzy subsets of lit The fuzzy model is a static mapping f : (fj(k),u(k)) E (R,IR) ~ y(k+1) ER. This mapping is described by the rule base and the applied inference method. Consider a rule base consisting of two rules:
RI: Hy(k) ~ R2 : Hy(k) ~
All A2l
andu(k) ~ A12 theny(k and u(k) ~ A22 then y(k
+ 1) is Cl , + 1) is C2·
(9)
The antecedent of Ri, i = 1,2, consists of two clauses, modeled by Ail and Ai2 that describe the state of y(k) and u(k), respectively.
are the normalized degrees of satisfaction of the rule antecedents that are calculated by (5), and C is a vector of the triangular fuzzy numbers in the rule consequents, C = [Cl, C2, . . . , C N] . The identification problem is the estimation of the fuzzy consequents Cl , .. . , CN.
The degree of activation of the rule is calculated by applying (1) to the first clause, and by taking the membership of the crisp input u(k) in the fuzzy set Ai2 for the second clause:
Assuming that a number of input - output pairs (Xk, y(k)), k = 1, ... , K is available (e.g. from measuremenets) with K > N, the consequent fuzzy sets Cl, ... , C N can be obtained as the solution to the LS problem
Figure 2 illustrates the reasoning, and shows the contributions of each rule (C~ and C~) inferred from the normalized degree of match in the antecedent and the rule consequents (Cd and (C2). For this case, S(fj(k), All) = 0.143, S(fj(k), A2d = 0.143,JL A12(u(k)) = 0.2, and JLA22(U(k)) = 0.8. Consequently, from (5), we get the degrees of activation, f3l (k) = 0.0286, f32(k) = 0.1144. Following (3), the contribution of each rule can be written as
BC
= y,
(10)
where B = [bki] is a matrix in llKxN whose elements are the degree of contribution of the ith rule given the input Xk, and y is the vector of fuzzy observations y(k) described by triangular fuzzy sets. A unique solution does not exist to the LS problem (10). The solution obtained by applying the extension principle results in consequent parameters that are hampered by high fuzziness. Instead, we suggest the following solution. First, the parameterized triangular fuzzy sets y(k) [Ykl,Yk2,Yk3],k 1, ... ,K are described in terms of their left spread, core and right spread:
=
=
and the overall model output as illustrated in Fig. 2 becomes:
y*(k + 1) = C~ (k) + C~(k),
(8)
where YkL = Yk2 - Ykl and YkR = Yk3 - Yk2 . The fuzzy sets C i in the rule consequents are also parameterized this way. An approximation to the solution of the LS problem in (10) is
where the arithmetic operations on fuzzy numbers are defined according to the max - min extension principle. 0
381
IF
1&\5'(') •
RI'•
J1. 11
,./
..
\.
. [m y
R2°.
Y(k),./ \. A :, ,.:'
21
\,
Y
Premise
Consequent
Output
Figure 2: FAIR inference with two rules, R1 and R2 , given a fuzzy and a crisp input, y(k) and u(k), respectively, as shown by the dotted lines in the premise. The dotted lines in the consequent show the contribution of each rule (q and C~) whos sum gives the output, y. = q + q . Valve (ul)
now solved in three separate steps. First the crisp LS problem BC2 = Y2 is solved to determine the cores of the sets Ci :
r.===::::::t*t::::,-air Oowout
(11)
where
- - + - - Pressure (y)
and Y2 = [Y12, Y22, . .. , YK2]T are vectors whose elements are the cores of the fuzzy sets C i and y(k), respectively. Then the similar two crisp LS problems BCL = YL and BCR = YR are solved to obtain the left and the right spread of the fuzzy sets Ci, constraining the solution to be non-negative. Here CL = [c1L,C2L " " , CNL] andcR = [C1R,C2R" ", CNR] are vectors whose elements are the left and right spread, respectively, of the fuzzy sets Ci , and the vectors Y L and Y R contains the left and right spread, respectively, of the fuzzy sets Y(k). The triangular fuzzy sets in the consequents of the rules are found by combining the solution of the three separate crisp LS problems above and are given by their three describing parameters C i = {Cil, Ci2 , Ci3}, where Ci1 = Ci2 - CiL and Ci3
C2
[C12, C22, . . . , CN2V
,. .~~ 0°:
Water
air flow in
t.::::::==::::::t>r
Figure 3: Experimental set-up of the fermenter tank. valve U1 as the manipulated variable and the pressure Y as the controlled variable.
= Ci2 + CiR ·
The process dynamics can be modeled as a nonlinear firstorder dynamic system. By considering the state of the pressure to be a fuzzy variable and the position of the valve to be crisp, the process can be modeled by:
5 Modeling of systems using FAIR In this section, we present the modeling of a real-world system by means of the FAIR method. The model with fuzzy outputs is identified by LS approximation where the identification data consist of fuzzy observations. The model is evaluated in a free-run .
5.1
y(k + 1)
= f(Y(k),U1(k)),
(12)
where y(k + 1) is the model output at time k + 1, y(k) is the previous model output, and U1 (k) is the model input at time k. The identification of the model concerns an approximation to the unknown function f (.).
Pressure dynamics of a fennenter tank 5.2
One of the variables that must be carefully controlled during a fermentation process is the pressure in the fermenter tank. To study the pressure dynamics in a fermenter tank, a laboratory set-up as shown in Fig. 3 is used. The pressure y in the tank can be controlled by two valves: U1 controls the amount of air escaping from the fermenter tank, while U2 controls the amount of air that enters the tank. In the rest of this paper, the amount of air entering the system is kept constant. Hence, only the SISO system is considered with the position of the
Identification
Data sets for identification and evaluation are obtained from the experimental set-up illustrated in Fig. 3, by means of systems measurements. From systems measurements, fuzzy observations y(k+ 1) are obtained that are represented by triangular membership functions (fuzzy numbers). These fuzzy observations represent possibility distribution for the pressure at time k + 1. The input U1 (k) is assumed to be crisp.
382
By using knowledge about the process [2], the antecedent variables y(k) and u(k) are partitioned into 4 fuzzy regions as shown in Fig. 4. The process is modeled by a rule base Low
Medium
2.2
2
~18
Very high
High
~ e
:::'16
.t=14
I
O~--------~S~OO~--------~--------~ISOO Time [sec]
(a) Fuzzy data li(k
+ 1)
(a) Partition of antecedent variable y(k)
Open
Half open
Almost closed
Closed
09
() 8i"
~:t
I::~
o 3~
Ot
(b) Fuzzy rule consequents
%L------2~O----~~----~~60~--~~----~
Valve position [% closed]
Figure 5: (a) Fuzzy data (solid line: core, dotted lines: bounds of support), (b) the identified fuzzy rule consequents.
(b) Partition of antecedent variable u(k)
Figure 4: Fuzzy partitions for the antecedent variables. the inferred output remains bounded. The simulation shows that the identified FAIR model captures the properties of the system very well. For applications requiring a crisp output, this can be obtained by simply taking the core or the center of gravity of the fuzzy output. Since the fuzzy output is a triangular fuzzy number, a qualitative linguistic description is easily obtained, e.g. by matching the output to a set of reference sets. Figure 6b shows the qualitative interpretation of the simulation output using the linguistic terms defined in the antecedent of the model (see Fig. 4a). This is obtained by letting the linguistic label of the fuzzy output be that of the fuzzy antecedent set with which it has the highest compatibility (1).
with 16 rules of the following form:
R; : Hii(k) ~ Ail and u(k) ~ Ai2 then ii(k + 1) is C i , i = 1,2 . . . . ,16.
(13)
When knowledge is not available to determine the antecedent partition, data driven approaches such as fuzzy clustering [1] can be applied. Given the antecedent partition in Fig. 4, the fuzzy numbers Cl, C2 , • . . ,C16 in the consequents are estimated from the identification data as described in Section 4.
5.3
Simulation and verification
6 Conclusions
A fuzzy model of the fermenter pressure is identified as described above. The fuzzy observations used to identify the model is shown in Fig. Sa, and the identified fuzzy rule consequents Ci are shown in Fig. 5b. An evaluation of the obtained FAIR model in a free-run using evaluation data is shown in Fig. 6a. Note that even though the fuzzy output is fed back to serve as input for the following time step, the fuzziness of
A Fuzzy Arithmetic-based Interpolative Reasoning (FAIR) method is presented. The inference is decomposed into two distinct operations: a compatibility matching, and a consequent modification operation which give additional flexibility in matching and processing of rules, compared to tra-
383
References [1] R. Babuska. Fuzzy Modeling and Identification. Ph.D. Thesis, De1ft University of Technology, Dep. of El. Eng., Control Laboratory, Dec. 1996. [2] R. Babuska and H. B. Verbruggen. A new identification method for linguistic fuzzy models. In Proceedings FUZZIEEElIFES'95, pages 905-912, Yokohama, Japan, March 1995. [3] V. Cross. An Analysis of Fuzzy Set Aggregarors and Compatibility Measures. Ph.d. thesis, Wright State University, Ohio, 1993. [4] V. Cross and T. Sudkamp. Patterns of fuzzy rule-based inference. International Journal of Approximate Reasoning, 11:235-255, 1994. (a) Free-run of FAIR fuzzy model
[5] A. Kaufmann and M. M. Gupta. Introduction to Fuzzy Arithmetic, Theory and Applications. Van Nostrand Reinhold, New York,1985.
High
[6] G. 1. Klir and B. Youan. Fuzzy Sets and Fuzzy Logic: Theory and Applications. Prentice Hall, New Jersey, 1995. [7] L. Koczy and K. Hirota. Approximate reasoning by linear rule interpolation and general approximation. International Journal of Approximate Reasoning, 9:197-225,1993. Medium
Low
[8] E. H. Mamdani. Application of fuzzy algorithms for control of a simple dynamic plant. In Proceedings lEE, number 121, pages 1585-1588, 1974.
- -
[9] H. Prade. Approximate and plausible reasoning. In E. Sanchez, editor, Fuzzy Infonnation, Knowledge Representation, and Decision Analysis. Pergamon Press, Oxford, UK, 1984.
I
t=
o
100
200
400 300 Time [sec)
500
600
700
[10] M. Setnes. Fuzzy rule-base simplification using similarity measures. M.Sc. Thesis, Delft University of Technology, Dep. of El. Eng., Control Laboratory, July 1995.
(b) Linguistic output
[11] T. Takagi and M. Sugeno. Fuzzy identification of systems and its applications to modelling and control. IEEE Transactions on Systems, Man, and Cybernetics, 15:116-132, 1985.
Figure 6: (a) Evaluation of the model in a free-run using evaluation data (dash-dotted line: core, dotted lines: bounds of support), (b) the corresponding linguistic output.
[12] I. B. Thrksen and Z. Zhong. An approximate analogical reasoning scheme based on similarity measures and interval-valued fuzzy sets. Fuzzy Sets and Systems, 34:323-346, 1990. [13] L. A. Zadeh. Outline of a new approach to the analysis of complex systems and decision processes. IEEE Transactions on Systems, Man, and Cybernetics, 1:28-44, 1973.
ditional CRI-based systems. The method combines the qualitative properties of the Mamdani models with the quantitative properties of the TS models. FAIR supports the chaining of rule bases without the problem of propagating fuzziness, and it can be used with sparse rule bases, too.
[14] R. Zwick, E. Carlstein, and D. V. Budescu. Measures of similarity among fuzzy concepts: A comparative analysis. International Journal of Approximate Reasoning, 1:221-242, 1987.
The rules used in FAIR are similar to Mamdani rules, with fuzzy sets as consequents. Thus, they are suitable for qualitative modeling based on heuristics and expert knowledge. The inference mechanism in FAIR is that of the TS model, and the output is a weighted sum of fuzzy numbers. This enables the use of data driven techniques to identify the fuzzy rule consequents from data that can be partly fuzzy and partly crisp, and an approach to solving the fuzzy regression problem by splitting it into three separate constrained LS problems is presented. The overall model output is always a fuzzy number whose fuzziness is bounded by the fuzziness of the rule consequents. As shown in this paper, a description of the system behavior in qualitative linguistic terms can easily be obtained.
384