On Wed, Mar 11, 2009 at 3:14 PM, Raul Miller <[email protected]> wrote: > On Wed, Mar 11, 2009 at 1:30 PM, Brian Schott <[email protected]> wrote: >> This is sort of a puzzle for which I have a solution >> but have unsuccessfully puzzled over an alternative solution >> and wonder if anyone would like to solve the "puzzle" of >> finding how to find the same result but using I. instead of >> @. . >> >> My existing solution for the variable trap is as >> follows. > > I am lost here. > >> aa =: {...@] >> dd =: {:@] >> bb =: 1&{...@] >> cc =: _2&{...@] > > aa bb cc and dd are four points on a trapazoid which is the right arg? > > In other words: > aa=: 0&{...@] > bb=: 1&{...@] > cc=: 2&{...@] > dd=: 3&{...@]
Yes, you have interpretted aa ... dd correctly. > > >> ls =: leftsupp =:(([-aa)%bb-aa) >> rs =: rightsupp =:((dd-[)%dd-cc) >> co =: core =: 1: >> ns =: nonsupport =: 0: Fuzzy sets are sets for which a numeric membership in the interval [0,1] defines the degree to which an element is part of the fuzzy set. If the elements are the real numbers, say X, then we say that a membership function defines the degree of membership of each real number in the fuzzy set of interest. I will us the following notation to indicate the membership function of the fuzzy set A: mu_A or mu_A(22)=0.7 states that the membership of the number 22 in the fuzzy set A is 0.7. The example might be taken from the more general statement that mu_A: X-->[0,1]. If a fuzzy membership mu_A is defined over the real numbers, say X, then it is common to refer to all of the real numbers which have mu_A > 0 as the support of A and all of the real numbers which have mu_A=1 as the core of A. > > Presumably ls means left support and rs means right > support, but what is a support? What does scaling > supports by the distance between to points help? > Also, what's "core" mean? > >> ge =: +/"1@(>:/) >> le =: 4: - +/&.|."1@(<:/) >> ag =: ge`2:@. (2: <: ge - le) > > ge means greater or equal? Presumably using > sum because you have scaled things appropriately > for your concept of fuzziness? And le means > less or equal? 4 seems to come from your > list of gerunds... > The graphic below must be viewed in a nonproportional spaced font. ___ / \ / \ _ _ nllcccrrn NB. read this row and sssooosss NB. this row vertically Yes, yes, and yes to above guesses. > Does ag mean 2 <. ge - le? > >> trap =: (ns`ls`co`rs`ns) @. ag > >> An example of using trap is as follows. >> >> x:1|:((],:3&+)i. 15) (([,trap)"0 1)/_4]\0 5 10 14 2 6 10 14.5 > ... > >> Notice that all of the outputs of trap are between 0 >> and 1 and they are expressed as proper fractions in the >> example, but that is only for prettying up the readout here. >> >> If you load 'plot', execute the next line, and watch >> carefully, you will see why these are called trapezoids. >> >> plot"1 |: ,./;"1/ x:1|:((],:3&+)i. 15) (([,trap)"0 1)/_4]\0 5 10 14 2 6 10 >> 14.5 > > I see that you have a range of potential values which I guess essentially > say "how close is x to the thing on the right". But I do not know the > data well enough to even begin to understand this one. > > Clarification please? For example, 0 5 10 14 are the x values that correspond to the four corners of the first trapezoid. The left support goes from 0 to 5, the right support goes from 10 to 14 and the core goes from 5 to 10. Similarly for the second set of four numbers: 2 6 10 14.5 are the four corners of a second trapezoidal membership function, etc. > > Thanks, > > -- > Raul Thank YOU. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
