-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
"Raul Miller" <[EMAIL PROTECTED]> writes:
> This must be because of the definition of median,
> which you did not supply. I suppose I could look up
I realized you needed that after I stepped away. Here 'tis:
midindices=: (<.,>.)@-:@<:@#
median=:[: am midindices { sort
is what I should have included.
> jsp.ijs and see if I could figure out which definition you
> were using, but instead I will supply one which probably
> is different from yours:
> mean=:+/%#
> median=: mean@({~ (<.,>.)@-:@<:@#)@/:~
The two solutions look close.
With yours, I unfortunately get
median=: mean@({~ (<.,>.)@-:@<:@#)@/:~ NB. Raul Miller 2008-06-04 email
Q2=: median
Q1=: [: Q2 ] #~ Q2 > ]
Q3=: [: Q2 ] #~ Q2 < ]
$ Q3 each <"1 |: a
100
$ Q1 each <"1 |: a
|index error: median
| $ Q1 each<"1|:a
$ a is 17 100.
I'll likely try again tomorrow. Any tips are welcome, though.
Thanks,
Bill
- --
Bill Harris http://facilitatedsystems.com/weblog/
Facilitated Systems Everett, WA 98208 USA
http://facilitatedsystems.com/ phone: +1 425 337-5541
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: For more information, see http://www.gnupg.org
iD8DBQFIR2hl3J3HaQTDvd8RAm2mAJ9cm/1nMqvpuhl9ED/gNnlKRhtGswCfV5oV
BE9sr5xe3qEft2FeCbY9NyY=
=CNs1
-----END PGP SIGNATURE-----
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm