Subject: Re: Centroide for fuzzy expertsystem
From: Jonathan G. Campbell (jg.campbell@qub.ac.uk)
Date: Tue May 30 2000  12:39:12 MET DST
Lars Hansen wrote:
>
> Dear all,
> I'm a student doing my master (Geography and Computer Science). I'm making a
> fuzzy expert system for a Geographic Information System called Arc View. The
> idea is to let the user put as many tumbrules he knows into the system and
> then come out with a crisp output, that for example says: this farm leaches
> 25 kg N pr. Hectare.
>
> But I'm not a mathematician and I'm having trouble with an algoritm for
> Centroid defuzzyfication.
>
> If anybody has som code they could show me, that takes the centroid from a
> number of output sets created with MINinferencing and MAXcomposition, I
> would appreciate it.
>
> My output  set look something like this:
>
> * *
> * ***** * *
> * **** * * * *
> * * * * *
> * * * * * * *
> **********************************
>
> Lars Hansen
m(y) 

 *
m(y3)+ *** * *
 * ** *
+**
y1 y5 y12
Just to explain centroid, using an example not unlike your's and
assuming a discrete universe for the output let the union of consequent
sets be as in the figure; i.e. m(y1)=0, m(y3)=m(y4) = m(y5) = ... then
the centroid is
y^ = (sum m(yi).yi)/sum m(yi)
which, if the m(yi) were masses on a beam, would the point at which the
beam would balance  centre of mass.
If y is continuous (likely), the sum is integral; in that case, I'd
advise a visit to T.Masters, Practical Neural Network Recipes in C++,
Academic Press (??), 1993 which shows that the integral can be
simplified if the m(y) is composed of a sequence of trapezoids. Masters
gives C++ code which could be translated to any language.
If m(y) is not a sequence of trapezoids, then you may have to resort to
some numerical integration technique; a quick and dirty technique would
be to sample m(y) at closely spaced yi, and use the summation above. But
you would need to be able to identify a finite support for m(y) (i.e.
where m(y) /= 0).
Contact me directly if you need further help.
Hope this helps,
Jon C.
 Jonathan G. Campbell, School of Computer Science, The Queen's University of Belfast, BT7 1NN Tel +44 (0)28 90 274623 jg.campbell@qub.ac.uk http://www.cs.qub.ac.uk/~J.Campbell Physical office: Room G26, Bernard Crossland Building, 18 Malone Road.############################################################################ This message was posted through the fuzzy mailing list. (1) To subscribe to this mailing list, send a message body of "SUB FUZZYMAIL myFirstName mySurname" to listproc@dbai.tuwien.ac.at (2) To unsubscribe from this mailing list, send a message body of "UNSUB FUZZYMAIL" or "UNSUB FUZZYMAIL yoursubscription@email.address.com" to listproc@dbai.tuwien.ac.at (3) To reach the human who maintains the list, send mail to fuzzyowner@dbai.tuwien.ac.at (4) WWW access and other information on Fuzzy Sets and Logic see http://www.dbai.tuwien.ac.at/ftp/mlowner/fuzzymail.info (5) WWW archive: http://www.dbai.tuwien.ac.at/marchives/fuzzymail/index.html
This archive was generated by hypermail 2b25 : Tue May 30 2000  12:41:01 MET DST