<quote author="Brian Schott">
This line looks suspicious to me because #y is always an integer
already, and <. seems to do nothing.

nbins=. 1 Round (<.#y)^0.5

The following result also looks suspicious because the sum of the
result is only 19, not 20.

   discretize i. 20
1 4 5 5 4
</quote>

Good eyes; thank you. The <. should have been outside the parens, making 
"Round" unnecessary. It was probably like that at some point; I've been working 
on this in the odd moments.
The other problem, I noticed last night. It seems to be fixed by making
binner =. min+width * i.(1+x)
Though I may fiddle with the histogram verb in the meanwhile.

<quote author="Henry Rich">
entropy =: +/@:(* ^.) (^.@] - %) +/ 
or
entropy =: -@(+/)@:(* ^.)@(% +/) 
</quote>

Hot dog! Thank you!
Puzzing this out a bit, the second one makes more sense to me. I can stick 
parens and y's in and see what makes it tick. Somehow the fork and the @: in 
the first one confuses me on initial inspection (@ seems to work OK too). As I 
learn more about forks, perhaps I will feel better about things like this.

mmdow was easy: 
mmdow=: entropy + (_1 + #) % 2 * +/

Thanks again fellows! I'll drop another note in this thread when the script is 
done enough to share.         

-Scott
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to