Numerical Example
Download
Report
Transcript Numerical Example
NUMERICAL EXAMPLE
APPENDIX A
in
“A neuro-fuzzy modeling tool to estimate fluvial nutrient loads in watersheds
under time-varying human impact”
Rafael Marcé1*, Marta Comerma1, Juan Carlos García2,
and Joan Armengol1
1Department
of Ecology, University of Barcelona, Diagonal 645, 08028 Barcelona, Spain
2Aigües
Ter Llobregat, Sant Martí de l'Erm 30, 08970 Sant Joan Despí, Spain
*E-mail: [email protected]
April 2004
What is fuzzy logic?
Binary logic
In binary logic the function that
relates the value of a variable
with the probability of a judged
statement are a ‘rectangular’
one. Taking the seasons as an
example...
Probability
WINTER SPRING SUMMER
FALL
1
The result will always
be ‘one’ for a season
and ‘zero’ for the rest
0
March 7th
Winter = 1
WINTER
Time (day of the year)
SPRING
SUMMER
FALL
Fuzzy logic
In fuzzy logic the function
can take any shape. The
gaussian curve is a common
choice...
Probability
1
In fuzzy logic, the truth of
any statement becomes a
matter of degree.
0
March 7th
Winter = 0.8
Spring = 0.2
Time (day of the year)
Fuzzy reasoning with ANFIS
Given an available field database, we define an input-output problem. In this case, the nutrient
concentration in a river (output) predicted from daily flow and time (inputs).
The first step is to solve the structure identification. We apply the trial-and-error procedure
explained in the text with different number of MFs in each input. Suppose that the results were as
follows:
MFs in input FLOW
Error
MFs in input TIME
Residual Mean Square
1
1
7.52
1
2
5.36
2
1
5.21
2
2
2.95
3
2
2.05
2
3
2.35
3
3
2.04
4
4
2.01
5
5
1.99
This option is
considered the
optimum trade-off
between number of
MFs and fit.
Fuzzy reasoning with ANFIS
Then, the structure identification is automatically solved generating a set of 6 if-and-then rules, i.e. a
rule for each possible combination of input MFs. For each rule, an output MF (in this case a constant,
because we work with zero-order Sugeno-type FIS) is also generated.
and TIME is EARLY ON then CONCENTRATION is C1 Just for
If FLOW is LOW
and TIME is LATER ON then CONCENTRATION is C2 convenience,
we rename the
If FLOW is MODERATE and TIME is EARLY ON then CONCENTRATION is C3 different input
If FLOW is MODERATE and TIME is LATER ON then CONCENTRATION is C4 MFs with
intuitive
If FLOW is HIGH
and TIME is EARLY ON then CONCENTRATION is C5 linguistic
If FLOW is HIGH
and TIME is LATER ON then CONCENTRATION is C6 labels, such
High or Early
on.
Rule 1
If FLOW is LOW
Rule 2
Rule 3
Rule 4
Rule 5
Rule 6
The next step is to draw the MFs in each input space, an also to assign a value for each output
constant. This is the parameter estimation step, which is solved by the Hybrid Learning Algorithm
using the available database. Suppose that the algorithm gives the following results:
LOW
MODERATE
HIGH
EARLY ON
1
LATER ON
1
0
C3 =
10.58
0
0
10
Flow
C1 =
16.23
C2 =
18.56
Probability
Probability
Remember that
a gaussian
curve can be
defined with
two parameters.
We give a
graphical
representation
for clarity.
0
10
Time
C4 =
16.13
C5 =
Now the Fuzzy Inference System is finished.
The following slide is a numerical example showing
how an output is calculated from an input.
Probability
1
Probability
If FLOW is LOW
1
Probability
p=0
p=0
X
18.56
2
and TIME is LATER ON then CONCENTRATION is C
The
second step is to combine the
p = 0.4
probabilities
on the premise
part to= get
p= 0.1 X 10.58
1.058
p = 0.1
the weight (or probability) of each rule.
anis EARLY
input,
the
step
toFuzzy
FLOW is MODERATEGiven
and
TIME
ON governing
then first
CONCENTRATION
issolve
C
The
six
rules
the
last
step
is
the
defuzzyfication
It is demonstrable
The
third step that
is1 toapplying
calculatethe
theand
1
the
FIS
is
the
fuzzyfication
of
inputs,
i.e.a
Inference
System
are
represented
with
procedure,
when
the
consequents
are
p=0 X
operator
is equivalent
to solve
consequent
of each
rule
depending
16.13
p = 0.1 logical
= 0on
p=0
to
obtain
the
probability
of
each
graphical
of the
MFs
thata
0
aggregated
(weighted
mean)
obtain
0 probability)
for
therepresentation
minimum
value
oftothe
their
weight
(or
value
in each
rule.
FLOW is MODERATE and linguistic
TIME is LATER
ON
theneach
CONCENTRATION
is C
apply
in
rule.
crisp
output
intersection
of
the
MFs
p = 0.75
If FLOW is LOW
Rule 3
If
1
0
Rule 4
If
1
1
1
0
0
3
1
1
p= 0.4 X
MIN = AND
0
0
1
If FLOW is HIGH
p = 0.75
0
10
If FLOW is HIGH
8
= 2.636
and TIME is EARLY ON then CONCENTRATION is C5
1
1
p=0
0
0
6.59
0
p=0
INPUT VALUE for FLOW
1.058 + 2.636
0.1 + 0.4
4
p = 0.4
Rule 5
= 0
0
0
1
= 0
1
1
0
Probability
16.23
and TIME is EARLY ON then CONCENTRATION is C1
p=0
Rule 2
X
0
0
0
Probability
p=0
p=0
Rule 1
Probability
1
p = 0.4
0
Rule 6
Logical operations
1
X
10.60
= 0
7.388
0
0
10
and TIME is LATER ON then CONCENTRATION is C6
2.5
INPUT VALUE for TIME
OUTPUT CONCENTRATION
VALUE