There are various ways to compute percentiles and statistical programs use 
different methods by default. I would prefer that we do like R and provide 
multiple options for the type of percentile computation. See 
http://stat.ethz.ch/R-manual/R-patched/library/stats/html/quantile.html 

Patrick

-----Original Message-----
From: venkatesha murthy [mailto:venkateshamurth...@gmail.com] 
Sent: Wednesday, May 21, 2014 3:18 PM
To: dev@commons.apache.org
Subject: [MATH-1120] Needed opinion about support on variations in percentile 
calculation

Hi All,

The existing Percentile class calculates the percentile based on the quantile 
position of the array fixed as p * (N+1)/100 for a pth Percentile on an Array 
of size N. However if we were to add these numbers in MS Excel to calculate the 
percentile it provides a different result and closely resembeles the formula 
[p*(N-1)/100]+1.

Its imperative at times to match the computations to a standard spreadsheet 
calculations or to a standard tool; which is why i request for allowing the 
quantile position to be customized.
Infact even the kth selection used
can also be refactored as a strategy(than as a private methods) as a further 
step.

So if atleast the Percentile class were to allow the quantile position to be 
customized in the sub classes; then the end user may be helped in providing the 
formula of their choice.

The most minimal change i am proposing here is to just make the quantile 
position setting as a protected method and i have attached a possible patch in 
[MATH-1120] <https://issues.apache.org/jira/browse/MATH-1120>.

Request all to opinionate on this

thanks
venkat


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

Reply via email to