Le 18/09/2010 20:01, Dimitri Pourbaix a écrit :
> Hi,
> 
> If I understand correctly, the argument against the present implementation
> is that if several percentiles are requested, they all require the sorting
> of the array.

Yes.

> On the other hand, the speed-up version would no longer
> be mathematically correct, as a rough approximate of the pivot would be
> adopted.

No, the exact pivot is used. Its evaluation is only delayed. It would be
correct.

The evaluation that is only an approximation is the on-line algorithm,
because it does not keep all values in memory. However, even when
everything is in memory one should be aware that the result of the
computation is the sample quantile, not the quantile of the underlying
distribution and it seems this statistic is biased (sound to me close to
what happen with standard deviation, with the 1/n or 1/(n+1) factors).

> There is a compromise which would satisfy both sides, is not
> there?  What about sorting and storing the sorted version of the array,
> once for all at the constructor level?  That is what one would do anyway
> if speed was an issue (in one application, I need 5, 50, and 95-percentile
> of the same aray and sort it only once!).

This is what the user did, for 100 percentile evaluations for each sample.

Luc

> 
> Dim.
> ----------------------------------------------------------------------------
> 
> Dimitri Pourbaix                         *
> Institut d'Astronomie et d'Astrophysique *      Don't worry, be happy
> CP 226, office 2.N4.211, building NO     *         and CARPE DIEM.
> Universite Libre de Bruxelles            *
> Boulevard du Triomphe                    *      Tel : +32-2-650.35.71
>  B-1050 Bruxelles                        *      Fax : +32-2-650.42.26
> http://sb9.astro.ulb.ac.be/~pourbaix     * mailto:pourb...@astro.ulb.ac.be
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to