[
https://issues.apache.org/jira/browse/NUMBERS-167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17707657#comment-17707657
]
Gilles Sadowski commented on NUMBERS-167:
-----------------------------------------
bq. It was not clear which is slower.
The "other library" does not use an optimizer while for the chi-squared
distribution, "Commons Statistics" does (via the gamma distribution).
>From a quick search for the name of the algorithm mentioned in the Javadoc
>(see previous
>[comment|https://issues.apache.org/jira/browse/NUMBERS-167?focusedCommentId=17706930&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17706930]):
> https://github.com/anowacki/seismo-fortran/ where the code is provided under
>the MIT license (i.e. ASF category "A").
Hence I could try and port the code (already converted to Java in the "other
library") to "Statistics"; the only loss would thus be the 4 additional calls
to the gamma function (but that could be improved in the future as you
suggested).
> RegularizedGamma.P with precomputed LogGamma value
> --------------------------------------------------
>
> Key: NUMBERS-167
> URL: https://issues.apache.org/jira/browse/NUMBERS-167
> Project: Commons Numbers
> Issue Type: Wish
> Components: gamma
> Reporter: Gilles Sadowski
> Priority: Minor
> Fix For: 1.2
>
> Attachments: pr_106.patch
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> We have
> {code:java}
> double v = RegularizedGamma.P.value(a, x);
> {code}
> where method {{value}} internally calls {{LogGamma.value(a)}}.
> There is a use-case for
> {code:java}
> double logGammaA = LogGamma.value(a);
> double v = RegularizedGamma.P.value(a, x, logGammaA);
> {code}
> for when the user varies {{x}} but not {{a}}.
> Method name TBD: Another overload of {{value}} may be confusing (?).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)