Statistics function incorrectly computing median

Miguel Garcia-Blanco miguel.01 at ihug.com.au
Sun Jan 20 06:25:13 CST 2008


> It is clear, that a change is merited. I agree it makes sense to  consider
> "discrete",  and "continuous" distributions.
>
> There is no "statistics()" function in Matlab, but there is a
> "quantile()". It uses a continuous representation, I'd like to confirm
> our implementation is consistent with theirs, but otherwise there is  no
> compatibility issue.
>
> The current continuous method is consistent with both R and Maxima, so
> we're good there.
>
> What we need to decide is;
>
> (1) What algorithm should be used in the discrete case?
>
>  I'd prefer the current implementation, which mirror of R's 1st   method
> ... less work for me;-)
>

While I have a preference for method 2 (because of the median), I suppose
all three discrete methods are valid, so I'm not particularly fussed.
Regardless of which method is chosen, I think it should be clearly indicated
somewhere (perhaps in the function description), so that users don't
continually file bug reports, simply because they were expecting the results
of one of the other methods.

Of course, it's also possible to implement all three methods and let the
user choose. But this requires more work ;)

> However, changing to the second method should be simple. Please post
> results for some other examples; x = [1:5], x = [1, 2, 5, 9], and x =  [1,
> 2, 5, 9, 11]; ... I'd do it myself, but am not so familiar with R.
>

See the attached file: Examples.txt

> (2) Are "empirical" samples to be handled as "continuous" or "discrete"?
>
>  ... I assume "continuous" is correct?
>
> Ben

I'm not entirely sure what you mean. I think you might be confusing "sample"
with "population". Samples consist of observations and, hence, are empirical
by definition. Maybe some examples might clarify:
Discrete: In a sample of 100 families, the number of children in each family
is recorded.
Continuous: In a sample of 100 people, the weight of each person is
recorded. (Rounding will actually make this discrete, but conceptually it's
continuous.)

-Miguel
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Examples.txt
Url: https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080120/eccf4561/attachment.txt 


More information about the Bug-octave mailing list