[SciPy-dev] percentileofscore

Robert Kern robert.kern@gmail....
Sun Nov 16 23:58:36 CST 2008

On Sun, Nov 16, 2008 at 23:53,  <josef.pktd@gmail.com> wrote:
> On Sun, Nov 16, 2008 at 10:56 PM, Robert Kern <robert.kern@gmail.com> wrote:
>> Wikipedia says to use half of the frequency of the ties (x==score) in
>> addition to the cumulative frequency of strict x<score.
>>  http://en.wikipedia.org/wiki/Percentile_rank
> The 0.5 weight looks pretty arbitrary to me
> percentilescore_wikip([1,2,3,4,4,4,5,6,7,8]) = 3 + 0.5*3 = 4.5

It's not arbitrary. It's the average of the x<score and x<=score cases.

> I guess the question is, whether this a commonly accepted convention,
> or maybe, which and whose convention should scipy follow.
> The proposed patch is pretty easy to adjust to any convention.
> Maybe percentileofscore should get a weight parameter for ties:
> 0 for strict inequality, 1 for weak inequality,
> 0.5 (default?) for wikipedia and -1 for mean.

I prefer strings, myself. 'strict', 'weak', 'mean'.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

More information about the Scipy-dev mailing list