Content uploaded by Oscar Castillo
Author content
All content in this area was uploaded by Oscar Castillo
Content may be subject to copyright.
Abstract
—This paper presents the development and design of
a graphical user interface and a command line programming
toolbox for construction, edition and observation of Interval
Type-2 Fuzzy Inference Systems. The Interval Type-2 Fuzzy
Logic System Toolbox (IT2FLS), is an environment for interval
type-2 fuzzy logic inference system development. Tools that cover
the different phases of the fuzzy system design process, from the
initial description phase, to the final implementation phase, build
the Toolbox. The Toolbox’s best qualities are the capacity to
develop complex systems and the flexibility that permits the user
to extend the availability of functions for working with the use of
type-2 fuzzy operators, linguistic variables, interval type-2
membership functions, defuzzification methods and the
evaluation of Interval Type-2 Fuzzy Inference Systems.
Index Terms
— Interval Type-2 Fuzzy Inference Systems,
Interval Type-2 Fuzzy Logic Toolbox, Interval Type-2
Membership Functions, Footprint of Uncertainty.
I. INTRODUCTION
On the past decade, fuzzy systems have displaced
conventional technology in different scientific and system
engineering applications, especially in pattern recognition and
control systems. The same fuzzy technology, in
approximation reasoning form, is resurging also in the
information technology, where it is now giving support to
decision making and expert systems with powerful reasoning
capacity and a limited quantity of rules.
The fuzzy sets were presented by L.A. Zadeh in 1965 [1,2]
to process / manipulate data and information affected by
unprobabilistic uncertainty / imprecision. These were designed
to mathematically represent the vagueness and uncertainty of
linguistic problems; thereby obtaining formal tools to work
with intrinsic imprecision in different type of problems; it is
considered a generalization of the classic set theory.
Intelligent Systems based on fuzzy logic are fundamental
tools for nonlinear complex system modeling. The fuzzy sets
and fuzzy logic are the base for fuzzy systems, where their
objective has been to model how the brain manipulates inexact
information.
Type-2 fuzzy sets are used for modeling uncertainty and
imprecision in a better way. These type-2 fuzzy sets were
Oscar Castillo is with the Division of Graduate Studies and Research in
Tijuana Institute of Technology, Mexico (corresponding author phone: 52664-
623-6318; fax: 52664-623-6318; e-mail: ocastillo@tectijuana.mx).
Juan R. Castro is a graduate student in Science and Engineering with the
Division of Graduate Studies and Research in Baja California Autonomous
University, Tijuana Campus, Mexico (e-mail: jrcastror@uabc.mx).
Luis G. Martinez is a graduate student in Science and Engineering with the
Division of Graduate Studies and Research in Baja California Autonomous
University, Tijuana Campus, Mexico (e-mail: luisgmo@uabc.mx).
originally presented by Zadeh in 1975 and are essentially
“fuzzy fuzzy” sets where the fuzzy degree of membership is a
type-1 fuzzy set [4,6]. The new concepts were introduced by
Mendel and Liang [8,10] allowing the characterization of a
type-2 fuzzy set with a superior membership function and an
inferior membership function; these two functions can be
represented each one by a type-1 fuzzy set membership
function. The interval between these two functions represent
the footprint of uncertainty (FOU), which is used to
characterize a type-2 fuzzy set.
The uncertainty is the imperfection of knowledge about the
natural process or natural state. The statistical uncertainty is
the randomness or error that comes from different sources as
we use it in a statistical methodology.
There are different sources of uncertainty in the evaluation
and calculus process. The five types of uncertainty that
emerge from the imprecise knowledge natural state are:
• Measurement uncertainty. It is the error on observed
quantities.
• Process uncertainty. It is the dynamic randomness.
• Model uncertainty. It is the wrong specification of
the model structure.
• Estimate uncertainty. It is the one that can appear
from any of the previous uncertainties or a
combination of them, and it is called inexactness and
imprecision.
• Implementation uncertainty. It is the consequence of
the variability that results from sorting politics, i.e.
incapacity to reach the exact strategic objective.
II. INTERVAL TYPE-2 FUZZY SET THEORY
A. Type-2 Fuzzy Sets Concept
A type-2 fuzzy set [6,7] expresses the non-deterministic
truth degree with imprecision and uncertainty for an element
that belongs to a set. A type-2 fuzzy set denoted by
A
~
~
, is
characterized by a type-2 membership function
),(
~
~
ux
A
µ
,
where x∈X, u ∈
u
x
J ⊆ [0,1] and 1),(0
~
~
≤
≤ ux
A
µ
defined
in equation (1).
{
}
XxxxA
A
∈= |))(,(
~
~
~
~
µ
A
~
~
{
}
]1,0[,|)),(,,(
~
~
⊆∈∀∈∀=
u
x
A
JuXxuxux
µ
(1)
An example of a type-2 membership function constructed in
the IT2FLS toolbox was composed by a Pi primary and a
Gbell secondary type-1 membership functions, these are
depicted in Figure 1.
Interval Type-2 Fuzzy Logic Toolbox
Juan R. Castro, Oscar Castillo, Luis G. Martínez
Engineering Letters, 15:1, EL_15_1_14
______________________________________________________________________________________
(Advance online publication: 15 August 2007)
Fig. 1. FOU for Type-2 Membership Functions.
If
A
~
~
is continuous it is denoted in equation (2).
=
∫∫
∈
⊆∈
Xx
Ju
x
xuufA
u
x
//)(
~
~
]1,0[
(2)
where
∫∫
denotes the union of x and u. If A
~
~
is discrete then
it is denoted by equation (3).
=
=
∑∑∑
==∈
N
i
i
M
k
ikikx
Xx
A
xuufxxA
i
i
11
~
~
//)(/)(
~
~
µ
(3)
where
∑∑
denotes the union of x and u.
If
]1,0[],[,1)( ⊆∈∀=
u
x
u
x
x
JJuuf , the type-2
membership function
),(
~
~
ux
A
µ
is expressed by one type-1
inferior membership function,
)(xJ
A
u
x
µ
≡ and one type-1
superior,
)(xJ
A
u
x
µ
≡ (Fig. 2), then it is called an interval
type-2 fuzzy set [8] denoted by equations (4) and (5).
⊆∈∀
∈∀
=
]1,0[)](),([
,|)1,,(
~
~
xxu
Xxux
A
A
A
µµ
(4)
or
=
=
∫∫
∫∫
∈⊆∈
∈
⊆∈
Xxxxu
Xx
JJu
xu
xuA
A
A
u
x
u
x
//1
//1
~
~
]1,0[)](),([
]1,0[],[
µµ
(5)
If
A
~
~
is a type-2 fuzzy Singleton, the membership function is
defined by equation (6).
≠
=
=
'0/1
'1/1
)(
~
~
xxsi
xxsi
x
A
µ
(6)
Fig. 2. FOU for Gbell Primary Interval Type-2 Membership
Functions.
B. Fuzzy Set Operations
We can apply some operators to the fuzzy sets, or we can
make some operations between them [4,10,11]. When we
apply an operator to one fuzzy set we obtain another fuzzy set;
by the same manner when we combine an operation with two
or more sets we obtain another fuzzy set. If we have two
type-2 fuzzy subsets identified by the letters
A
~
~
and
B
~
~
,
associated to a linguistic variable, we can define three basic
operations: complement, union and intersection (TABLE I).
TABLE I
Interval Type-2 Fuzzy Set Operations.
Name Operator Operation
Union
= join
A
~
~
B
~
~
={
∫
∈Xx
A
x)(
~
~
µ
)(
~
~
x
B
µ
}
=
∫∫
∈∨∨∈Xxxxxx
x
BA
BA
//1
)]()(),()([
~
~
~
~
µµµµα
α
Intersectio
n
= meet
A
~
~
B
~
~
={
∫
∈Xx
A
x)(
~
~
µ
)(
~
~
x
B
µ
}
=
∫∫
∈∧∧∈Xxxxxx
x
BA
BA
//1
)]()(),()([
~
~
~
~
µµµµα
α
Negation
¬
=
=¬
∫∫
∫
∈−−∈
∈
Xxxx
Xx
A
x
xxA
A
A
//1
/)(
~
~
])(1),(1[
~
~
~
~
µµα
α
µ
Engineering Letters, 15:1, EL_15_1_14
______________________________________________________________________________________
(Advance online publication: 15 August 2007)
C. Fuzzy Inference System
The human knowledge is expressed in fuzzy rule terms with
the next syntaxes:
IF <fuzzy proposition>
THEN <fuzzy proposition>
The fuzzy propositions are divided in two types, the first
one is named atomic: x is A, where x is a linguistic variable
and A is a linguistic value; the second one is called
compounded: x is A AND y is B OR z is NOT C, this is a
compounded atomic fuzzy proposition with the “AND”, “OR”
and “NOT” connectors, representing fuzzy intersection, union
and complement respectively. The compounded fuzzy
propositions are fuzzy relationships. The membership function
of the rule IF-THEN is a fuzzy relation determined by a fuzzy
implication operator. The fuzzy rules combine one or more
fuzzy sets of entry, called antecedent, and are associated with
one output fuzzy set, called consequents. The Fuzzy Sets of
the antecedent are associated by fuzzy operators AND, OR,
NOT and linguistic modifiers. The fuzzy rules permit
expressing the available knowledge about the relationship
between antecedent and consequents. To express this
knowledge completely we normally have several rules,
grouped to form what it is known a rule base, that is, a set of
rules that express the known relationships between antecedent
and consequents. The fuzzy rules are basically IF
<Antecedent> THEN <Consequent> and expresses a fuzzy
relationship or proposition.
In fuzzy logic the reasoning is imprecise, it is
approximated, that means that we can infer from one rule a
conclusion even if the antecedent doesn’t comply completely.
We can count on two basic inference methods between rules
and inference laws, Generalized Modus Ponens (GMP)
[5,6,8,13] and Generalized Modus Tollens (GMT), that
represent the extensions or generalizations of classic
reasoning. The GMP inference method is known as direct
reasoning and is resumed as:
Rule IF x is A THEN y is B
Fact x is A’
_______________________________________
Conclusion y es B’
Where A, A’, B and B’ are fuzzy sets of any kind. This
relationship is expressed as
)('' BAAB →= . Figure 3
shows an example of Interval Type-2 direct reasoning with
Interval Type-2 Fuzzy Inputs.
An Inference Fuzzy System is a rule base system that uses
fuzzy logic, instead of Boolean logic utilized in data analysis
[4,10,20]. Its basic structure includes four components (Fig.
4):
•
Fuzzificator.
Translates inputs (real values) to fuzzy
values.
•
Inference System.
Applies a fuzzy reasoning
mechanism to obtain a fuzzy output.
•
Type Defuzzificator/Reductor.
The defuzzificator
traduces one output to precise values; the type
reductor transforms a Type-2 Fuzzy Set into a Type-
1 Fuzzy Set.
•
Knowledge Base.
Contains a set of fuzzy rules, and a
membership functions set known as the database.
Fig. 3. Interval Type-2 Fuzzy Reasoning.
The decision process is a task that identifies parameters by the
inference system using the rules of the rule base data. These
fuzzy rules define the connection between the input and
output fuzzy variables. A fuzzy rule has the form: IF
<Antecedent> THEN <Consequent>, where antecedent is a
compound fuzzy logic expression of one or more simple fuzzy
expressions connected with fuzzy operators; and the
consequent is an expression that assigns fuzzy values to
output variables. The inference system evaluates all the rules
of the rule base and combines the weights of the consequents
of all relevant rules in one fuzzy set using the aggregate
operation. This operation is analog in fuzzy logic to the S-
norm operator.
Fig. 4. Type-2 Inference Fuzzy System Structure.
Fuzzy modeling is a task for parameter identification in a
fuzzy inference system to obtain an adequate behavior. A
fuzzy model with the direct view is constructed with the
knowledge of an expert. This task becomes more difficult
when the available knowledge is incomplete or when space is
a problem, then the use of automatic views are recommended
for the fuzzy model. It can be considered different point of
views for fuzzy modeling, based on neural networks, genetic
algorithms and hybrid methods. The selection of relevant
variables and adequate rules is critical for generating a good
Engineering Letters, 15:1, EL_15_1_14
______________________________________________________________________________________
(Advance online publication: 15 August 2007)
system. One of the biggest problems occurring in fuzzy
modeling is dimensionality, that is, when the computational
requirements grow exponentially in relation of the quantity of
variables.
III. INTERVAL TYPE-2 FUZZY LOGIC SYSTEM
DESIGN
The Mamdani and Takagi-Sugeno-Kang (TSK) Interval
Type-2 Fuzzy Inference Models [10] and the design of
Interval Type-2 membership functions and operators are
implemented in the IT2FLS Toolbox (Interval Type-2 Fuzzy
Logic Systems) reused from the Matlab® commercial Fuzzy
Logic Toolbox.
The IT2FLS Toolbox includes a series of folders called
dit2mf, it2fis, it2mf and it2op (Fig. 5). This folders contain the
functions to create Mamdani and TSK Interval Type-2 Fuzzy
Inference Systems (newfistype2.m), functions to add input-
output variables and their ranges (addvartype2.m), it has
functions to add 22 types of Interval Type-2 Membership
functions for input-outputs (addmftype2.m), functions to add
the rule matrix (addruletype2.m), it can evaluate the Interval
Type-2 Fuzzy Inference Systems (evalifistype2.m), evaluate
Interval Type-2 Membership functions (evalimftype2.m), it
can generate the initial parameters of the Interval Type-2
Membership functions (igenparamtype2.m), it can plot the
Interval Type-2 Membership functions with the input-output
variables (plotimftype2.m), it can generate the solution surface
of the Fuzzy Inference System (gensurftype2.m), it plots the
Interval type-2 membership functions (plot2dtype2.m,
plot2dctype2.m), a folder to evaluate the derivatives of the
Interval type-2 Membership Functions (dit2mf) and a folder
with different and generalized Type-2 Fuzzy operators (it2op,
t2op).
Fig. 5. Toolbox Folder.
The Interval Type-2 Fuzzy Inference Systems (IT2FIS)
structure is the MATLAB object that contains all the interval
type-2 fuzzy inference system information. This structure is
stored inside each GUI tool. Access functions such as
getifistype2 and setifistype2 make it easy to examine this
structure.
All the information for a given fuzzy inference system is
contained in the IT2FIS structure, including variable names,
membership function definitions, and so on. This structure can
itself be thought of as a hierarchy of structures, as shown in
the following diagram (Fig. 6).
Fig. 6. Hierarchy of IT2FIS structures diagram.
The implementation of the IT2FLS GUI is analogous to the
GUI used for Type-1 FLS in the Matlab® Fuzzy Logic
Toolbox, thus permitting the experienced user to adapt easily
to the use of IT2FLS GUI. Figures 7 and 8 show the main
viewport of the Interval Type-2 Fuzzy Inference Systems
Structure Editor called IT2FIS (Interval Type-2 Fuzzy
Inference Systems).
Fig. 7. IT2FIS Editor.
Engineering Letters, 15:1, EL_15_1_14
______________________________________________________________________________________
(Advance online publication: 15 August 2007)
Fig. 8. Interval Type-2 MF’s Editor.
A. Mamdani Interval Type-2 Fuzzy Inference System
The Mamdani IT2FIS, is designed with n inputs, m outputs
and r rules. The kth rule with interval type-2 fuzzy
antecedents
}{
~
~
,
,,
ik
lijk
A
µ
∈ , interval type-2 fuzzy consequent
}{
~
~
,
,,
jk
ljjk
C
σ
∈ and interval type-2 fuzzy facts
'
~
~
i
A are
inferred as a direct reasoning [10].
''
11
,,1,1,1
~
~
...
~
~
:
~
~
...
~
~
~
~
...
~
~
:
nn
mkmjknkk
k
AisxandandAisxIFH
CisyandandCisyTHENAisxnandandAisxIFR
_________________________________________________
''
11
~
~
...
~
~
:
mm
CisyandandCisyC
The evaluation of this reasoning is:
)
~
~
~
~
()
~
~
~
~
(
~
~
~
~
~
~
,,,1,,1,, jknkjkknkkjk
CACAAAR →××→=××= ……
, kth rule.
''
1
~
~
~
~
~
~
n
AAH ××= … , facts.
jkjk
RHC
,
"
,
~
~
~
~
~
~
= = )]
~
~
~
~
(
~
~
[
,,
'
jkiki
n
i
CAA →
=
=
∫∫
⊆∈Y
j
yy
y
j
jk
C
j
jk
C
//1
]1,0[)](),([
"
,
~
~
"
,
~
~
µµα
α
()
)(*
~
)(*
~
)()(
,,
'"
,
~
~
~
~
~
~
1
~
~
*
~
j
C
i
A
i
A
n
i
j
C
yxxy
jkikijk
µµµµ
=
=
()
)(*
~
)(*
~
)()(
,,
'"
,
~
~
~
~
~
~
1
~
~
*
~
j
C
i
A
i
A
n
i
j
C
yxxy
jkikijk
µµµµ
=
=
=
'
~
~
j
C =
=
"
,1
~
~
jk
r
k
C [
1
r
k
=
)]
~
~
~
~
(
~
~
[
,,
'
1 jkiki
n
i
CAA →
=
=
∫∫
⊆∈Y
j
yy
y
j
j
C
j
j
C
//1
]1,0[)](),([
'
~
~
'
~
~
µµα
α
(
)
()
=
=
=
=
=
∨
∨
)(*
~
)(*
~
)(
)()(
,,
'
"
,
'
~
~
~
~
~
~
1
1
~
~
1
~
~
*
~
j
C
i
A
i
A
n
i
r
k
j
C
r
k
j
C
yxx
yy
jkiki
jkj
µµµ
µµ
(
)
()
=
=
=
=
=
∨
∨
)(*
~
)(*
~
)(
)()(
,,
'
"
,
'
~
~
~
~
~
~
1
1
~
~
1
~
~
*
~
j
C
i
A
i
A
n
i
r
k
j
C
r
k
j
C
yxx
yy
jkiki
jkj
µµµ
µµ
The defuzzification of the interval type-2 fuzzy aggregated
output set
'
~
~
j
C is: )''),((2
ˆ
'
~
~
typeyeidefuzztypy
j
C
j
j
µ
=
where type is the name of the defuzzification technique. If
'
~
~
i
A
are interval type-2 fuzzy singletons then:
=)(
"
,
~
~
j
C
y
jk
µ
=
)]([
,
~
~
1
i
A
n
i
x
ik
µ
)(
,
~
~
j
C
y
jk
µ
=
∫∫
⊆∈Y
j
yy
y
j
jk
C
j
jk
C
//1
]1,0[)](),([
"
,
~
~
"
,
~
~
µµα
α
(
)
)(*
~
)
ˆ
()(
,,
"
,
~
~
~
~
1
~
~
*
~
j
C
i
A
n
i
j
C
yxy
jkikjk
µµµ
=
=
(
)
)(*
~
)
ˆ
()(
,,
"
,
~
~
~
~
1
~
~
*
~
j
C
i
A
n
i
j
C
yxy
jkikjk
µµµ
=
=
=
)(
'
~
~
j
C
y
j
µ
)(
"
,
~
~
1 j
C
r
k
y
jk
µ
=
= [
1
r
k =
)]([
,
~
~
1 i
A
n
i
x
ik
µ
=
)](
,
~
~
j
C
y
jk
µ
=
∫∫
⊆∈Y
j
yy
y
j
j
C
j
j
C
//1
]1,0[)](),([
'
~
~
'
~
~
µµα
α
Engineering Letters, 15:1, EL_15_1_14
______________________________________________________________________________________
(Advance online publication: 15 August 2007)
()
)()(
"
,
'
~
~
1
~
~
j
C
r
k
j
C
yy
jkj
µµ
∨
=
=
=
=
=
∨
)(*
~
)]
ˆ
([
,,
~
~
~
~
1
1
*
~
j
C
i
A
n
i
r
k
yx
jkik
µµ
()
)()(
"
,
'
~
~
1
~
~
j
C
r
k
j
C
yy
jkj
µµ
∨
=
=
=
=
=
∨
)(*
~
)]
ˆ
([
,,
~
~
~
~
1
1
*
~
j
C
i
A
n
i
r
k
yx
jkik
µµ
The next case study shows the command line editing
procedure of the Mamdani interval type-2 fuzzy logic
inference system structure implemented in the IT2FLS
Toolbox.
% ishowery1.m
% Interval type-2 fuzzy inference system for shower control
%
clear all
x1 = -20:2:20;
x2 = -1:0.1:1;
y1 = -1:0.1:1;
y2 = -1:0.1:1;
data = [x1' x2' y1' y2'];
% Define Interval type-2 fuzzy inference system
fis = newfistype2('ctrlshower','mamdani');
% Define input variables and ranges
fis = addvartype2(fis,'input','Temp',[-20 20]);
fis = addvartype2(fis,'input','Flow',[-1 1]);
% Define output variables and ranges
fis = addvartype2(fis,'output','Cold',[-1 1]);
fis = addvartype2(fis,'output','Hot',[-1 1]);
% Define mf’s of first input variable
fis = addmftype2(fis,'input',1,'Cold','itrapatype2',[-31 -31 -16 -
1 -29 -29 -14 1 0.98]);
fis = addmftype2(fis,'input',1,'Good','itritype2',[-11 -1 9 -9 1
11]);
fis = addmftype2(fis,'input',1,'Hot','itrapatype2',[-1 14 29 29 1
16 31 31 0.98]);
% Define mf’s of second input variable
fis = addmftype2(fis,'input',2,'Soft','itrapatype2',[-3.1 -3.1 -0.9
-0.1 -2.9 -2.9 -0.7 0.1 0.98]);
fis = addmftype2(fis,'input',2,'Good','itritype2',[-0.45 -0.05
0.35 -0.35 0.05 0.45]);
fis = addmftype2(fis,'input',2,'Hard','itrapatype2',[-0.1 0.7 2.9
2.9 0.1 0.9 3.1 3.1 0.98]);
% Define mf’s of first output variable
fis = addmftype2(fis,'output',1,'closeFast','itritype2',[-1.05 -
0.65 -0.35 -0.95 -0.55 -0.25]);
fis = addmftype2(fis,'output',1,'closeShow','itritype2',[-0.65 -
0.35 -0.05 -0.55 -0.25 0.05]);
fis = addmftype2(fis,'output',1,'Steady','itritype2',[-0.35 -0.05
0.25 -0.25 0.05 0.35]);
fis = addmftype2(fis,'output',1,'openShow','itritype2',[-0.05
0.25 0.55 0.05 0.35 0.65]);
fis = addmftype2(fis,'output',1,'openFast','itritype2',[0.25 0.55
0.95 0.35 0.65 1.05]);
% Define mf’s of second output variable
fis = addmftype2(fis,'output',2,'closeFast','itritype2',[-1.05 -
0.65 -0.35 -0.95 -0.55 -0.25]);
fis = addmftype2(fis,'output',2,'closeShow','itritype2',[-0.65 -
0.35 -0.05 -0.55 -0.25 0.05]);
fis = addmftype2(fis,'output',2,'Steady','itritype2',[-0.35 -0.05
0.25 -0.25 0.05 0.35]);
fis = addmftype2(fis,'output',2,'openShow','itritype2',[-0.05
0.25 0.55 0.05 0.35 0.65]);
fis = addmftype2(fis,'output',2,'openFast','itritype2',[0.25 0.55
0.95 0.35 0.65 1.05]);
% Define rule table
ruleList=[1 1 4 5 1 1;
1 2 2 4 1 1;
1 3 1 2 1 1;
2 1 4 4 1 1;
2 2 3 3 1 1;
2 3 2 2 1 1;
3 1 5 4 1 1;
3 2 4 2 1 1;
3 3 2 1 1 1];
% Add rule table
fis=addruletype2(fis,ruleList);
% Prints the rules
showrule(fis)
% Visualize input/output linguistic variables
figure;
subplot(4,1,1);plotimftype2(fis,'input',1); grid on
xlabel('Temp');
subplot(4,1,2);plotimftype2(fis,'input',2); grid on
xlabel('Flow');
subplot(4,1,3);plotimftype2(fis,'output',1); grid on
xlabel('Cold');
subplot(4,1,4);plotimftype2(fis,'output',2); grid on
xlabel('Hot');
% Evaluate the Interval type-2 fuzzy inference system
[xx1,xx2] = meshgrid(x1,x2);
input = [xx1(:) xx2(:)];
tic
out = evalifistype2(input,fis);
toc
%
% Visualize surface solutions
figure;
gensurftype2(fis,[1 2],[1])
figure;
gensurftype2(fis,[1 2],[2])
B. Interval Type-2 Takagi-Sugeno-Kang Fuzzy Inference
System.
The IT2FIS de Takagi-Sugeno-Kang system is designed
with n inputs, m outputs and r rules. The kth rule with interval
type-2 fuzzy antecedents
}{
~
~
,
,,
ik
lijk
A
µ
∈ , interval type-1
Engineering Letters, 15:1, EL_15_1_14
______________________________________________________________________________________
(Advance online publication: 15 August 2007)
fuzzy set are used for the consequents sets,
∑
=
⋅+=
n
i
i
k
ji
k
jkj
xf
1
,,0,
θθ
and real facts are inferred as a
direct reasoning [10]:
nn
kmmknkk
k
xisxandandxisxIFH
fisyandandfisyTHENAisxnandandAisxIFR
ˆ
...
ˆ
:
...
~
~
...
~
~
:
11
,,11,1,1
_________________________________________________
mm
yisyandandyisyC
ˆ
...
ˆ
:
11
The evaluation of this reasoning is:
== ],[
k
k
k
α
α
α
)]
ˆ
([
,
~
~
1 i
A
n
i
x
ik
µ
=
()
()
=
==
)
ˆ
(*
~
,)
ˆ
(*
~
,
,
~
~
1
~
~
1
i
A
n
i
i
A
n
i
xx
ik
ik
µµ
where ],[
k
k
k
α
α
α
= is the firing set of the interval type-1
fuzzy antecedent of the kth rule.
∑
=
⋅+=
n
i
i
k
ji
k
jkj
xf
1
,,0,
θθ
where ],[
,,, kj
r
kj
l
kj
fff = is a real function of the interval
consequents of the kth rule. If
],[
,,,,,
k
ji
k
ji
k
ji
k
ji
k
ji
scsc +−=
θ
ni ,...,0=∀ , where
k
ji
c
,
is the center and
k
ji
s
,
denotes the
spread, then
kj
r
kj
l
ff
,,
, is expressed as:
k
j
n
i
i
k
ji
k
j
n
i
i
k
jikj
l
sxscxcf
,0
1
,,0
1
,,
∑∑
==
−⋅−+⋅=
k
j
n
i
i
k
ji
k
j
n
i
i
k
jikj
r
sxscxcf
,0
1
,,0
1
,,
∑∑
==
+⋅++⋅=
With the Karnik and Mendel algorithm [10] the
k
l
α
and
k
r
α
are evaluated to obtain the FIS output variables, these are
expressed as
∑∑
∑∑
∑
∑
+==
+==
=
=
+
⋅+⋅
=
⋅
=
r
Lk
k
L
k
k
r
Lk
kj
l
k
L
k
kj
l
k
r
k
k
l
r
k
kj
l
k
l
l
j
fff
y
11
1
,
1
,
1
1
,
ˆ
αα
αα
α
α
∑∑
∑∑
∑
∑
+==
+==
=
=
+
⋅+⋅
=
⋅
=
r
Rk
k
R
k
k
r
Rk
kj
r
k
R
k
kj
r
k
r
k
k
r
r
k
kj
r
k
r
rl
j
fff
y
11
1
,
1
,
1
1
,
ˆ
αα
αα
α
α
2
ˆˆ
ˆ
r
j
l
j
j
yy
y
+
=
The next case study shows the command line editing
procedure of the Takagi-Sugeno-Kang interval type-2 fuzzy
inference system structure implemented in the IT2FLS
Toolbox.
% ejfistsk22.m
% TKS Interval Type-2 Fuzzy Inference System
% Basic Case Study
clear all
% Define Interval type-2 fuzzy inference system
fis = newfistype2('tks22','sugeno');
% Define first input variables, ranges and mf’s
fis = addvartype2(fis,'input','x1',[0 10]);
fis = addmftype2(fis,'input',1,'F11','igaussmtype2',[1.30 4.85
6.15]);
fis = addmftype2(fis,'input',1,'F12','igaussmtype2',[1.10 3.95
5.05]);
fis = addmftype2(fis,'input',1,'F13','igaussmtype2',[0.80 5.80
6.60]);
% Define second input variables, ranges and mf’s
fis = addvartype2(fis,'input','x2',[0 10]);
fis = addmftype2(fis,'input',2,'F21','igaussmtype2',[1.20 2.40
3.60]);
fis = addmftype2(fis,'input',2,'F22','igaussmtype2',[1.00 5.50
6.50]);
fis = addmftype2(fis,'input',2,'F23','igaussmtype2',[1.50 4.35
5.85]);
% Define first output variables, ranges and mf’s
fis = addvartype2(fis,'output','y1',[0 10]);
fis = addmftype2(fis,'output',1,'G11','linear',[0.0 0.0 6.1396
0.0 0.0 2.6666]);
fis = addmftype2(fis,'output',1,'G12','linear',[0.0 0.0 3.1627
0.0 0.0 2.1417]);
fis = addmftype2(fis,'output',1,'G13','linear',[0.0 0.0 4.7708
0.0 0.0 0.6308]);
% Define second output variables, ranges and mf’s
fis = addvartype2(fis,'output','y2',[0 10]);
fis = addmftype2(fis,'output',2,'G21','linear',[0.0 0.0 7.16645
0.0 0.0 1.83085]);
fis = addmftype2(fis,'output',2,'G22','linear',[0.0 0.0 4.31100
0.0 0.0 4.18390]);
fis = addmftype2(fis,'output',2,'G23','linear',[0.0 0.0 0.90615
0.0 0.0 0.57895]);
% Define rule table
ruleList=[1 1 1 1 1 1;
2 2 2 2 1 1;
3 3 3 3 1 1];
% Add rules to the IT2FIS
fis=addruletype2(fis,ruleList);
% Input Data (X)
X=[4.7 6.0;
6.1 3.9;
2.9 4.2;
7.0 5.5];
% Desired Output Data (D)
D=[3.52 4.02;
5.43 6.23;
4.95 5.76;
4.70 4.28];
% Evaluate interval type-2 fuzzy inference system
out = evalifistype2(X,fis)
% Evaluate error differences
e = D - out;
% Evaluate the root media square root
rmse = sqrt(mse(e))
Engineering Letters, 15:1, EL_15_1_14
______________________________________________________________________________________
(Advance online publication: 15 August 2007)
% Generate solution surfaces
figure;
gensurftype2(fis,[1 2],[1]);
axis([fis.input(1).range(1) fis.input(1).range(2) ...
fis.input(2).range(1),fis.input(2).range(2) ...
fis.output(1).range(1),fis.output(1).range(2)])
xlabel('x1'); ylabel('x2'); zlabel('y1');
figure;
gensurftype2(fis,[1 2],[2]);
axis([fis.input(1).range(1) fis.input(1).range(2) ...
fis.input(2).range(1),fis.input(2).range(2) ...
fis.output(2).range(1),fis.output(2).range(2)])
xlabel('x1'); ylabel('x2'); zlabel('y2');
% Prints the rules
showrule(fis)
IV. RESULTS
The results are a comparative analysis of a Mackey-Glass
chaotic time-series forecasting study using intelligent
cooperative architecture hybrid methods, with neural
networks, (Mamdani, Takagi-Sugeno-Kang) type-1 fuzzy
inference systems and genetic algorithms (neuro-genetic,
fuzzy-genetic and neuro-fuzzy) and an interval type-2 fuzzy
logic model, for the implicit knowledge acquisition in a time
series behavioral data history [23]. Also we present a shower
simulation and a truck backer-upper simulation with interval
type-2 fuzzy logic systems using the IT2FLS Toolbox.
A. Mackey-Glass chaotic time-series
To identify the model we make an exploratory series
analysis with 5 delays, L
5
x(t), 6 periods and 500 training data
values to forecast 500 output values. The IT2FLS system
works with 4 inputs, 2 interval type-2 membership functions
(igbellmtype2) for each input, 16 rules (Fig. 9) and one output
with 16 interval lineal functions, it is evaluated with
unnormalized values. The root mean square error (RMSE)
forecasted is 0.0335 (TABLE II).
0 0.5 1
0
0.5
1
x1
0 0.5 1
0
0.5
1
x2
0 0.5 1
0
0.5
1
x3
0 0.5 1
0
0.5
1
x4
-2 0 2
0
0.5
1
y1
0 0.5 1
0
0.5
1
x1
0 0.5 1
0
0.5
1
x2
0 0.5 1
0
0.5
1
x3
0 0.5 1
0
0.5
1
x4
-2 0 2
0
0.5
1
y1
0 0.5 1
0
0.5
1
x1
0 0.5 1
0
0.5
1
x2
0 0.5 1
0
0.5
1
x3
0 0.5 1
0
0.5
1
x4
-2 0 2
0
0.5
1
y1
0 0.5 1
0
0.5
1
x1
0 0.5 1
0
0.5
1
x2
0 0.5 1
0
0.5
1
x3
0 0.5 1
0
0.5
1
x4
-2 0 2
0
0.5
1
y1
Fig. 9. IT2FLS (TSK) First Four Rules.
TABLE II
Forecasting of Time Series.
Mackey-Glass
Methods
RMS
E
trn/chk epoch cpu(s)
*
NNFF
**
†
0.0595 500/500 200 13.36
CANFIS
0.0016 500/500 50 7.34
NNFF-GA†
0.0236 500/500 150 98.23
FLS(TKS)-GA†
0.0647 500/500 200 112.01
FLS(MAM)-GA†
0.0693 500/500 200 123.21
IT2FLS
0.0335 500/500 6 20.23
* POWER BOOK G4 1.5 Ghz / 512 MB RAM
** Architecture: x-13-1 † 30 samples average
B. Shower Control Simulation.
In figure 10 it shows an interval type-2 fuzzy control scheme
and in figures 11 and 12 the control answers.
temp
se tp o i n t
temp
scope
temp
error
f(u)
temp
hot water
valve
f(u)
flow rate
flow
setpoint
flow
sco p e
flow
error
MATLAB
Fun cti o n
evalifistype2
cold water
valve
out
T o Wo rksp a ce 1
in
T o Wo rksp a ce
Mux
Mux5
Mux
Mux4
Mux
Mux3
Mux
Mux2
Demux
Demux
Fig. 10. Simulink interval type-2 fuzzy control scheme.
Fig. 11. Temperature interval type-2 fuzzy control.
Engineering Letters, 15:1, EL_15_1_14
______________________________________________________________________________________
(Advance online publication: 15 August 2007)
Fig. 12. Interval type-2 fuzzy control flow.
C. Truck backer-upper control simulation.
In figure 13 have the interval type-2 fuzzy control scheme
and in figure 14-17 the control answers of the car made
trajectories.
u[2]<0
y<=0
Mux
Mux
states &
theta
MATLAB
Function
evalifistype2
Truck
Kinematics
Switch
STOP
Stop
si m u l a ti o n
Variable Initialization
f(u)
Distance
MATLAB
Function
Cont ro l l er 2
MATLAB
Function
Cont ro l l er 1
1
Constant
animtbux
Animation &
Human Controller
Fig. 13. Simulink interval type-2 fuzzy control scheme.
Fig. 14. Trajectory 1 Interval type-2 fuzzy control.
Fig. 15. Trajectory 2 interval type-2 fuzzy control.
Fig. 16. Interval type-2 fuzzy control trajectory 3.
Fig. 17. Interval type-2 fuzzy control trajectory 4.
V. CONCLUSIONS
The time series results show that intelligent hybrid methods
and interval type-2 fuzzy models can be derived as a
generalization of the autoregressive non-lineal models in the
context of time series. This derivation permits a practical
specification for a general class of prognosis and identification
time series model, where a set of input-output variables are
part of the dynamics of the time series knowledge base.
This helps the application of the methodology to a series of
diverse dynamics, with a very low quantity of causal variables
to explain behavior. In consequence we can obtain models
Engineering Letters, 15:1, EL_15_1_14
______________________________________________________________________________________
(Advance online publication: 15 August 2007)
with a lower number of rules, therefore a lower number of
parameters than those obtained on the derivation of traditional
methods like Box-Jenkins. The interpretation as a temporal
series model, also enables the use of statistical tools in the
variable selection process, in the diagnostic and meta-
diagnostic models, thus enriches the individual artificial
intelligence methodologies when applied to this type of
problems. The proposed approximation methodology not only
gives information in numeric precision terms about de
prognosis capability, but also permits a detailed analysis of the
model quality.
The results in the interval type-2 fuzzy control case studies
of the shower and truck backer-upper have similar results to
the type-1 fuzzy control with moderate uncertain footprints.
To better characterize the interval type-2 fuzzy models we
need to generate more case studies with better knowledge
bases for the proposed problems, therefore classify the
interval type-2 fuzzy model application strengths.
The design and implementation done in the IT2FLS
Toolbox is potentially important for research in the interval
type-2 fuzzy logic area, thus solving complex problems on the
different applied areas.
Our future work is to improve the IT2FLS Toolbox with a
better graphics user interface (GUI), to have compiled code,
and integrate a learning technique Toolbox to optimize the
knowledge base parameters of the interval type-2 fuzzy
inference system, and design interval type-2 fuzzy neural
network hybrid models.
R
EFERENCES
[1] Zadeh, L.A., “Fuzzy sets,” Information and Control, Vol. 8, pp. 338-
353, 1965.
[2] Zadeh, L.A., “Outline of a new approach to the analysis of complex
systems and decision processes,” IEEE Transactions on Systems, Man,
and Cybernetics, Vol. 3, No. 1, pp. 28-44, Jan. 1973.
[3] Zadeh, L.A., “The concept of a linguistic variable and its application to
approximate reasoning, Parts 1, 2, and 3,” Information Sciences, 1975,
8:199-249, 8:301-357, 9:43-80.
[4] Zadeh, L.A., “Fuzzy Logic,” Computer, Vol. 1, No. 4, pp. 83-93, 1988.
[5] Zadeh, L.A., “Knowledge representation in fuzzy logic,” IEEE
Transactions on Knowledge and Data Engineering, Vol. 1, pp. 89-100,
1989.
[6] Karnik, N.N. and J.M. Mendel. An Introduction to Type-2 Fuzzy Logic
Systems, Univ. of Southern Calif., Los Angeles, CA., June 1998b.
[7] L. Zadeh, “Fuzzy logic = computing with words,” IEEE Transactions on
Fuzzy Systems, vol. 2, pp. 103–111, 1996.
[8] Q. Liang and J. Mendel, “Interval type-2 fuzzy logic systems: Theory
and design,” IEEE Transactions Fuzzy Systems, vol. 8, pp. 535–550,
2000.
[9] Dubois, D. and H. Prade, Fuzzy Sets and Systems: Theory and
Applications, Academic Press, New York, 1980.
[10] J. Mendel, Uncertain Rule-Based Fuzzy Logic Systems: Introduction and
New Directions. NJ: Prentice-Hall, 2001.
[11] Mizumoto, M. and K. Tanaka, “Some Properties of Fuzzy Sets of Type-
2,” Information and Control, vol. 31, pp. 312-340, 1976.
[12] Wang, L.-X., Adaptive fuzzy systems and control: design and stability
analysis, Prentice Hall, 1994.
[13] Yager, R. R., “On the Implication Operator in Fuzzy logic,” Information
Sciences, vol. 31, pp. 141-164, 1983.
[14] Yager, R.R., “A Caracterization of the Fuzzy Extension Principle,” J.
Fuzzy Sets and Systems, vol. 18, pp. 205-217, 1986.
[15] Mamdani, E.H. and S. Assilian, “An experiment in linguistic synthesis
with a fuzzy logic controller,” International Journal of Man-Machine
Studies, Vol. 7, No. 1, pp. 1-13, 1975.
[16] Mamdani, E.H., “Applications of fuzzy logic to approximate reasoning
using linguistic synthesis,” IEEE Transactions on Computers, Vol. 26,
No. 12, pp. 1182-1191, 1977.
[17] M. Sugeno and G. T. Kang. Structure identification of fuzzy model.
Fuzzy Sets and Systems, 28:15-33, 1988.
[18] Sugeno, M., Industrial applications of fuzzy control, Elsevier Science
Pub. Co., 1985.
[19] Y. Tsukamoto. An approach to fuzzy reasoning method. In Madan M.
Gupta, Rammohan K. Ragade, and Ronald R. Yager, editors, Advances
in fuzzy set theory and applications, pages 137-149. North-Holland,
Amsterdam, 1979.
[20] Yager, R., “On a general class of fuzzy connectives,” Fuzzy Sets and
Systems, 4:235-242, 1980.
[21] Mamdani, E.H., “Advances in the linguistic synthesis of fuzzy
controllers,” International Journal of Man-Machine Studies, Vol. 8, pp.
669-678, 1976.
[22] T. Takagi and M. Sugeno. Fuzzy identification of systems and its
applications to modeling and control. IEEE Transactions on Systems,
Man, and Cybernetics, 15:116-132, 1985.
[23] Juan R. Castro. Hybrid Intelligent Architecture Development for Time
Series Forecasting. Masters Degree Thesis. Tijuana Institute of
Technology. December 2005.
Oscar Castillo is a Professor of Computer Science in the Graduate Division,
Tijuana Institute of Technology, Tijuana, Mexico. In addition, he is serving as
Research Director of Computer Science and head of the research group on
fuzzy logic and genetic algorithms. Currently, he is President of HAFSA
(Hispanic American Fuzzy Systems Association) and Vice-President of IFSA
(International Fuzzy Systems Association) in charge of publicity. Prof.
Castillo is also Vice-Chair of the Mexican Chapter of the Computational
Intelligence Society (IEEE). Prof. Castillo is also General Chair of the IFSA
2007 World Congress to be held in Cancun, Mexico. He also belongs to the
Technical Committee on Fuzzy Systems of IEEE and to the Task Force on
“Extensions to Type-1 Fuzzy Systems”. His research interests are in Type-2
Fuzzy Logic, Intuitionistic Fuzzy Logic, Fuzzy Control, Neuro-Fuzzy and
Genetic-Fuzzy hybrid approaches. He has published over 50 journal papers, 5
authored books, 10 edited books, and 160 papers in conference proceedings.
Juan R. Castro is a graduate in Computer Science (2005) from the Division
of Graduate Studies and Research in Tijuana Institute of Technology, Mexico.
He is a Professor in Baja California Autonomous University since 1987,
teaches for the Computer Engineering Program since 1991 and currently a
student of Science and Engineering with the Division of Graduate Studies and
Research in Baja California Autonomous University, Mexico. His present
research interests include: hybrid intelligent systems, encompassing neural
networks, type-1 fuzzy logic systems, type-2 fuzzy logic systems, genetic
algorithms and their applications to a wide range of problems.
Luis G. Martínez received his Masters Degree in Computer Engineering
(2006) with the Division of Graduate Studies and Research in Baja California
Autonomous University, Mexico. He is a Professor in the same University
since 1988, teaches for the Computer Engineering Program since 1991. His
present research interests include: software engineering, software process
methodology, personal software process and fuzzy logic systems.
Engineering Letters, 15:1, EL_15_1_14
______________________________________________________________________________________
(Advance online publication: 15 August 2007)