60 likes | 174 Views
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 Comerma 1 , Juan Carlos García 2 , and Joan Armengol 1
E N D
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: rafamarce@ub.edu April 2004
WINTER WINTER SPRING SPRING SUMMER SUMMER FALL FALL The result will always be ‘one’ for a season and ‘zero’ for the rest March 7th Winter = 1 WINTER SPRING SUMMER FALL 1 In fuzzy logic, the truth of any statement becomes a matter of degree. Fuzzy logic Probability In fuzzy logic the function can take any shape. The gaussian curve is a common choice... 0 Time (day of the year) March 7th Winter = 0.8 Spring = 0.2 What is fuzzy logic? 1 Binary logic Probability 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... 0 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 inputFLOW MFs in input TIME Residual Mean Square Error 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.
LOW MODERATE EARLY ON LATER ON 1 1 Probability Probability HIGH 0 0 0 10 0 10 Flow Time 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. Rule 1 If FLOW is LOWand TIME is EARLY ONthen CONCENTRATION is C1 Rule 2 If FLOW is LOWand TIME is LATER ONthen CONCENTRATION is C2 Rule 3 If FLOW is MODERATE and TIME is EARLY ONthen CONCENTRATION is C3 Rule 4 If FLOW is MODERATEand TIME is LATER ONthen CONCENTRATION is C4 Rule 5 If FLOW is HIGHand TIME is EARLY ON then CONCENTRATION is C5 Rule 6 If FLOW is HIGHand TIME is LATER ON then CONCENTRATION is C6 Just for convenience, we rename the different input MFs with intuitive linguistic labels, such High or Early on. 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: Remember that a gaussian curve can be defined with two parameters. We give a graphical representation for clarity. C1 = 16.23 C2 = 18.56 C3 = 10.58 C4 = 16.13 C5 = 6.59 C6 = 10.60
Now the Fuzzy Inference System is finished. The following slide is a numerical example showing how an output is calculated from an input.
Logical operations p = 0.4 X = 0 p = 0 p = 0 1 1 1 1 1 X = 0 Probability Probability p = 0 p = 0 p = 0 1 1 1 0 0 0 0 0 MIN = AND The second step is to combine the probabilities on the premise part to get the weight (or probability) of each rule. It is demonstrable that applying the and logical operator is equivalent to solve for the minimum value of the intersection of the MFs p = 0.4 X = 1.058 p= 0.1 0 0 0 p = 0.1 1.058 + 2.636 0.1 + 0.4 0 X = p = 0 p = 0.1 p = 0 p = 0.75 p = 0.4 2.636 X = p= 0.4 p = 0.75 0 X = p = 0 7.388 OUTPUT CONCENTRATION VALUE p = 0 8 2.5 INPUT VALUE for FLOW INPUT VALUE for TIME 1 16.23 0 Rule 1 If FLOW is LOWand TIME is EARLY ONthen CONCENTRATION is C1 Rule 2 If FLOW is LOWand TIME is LATER ONthen CONCENTRATION is C2 Rule 3 If FLOW is MODERATE and TIME is EARLY ONthen CONCENTRATION is C3 Rule 4 If FLOW is MODERATEand TIME is LATER ONthen CONCENTRATION is C4 Rule 5 If FLOW is HIGHand TIME is EARLY ON then CONCENTRATION is C5 1 18.56 0 1 1 Probability 10.58 0 Given an input, the first step to solve the FIS is the fuzzyfication of inputs, i.e. to obtain the probability of each linguistic value in each rule. 0 The six rules governing the Fuzzy Inference System are represented with a graphical representation of the MFs that apply in each rule. The last step is the defuzzyfication procedure, when the consequents are aggregated (weighted mean) to obtain a crisp output The third step is to calculate the consequent of each rule depending on their weight (or probability) 1 1 16.13 Probability 0 0 1 1 Probability 6.59 0 0 1 1 Probability 10.60 0 0 10 0 10 0 Rule 6 If FLOW is HIGHand TIME is LATER ON then CONCENTRATION is C6