[
https://issues.apache.org/jira/browse/MATH-1551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17164038#comment-17164038
]
Gilles Sadowski commented on MATH-1551:
---------------------------------------
Thanks for the proposal.
There are however many style issues with the modified code:
* tab characters are forbidden (must be 4 spaces)
* white space at end of line must be removed
* variable name must follow the "camel case" Java convention (e.g.
"sample_weights" -> "sampleWeights")
* all methods (including private ones) must be fully documented (Javadoc)
* one-line conditional blocks must be enclosed with braces
* method {{printData}} should be replaced with an implementation of
{{toString()}}
* several sections of code have been commented out (they must be removed)
Note that you should run
{noformat}
$ mvn site
{noformat}
and ensure that your contribution does not introduce any errors reported by
CheckStyle (reports are viewable in the generated web site
{{target/site/index.html}}).
The {{quickSort}} method seems to duplicate {{sortInPlace}} defined in class
{{o.a.c.m.util.MathArrays}}. I suspect that your version might be faster but it
is less versatile: It should be extended to also handle the case of multiple
"secondary" arrays. I suggest that you use {{sortInPlace}} for this
contribution, and then propose another enhancement to replace if it proves too
slow.
Method {{checkPositive}} is redundant with a similar utility in {{MathArrays}}.
Method {{containsNaN}} should be defined in {{MathArrays}}.
> Compute Percentile with Weighted Samples
> ----------------------------------------
>
> Key: MATH-1551
> URL: https://issues.apache.org/jira/browse/MATH-1551
> Project: Commons Math
> Issue Type: New Feature
> Affects Versions: 4.0
> Reporter: allen yu
> Priority: Major
> Labels: features, newbie
> Fix For: 4.0
>
> Attachments: Percentile.java
>
>
> The class Percentile only support estimation on non-weighted samples.
> I've implement some function to estimate percentiles of weighted samples.
> here is the reference:
> [https://stats.stackexchange.com/questions/13169/defining-quantiles-over-a-weighted-sample]!https://mail.google.com/mail/u/0?ui=2&ik=6059a2f2a6&attid=0.1&permmsgid=msg-a:r-8896240918589631988&th=1737bdaafc3e228f&view=fimg&sz=s0-l75-ft&attbid=ANGjdJ_GwCQ-hqi0o7ZJTEqcl6JLYbFiR2Y1sqxPL8jDNzheraAkX0beEUtAM4BYI2v_5XGvzCPj2gTBQutHT9bF8hYh7MgdiGYZhn0HtDuVswuCSuwy8aJVsvy3EqI&disp=emb&realattid=ii_kcyrjgea0!
>
> When all weights are equal to each other, it works like estimation on
> non-weighted samples under R-7.
> I can't find formulas for other rules but at least, now it can evaluate
> percentile for weighted samples.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)