See
the FuzzyJ Toolkit documentation ... chapter on Fuzzy Sets. Note that recently a
CenterOfArea defuzzification
was
also added.
To
supplement the documentation I should note that the 'moment' calculation for
each of the shapes that
might
make up the pieces of a fuzzy set are:
Given:
x1, x2 are the left and right x values of the shape
y1, y2 are the
membership (y) values of the left and right edges of the
shape
/* rectangle of zero height or
zero width? */
moment is 0
moment is 0
area is 0
/* rectangle
*/
moment is 0.5 * (x1 + x2)
moment is 0.5 * (x1 + x2)
area
is ( x2 - x1 ) * y1;
/* triangle, where height is y2
*/
moment is (2.0/3.0) * ( x2 - x1 ) + x1;
area is 0.5 * ( x2 - x1 ) * y2;
moment is (2.0/3.0) * ( x2 - x1 ) + x1;
area is 0.5 * ( x2 - x1 ) * y2;
/* triangle, where height is y1
*/
moment is (1.0/3.0) * ( x2 - x1 ) + x1;
area is 0.5 * (x2 - x1 ) * y1;
moment is (1.0/3.0) * ( x2 - x1 ) + x1;
area is 0.5 * (x2 - x1 ) * y1;
/* trapezoid
*/
moment is ( (2.0/3.0) * (x2-x1) * (y2+0.5*y1))/(y1+y2) + x1;
area is 0.5 * ( x2 - x1 ) * ( y1 + y2 );
moment is ( (2.0/3.0) * (x2-x1) * (y2+0.5*y1))/(y1+y2) + x1;
area is 0.5 * ( x2 - x1 ) * ( y1 + y2 );
Bob Orchard
National Research Council
Canada Conseil national de recherches
Canada
Institute for Information
Technology Institut de technologie de l'information
1200 Montreal Road, Building
M-50 M50, 1200 chemin Montréal
Ottawa, ON, Canada K1A
0R6 Ottawa
(Ontario) Canada K1A 0R6
(613)
993-8557
(613) 952-0215 Fax /
télécopieur
[EMAIL PROTECTED]
Government of Canada | Gouvernement du Canada
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of yuping he
Sent: Monday, June 26, 2006 7:47 PM
To: [email protected]
Subject: JESS: FuzzyJess formular for local centre of gravityDr. Friedman-Hill:I am trying to test Fuzzy Jess inside my rules and had one question - what is the formular to calculate the local centre of gravity?Thanks.Yuping****************************************************************************************************************************************momentDefuzzify
Moment defuzzification defuzzifies the FuzzySet of the FuzzyValue returning a floating point (double value) that represents the fuzzy set. It calculates the first moment of the area of a fuzzy set about the y axis. The set is subdivided into different shapes by partitioning vertically at each point in the set, resulting in rectangles, triangles, and trapezoids. The centre of gravity (moment) and area of each subdivision is calculated using the appropriate formulas for each shape. The first moment of area of the whole set is then:
where xi´ is the local centre of gravity, A i is the local area of the shape underneath line segment (pi-1, pi), and n is the total number of points. As an example,![]()
For each shaded subsection in the diagram above, the area and centre of gravity is calculated according to the shape identified (i.e., triangle, rectangle or trapezoid). The centre of gravity of the whole set is then determined:
