I always wondered how you choose the test when you want to time two functions.
Changing the two argument independently can have a big difference in how the
results will look. Are there any guidelines or rules for designing tests?
l=: 13 :'(i.<.-:#y){/:~y'
r=: 13 :'(i.<.-:#y){|./:~y'
me=: 13 :'-:+/((<.,>.)-:<:#y){/:~y'
load 'stats'
jtfns=: (1,<.@-:,],-@<.@-:,_1:)@# median@:{."0 1 /:~
N=:?100000#10000
f=: 13 :'(<./y),(me l y),(me y),(me r y),>./y'
f N
0 2487 4976 7496 9999
jtfns N
0 2487 4976 7496 9999
ts=: 6!:2, 7!:2
ts 'f N'
0.00915288 1.04947e6
ts 'jtfns N'
0.0061838 2.1639e6
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Kip Murray
Sent: Wednesday, May 07, 2014 3:35 AM
To: [email protected]
Subject: Re: [Jprogramming] Five Number Summary
The mean and standard deviation are good descriptions of data from a nearly
normal distribution, the five number summary is better for data from a
skewed or fat-tails distribution.
Moore and McCabe in Section 1.2 of Introduction to the Practice of
Statistics say
"The five-number summary is usually better than the mean and standard
deviation for describing a skewed distribution or a distribution with
strong outliers. Use x-bar and s only for reasonably symmetric
distributions that are free of outliers."
On Wednesday, May 7, 2014, 'Bo Jacoby' via Programming <
[email protected]> wrote:
> What is the use of the Five Number Summary? If there are only a few
> numbers, just list them. If there are plenty of numbers then the minimum
> number and maximum number give little information. The better way of
> summarizing a lot of numbers is to provide the mean value and the standard
> deviation, I think.
> M=.+/%# NB. Mean value
> R=.M&.:*: NB. Root mean square
> D=.-M NB. Deviation from mean
> S=.R@D NB. Standard deviation
> A=.M,.S NB. Arithmetic mean and standard deviation
> G=.A&.:^. NB. Geometric mean and standard deviation
> Thanks. Bo.
>
>
> Den 8:18 onsdag den 7. maj 2014 skrev Linda Alvord <
> [email protected] <javascript:;>>:
>
> Hopefully this will be more readable. I tried to write something that high
> >school students could understand:
> >
> >A=:6 9 3 1
> > B=:6 9 3 1 4
> > l=: 13 :'(i.<.-:#y){/:~y'
> > r=: 13 :'(i.<.-:#y){|./:~y'
> >
> > me=: 13 :'-:+/((<.,>.)-:<:#y){/:~y'
> >
> > (<./;([:me l);me;([: me r);>./)A
> >--T-T---T---T-┐
> >│1│2│4.5│7.5│9│
> >L-+-+---+---+--
> >
> > (<./;([:me l);me;([: me r);>./)B
> >--T-T-T---T-┐
> >│1│2│4│7.5│9│
> >L-+-+-+---+--
> >
> >Now I'll look at your other answers and see if I can simplify it even
> more.
> >
> >Linda
> >
> >-----Original Message-----
> >From: [email protected]
> >[mailto:[email protected]] On Behalf Of Linda
> Alvord
> >Sent: Tuesday, May 06, 2014 5:39 PM
> >To: [email protected]
> >Subject: Re: [Jprogramming] Five Number Summary
> >
> >Kip, I get the same result as Raul. No need to load 'stats'. My new mean
> >does not include @ .
> >
> >
> >
> >l=: 13 :'(i.<.-:#y){y'
> >r=: 13 :'|.(i.<.-:#y){|.y'
> >
> >me=: 13 :'-:+/((<.,>.)-:<:#y){/:~y'
> >(<./;([:me l);me;([: me r);>./)1 2 2 4 6
> >--T---T-T-T-┐
> >│1│1.5│2│5│6│
> >L-+---+-+-+--
> >
> >I'm happy because the definition is all forks.
> >
> >5!:4 <'me'
> >-- [:
> >+- -:
> >│ -- [:
> >│ +- / --- +
> >--+ │ -- [:
> >│ │ │ -- <.
> >│ │ +----+- ,
> >L----+ │ L- >.
> >│ ------+
> >│ │ │ -- [:
> >│ │ │ +- -:
> >│ │ L----+ -- [:
> >L-----+ L----+- <:
> >│ L- #
> >+- {
> >L- ~ --- /:
> >
> >
> >It looks better in J !
> >
> >Linda
> >
> >-----Original Message-----
> >From: [email protected]
> >[mailto:[email protected]] On Behalf Of Kip Murray
> >Sent: Tuesday, May 06, 2014 5:15 PM
> >To: [email protected]
> >Subject: Re: [Jprogramming] Five Number Summary
> >
> >Tukey used the name "fourths" because they are a little different from
> >quartiles.
> >
> >On Tuesday, May 6, 2014, Joe Bogner <[email protected]> wrote:
> >
> >> On Tue, May 6, 2014 at 4:33 PM, Kip Murray
> ><[email protected]<javascript:;>>
> >> wrote:
> >>
> >> > jtfns 1 2 2 4 6 NB. correct
> >> > 1 1.5 2 5 6
> >> > five 1 2 2 4 6 NB. doesn't work if repetitions in data
> >> > 1 1 2 5 6
> >> >
> >> >
> >> On Tue, May 6, 2014 at 4:33 PM, Kip Murray
> ><[email protected]<javascript:;>>
> >> wrote:
> >>
> >> > five 1 2 2 4 6 NB. doesn't work if repetitions in data
> >> > 1 1 2 5 6
> >> >
> >> >
> >> It's interesting that R gives even a different result (
> >> http://en.wikipedia.org/wiki/Five-number_summary#Example_in_R)
> >>
> >> > z <- c(1,2,2,4,6)
> >> > fivenum(z)
> >> [1] 1 2 2 4 6
> >> > summary(z)
> >> Min. 1st Qu. Median Mean 3rd Qu. Max.
> >> 1 2 2 3 4 6
> >>
> >>
> >> For the 1st quartile, Excel gives 2 with QUARTILE.INC and 1.5
> >> with QUARTILE.EXC
> >> For the 3rd, Excel gives 4 an
--
Sent from Gmail Mobile
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm