mirror of https://github.com/jlizier/jidt
Handling infinites in Chi square CDF function properly
This commit is contained in:
parent
8542d217ea
commit
9f9c79bc95
|
|
@ -354,6 +354,9 @@ public class MathsUtils {
|
|||
if (k <= 0) {
|
||||
throw new IllegalArgumentException("k (" + k + ") must be > 0");
|
||||
}
|
||||
if (Double.isInfinite(x) && (x > 0)) {
|
||||
return 1.0;
|
||||
}
|
||||
// Old approach: (not numerically stable):
|
||||
// return lowerIncompleteGammaFunctionOfArgsOn2(k,x) /
|
||||
// gammaOfArgOn2Plus1(k-2); // denominator is Gamma(k/2)
|
||||
|
|
|
|||
Loading…
Reference in New Issue