本文整理了Java中org.apache.commons.math3.special.Gamma.regularizedGammaQ()
方法的一些代码示例,展示了Gamma.regularizedGammaQ()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Gamma.regularizedGammaQ()
方法的具体详情如下:
包路径:org.apache.commons.math3.special.Gamma
类名称:Gamma
方法名:regularizedGammaQ
[英]Returns the regularized gamma function Q(a, x) = 1 - P(a, x).
[中]返回正则化伽马函数Q(a,x)=1-P(a,x)。
代码示例来源:origin: org.apache.commons/commons-math3
/** {@inheritDoc} */
public double cumulativeProbability(int x) {
if (x < 0) {
return 0;
}
if (x == Integer.MAX_VALUE) {
return 1;
}
return Gamma.regularizedGammaQ((double) x + 1, mean, epsilon,
maxIterations);
}
代码示例来源:origin: org.apache.commons/commons-math3
/**
* Returns the regularized gamma function Q(a, x) = 1 - P(a, x).
*
* @param a the a parameter.
* @param x the value.
* @return the regularized gamma function Q(a, x)
* @throws MaxCountExceededException if the algorithm fails to converge.
*/
public static double regularizedGammaQ(double a, double x) {
return regularizedGammaQ(a, x, DEFAULT_EPSILON, Integer.MAX_VALUE);
}
代码示例来源:origin: org.apache.commons/commons-math3
/**
* Returns the complementary error function.
*
* <p>erfc(x) = 2/√π <sub>x</sub>∫<sup>∞</sup> e<sup>-t<sup>2</sup></sup>dt
* <br/>
* = 1 - {@link #erf(double) erf(x)} </p>
*
* <p>This implementation computes erfc(x) using the
* {@link Gamma#regularizedGammaQ(double, double, double, int) regularized gamma function},
* following <a href="http://mathworld.wolfram.com/Erf.html"> Erf</a>, equation (3).</p>
*
* <p>The value returned is always between 0 and 2 (inclusive).
* If {@code abs(x) > 40}, then {@code erf(x)} is indistinguishable from
* either 0 or 2 as a double, so the appropriate extreme value is returned.
* </p>
*
* @param x the value
* @return the complementary error function erfc(x)
* @throws org.apache.commons.math3.exception.MaxCountExceededException
* if the algorithm fails to converge.
* @see Gamma#regularizedGammaQ(double, double, double, int)
* @since 2.2
*/
public static double erfc(double x) {
if (FastMath.abs(x) > 40) {
return x > 0 ? 0 : 2;
}
final double ret = Gamma.regularizedGammaQ(0.5, x * x, 1.0e-15, 10000);
return x < 0 ? 2 - ret : ret;
}
代码示例来源:origin: org.apache.commons/commons-math3
ret = 1.0 - regularizedGammaQ(a, x, epsilon, maxIterations);
} else {
代码示例来源:origin: io.virtdata/virtdata-lib-realer
/**
* Returns the regularized gamma function Q(a, x) = 1 - P(a, x).
*
* @param a the a parameter.
* @param x the value.
* @return the regularized gamma function Q(a, x)
* @throws MaxCountExceededException if the algorithm fails to converge.
*/
public static double regularizedGammaQ(double a, double x) {
return regularizedGammaQ(a, x, DEFAULT_EPSILON, Integer.MAX_VALUE);
}
代码示例来源:origin: io.virtdata/virtdata-lib-realer
/** {@inheritDoc} */
public double cumulativeProbability(int x) {
if (x < 0) {
return 0;
}
if (x == Integer.MAX_VALUE) {
return 1;
}
return Gamma.regularizedGammaQ((double) x + 1, mean, epsilon,
maxIterations);
}
代码示例来源:origin: geogebra/geogebra
/** {@inheritDoc} */
public double cumulativeProbability(int x) {
if (x < 0) {
return 0;
}
if (x == Integer.MAX_VALUE) {
return 1;
}
return Gamma.regularizedGammaQ((double) x + 1, mean, epsilon,
maxIterations);
}
代码示例来源:origin: geogebra/geogebra
/**
* Returns the regularized gamma function Q(a, x) = 1 - P(a, x).
*
* @param a the a parameter.
* @param x the value.
* @return the regularized gamma function Q(a, x)
* @throws MaxCountExceededException if the algorithm fails to converge.
*/
public static double regularizedGammaQ(double a, double x) {
return regularizedGammaQ(a, x, DEFAULT_EPSILON, Integer.MAX_VALUE);
}
代码示例来源:origin: pcingola/SnpEff
/**
* Upper tail 1 - ChiSquareCDF(p)
* @param chiSquare
* @param nu
* @return
*/
public static double chiSquareCDFComplementary(double chiSquare, int nu) {
if (nu <= 0) throw new IllegalArgumentException("The degrees of freedom [nu], " + nu + ", must be greater than zero");
return Gamma.regularizedGammaQ(nu / 2.0D, chiSquare / 2.0D);
}
代码示例来源:origin: pcingola/SnpEff
/**
* Chi-Square Complementary of Cumulative Distribution Function: 1 - chiSquareCDF(x, nu)
* probability that an observed chi-square value
* for a correct model should be greater than chiSquare
* nu = the degrees of freedom
*
* @param chiSquare
* @param nu
* @return
*/
public double chiSquareCDFComplementary(double chiSquare, int nu) {
if (nu <= 0) throw new IllegalArgumentException("The degrees of freedom [nu], " + nu + ", must be greater than zero");
return Gamma.regularizedGammaQ(nu / 2.0D, chiSquare / 2.0D);
}
代码示例来源:origin: geogebra/geogebra
/**
* Returns the complementary error function.
*
* <p>erfc(x) = 2/√π <sub>x</sub>∫<sup>∞</sup> e<sup>-t<sup>2</sup></sup>dt
* <br/>
* = 1 - {@link #erf(double) erf(x)} </p>
*
* <p>This implementation computes erfc(x) using the
* {@link Gamma#regularizedGammaQ(double, double, double, int) regularized gamma function},
* following <a href="http://mathworld.wolfram.com/Erf.html"> Erf</a>, equation (3).</p>
*
* <p>The value returned is always between 0 and 2 (inclusive).
* If {@code abs(x) > 40}, then {@code erf(x)} is indistinguishable from
* either 0 or 2 as a double, so the appropriate extreme value is returned.
* </p>
*
* @param x the value
* @return the complementary error function erfc(x)
* @throws org.apache.commons.math3.exception.MaxCountExceededException
* if the algorithm fails to converge.
* @see Gamma#regularizedGammaQ(double, double, double, int)
* @since 2.2
*/
public static double erfc(double x) {
if (Math.abs(x) > 40) {
return x > 0 ? 0 : 2;
}
final double ret = Gamma.regularizedGammaQ(0.5, x * x, 1.0e-15, 10000);
return x < 0 ? 2 - ret : ret;
}
代码示例来源:origin: io.virtdata/virtdata-lib-realer
/**
* Returns the complementary error function.
*
* <p>erfc(x) = 2/√π <sub>x</sub>∫<sup>∞</sup> e<sup>-t<sup>2</sup></sup>dt
* <br/>
* = 1 - {@link #erf(double) erf(x)} </p>
*
* <p>This implementation computes erfc(x) using the
* {@link Gamma#regularizedGammaQ(double, double, double, int) regularized gamma function},
* following <a href="http://mathworld.wolfram.com/Erf.html"> Erf</a>, equation (3).</p>
*
* <p>The value returned is always between 0 and 2 (inclusive).
* If {@code abs(x) > 40}, then {@code erf(x)} is indistinguishable from
* either 0 or 2 as a double, so the appropriate extreme value is returned.
* </p>
*
* @param x the value
* @return the complementary error function erfc(x)
* @throws org.apache.commons.math3.exception.MaxCountExceededException
* if the algorithm fails to converge.
* @see Gamma#regularizedGammaQ(double, double, double, int)
* @since 2.2
*/
public static double erfc(double x) {
if (FastMath.abs(x) > 40) {
return x > 0 ? 0 : 2;
}
final double ret = Gamma.regularizedGammaQ(0.5, x * x, 1.0e-15, 10000);
return x < 0 ? 2 - ret : ret;
}
代码示例来源:origin: geogebra/geogebra
ret = 1.0 - regularizedGammaQ(a, x, epsilon, maxIterations);
} else {
代码示例来源:origin: io.virtdata/virtdata-lib-realer
ret = 1.0 - regularizedGammaQ(a, x, epsilon, maxIterations);
} else {
内容来源于网络,如有侵权,请联系作者删除!