org.apache.commons.math3.special.Gamma.regularizedGammaP()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(87)

本文整理了Java中org.apache.commons.math3.special.Gamma.regularizedGammaP()方法的一些代码示例,展示了Gamma.regularizedGammaP()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Gamma.regularizedGammaP()方法的具体详情如下:
包路径:org.apache.commons.math3.special.Gamma
类名称:Gamma
方法名:regularizedGammaP

Gamma.regularizedGammaP介绍

[英]Returns the regularized gamma function P(a, x).
[中]返回正则化的gamma函数P(a,x)。

代码示例

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * Returns the regularized gamma function P(a, x).
 *
 * @param a Parameter.
 * @param x Value.
 * @return the regularized gamma function P(a, x).
 * @throws MaxCountExceededException if the algorithm fails to converge.
 */
public static double regularizedGammaP(double a, double x) {
  return regularizedGammaP(a, x, DEFAULT_EPSILON, Integer.MAX_VALUE);
}

代码示例来源:origin: org.apache.commons/commons-math3

/** {@inheritDoc} */
public double cumulativeProbability(double x) {
  return Gamma.regularizedGammaP(mu, mu * x * x / omega);
}

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * {@inheritDoc}
 *
 * The implementation of this method is based on:
 * <ul>
 *  <li>
 *   <a href="http://mathworld.wolfram.com/Chi-SquaredDistribution.html">
 *    Chi-Squared Distribution</a>, equation (9).
 *  </li>
 *  <li>Casella, G., & Berger, R. (1990). <i>Statistical Inference</i>.
 *    Belmont, CA: Duxbury Press.
 *  </li>
 * </ul>
 */
public double cumulativeProbability(double x) {
  double ret;
  if (x <= 0) {
    ret = 0;
  } else {
    ret = Gamma.regularizedGammaP(shape, x / scale);
  }
  return ret;
}

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * Returns the error function.
 *
 * <p>erf(x) = 2/&radic;&pi; <sub>0</sub>&int;<sup>x</sup> e<sup>-t<sup>2</sup></sup>dt </p>
 *
 * <p>This implementation computes erf(x) using the
 * {@link Gamma#regularizedGammaP(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 -1 and 1 (inclusive).
 * If {@code abs(x) > 40}, then {@code erf(x)} is indistinguishable from
 * either 1 or -1 as a double, so the appropriate extreme value is returned.
 * </p>
 *
 * @param x the value.
 * @return the error function erf(x)
 * @throws org.apache.commons.math3.exception.MaxCountExceededException
 * if the algorithm fails to converge.
 * @see Gamma#regularizedGammaP(double, double, double, int)
 */
public static double erf(double x) {
  if (FastMath.abs(x) > 40) {
    return x > 0 ? 1 : -1;
  }
  final double ret = Gamma.regularizedGammaP(0.5, x * x, 1.0e-15, 10000);
  return x < 0 ? -ret : ret;
}

代码示例来源:origin: org.apache.commons/commons-math3

ret = 1.0 - regularizedGammaP(a, x, epsilon, maxIterations);
} else {

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Returns the regularized gamma function P(a, x).
 *
 * @param a Parameter.
 * @param x Value.
 * @return the regularized gamma function P(a, x).
 * @throws MaxCountExceededException if the algorithm fails to converge.
 */
public static double regularizedGammaP(double a, double x) {
  return regularizedGammaP(a, x, DEFAULT_EPSILON, Integer.MAX_VALUE);
}

代码示例来源:origin: geogebra/geogebra

/**
 * Returns the regularized gamma function P(a, x).
 *
 * @param a Parameter.
 * @param x Value.
 * @return the regularized gamma function P(a, x).
 * @throws MaxCountExceededException if the algorithm fails to converge.
 */
public static double regularizedGammaP(double a, double x) {
  return regularizedGammaP(a, x, DEFAULT_EPSILON, Integer.MAX_VALUE);
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/** {@inheritDoc} */
public double cumulativeProbability(double x) {
  return Gamma.regularizedGammaP(mu, mu * x * x / omega);
}

代码示例来源:origin: geogebra/geogebra

/** {@inheritDoc} */
public double cumulativeProbability(double x) {
  return Gamma.regularizedGammaP(mu, mu * x * x / omega);
}

代码示例来源:origin: geogebra/geogebra

/**
 * @param a
 *            parameter
 * @param x
 *            x
 * @return gammaRegularized(a,x)
 */
final public static double gammaIncompleteRegularized(double a, double x) {
  try {
    return Gamma.regularizedGammaP(a, x);
  } catch (RuntimeException e) {
    // catches ArithmeticException, IllegalStateException and
    // ArithmeticException
    return Double.NaN;
  }
}

代码示例来源:origin: geogebra/geogebra

/**
 * {@inheritDoc}
 *
 * The implementation of this method is based on:
 * <ul>
 *  <li>
 *   <a href="http://mathworld.wolfram.com/Chi-SquaredDistribution.html">
 *    Chi-Squared Distribution</a>, equation (9).
 *  </li>
 *  <li>Casella, G., & Berger, R. (1990). <i>Statistical Inference</i>.
 *    Belmont, CA: Duxbury Press.
 *  </li>
 * </ul>
 */
public double cumulativeProbability(double x) {
  double ret;
  if (x <= 0) {
    ret = 0;
  } else {
    ret = Gamma.regularizedGammaP(shape, x / scale);
  }
  return ret;
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * {@inheritDoc}
 *
 * The implementation of this method is based on:
 * <ul>
 *  <li>
 *   <a href="http://mathworld.wolfram.com/Chi-SquaredDistribution.html">
 *    Chi-Squared Distribution</a>, equation (9).
 *  </li>
 *  <li>Casella, G., & Berger, R. (1990). <i>Statistical Inference</i>.
 *    Belmont, CA: Duxbury Press.
 *  </li>
 * </ul>
 */
public double cumulativeProbability(double x) {
  double ret;
  if (x <= 0) {
    ret = 0;
  } else {
    ret = Gamma.regularizedGammaP(shape, x / scale);
  }
  return ret;
}

代码示例来源:origin: pcingola/SnpEff

/**
 * Chi-Square Cumulative Distribution Function
 * probability that an observed chi-square value
 * for a correct model should be less than chiSquare
 * nu  =  the degrees of freedom
 *
 * @param chiSquare
 * @param nu
 * @return
 */
public double chiSquareCDF(double chiSquare, int nu) {
  if (nu <= 0) throw new IllegalArgumentException("The degrees of freedom [nu], " + nu + ", must be greater than zero");
  return Gamma.regularizedGammaP(nu / 2.0D, chiSquare / 2.0D);
}

代码示例来源:origin: geogebra/geogebra

/**
 * Returns the error function.
 *
 * <p>erf(x) = 2/&radic;&pi; <sub>0</sub>&int;<sup>x</sup> e<sup>-t<sup>2</sup></sup>dt </p>
 *
 * <p>This implementation computes erf(x) using the
 * {@link Gamma#regularizedGammaP(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 -1 and 1 (inclusive).
 * If {@code abs(x) > 40}, then {@code erf(x)} is indistinguishable from
 * either 1 or -1 as a double, so the appropriate extreme value is returned.
 * </p>
 *
 * @param x the value.
 * @return the error function erf(x)
 * @throws org.apache.commons.math3.exception.MaxCountExceededException
 * if the algorithm fails to converge.
 * @see Gamma#regularizedGammaP(double, double, double, int)
 */
public static double erf(double x) {
  if (Math.abs(x) > 40) {
    return x > 0 ? 1 : -1;
  }
  final double ret = Gamma.regularizedGammaP(0.5, x * x, 1.0e-15, 10000);
  return x < 0 ? -ret : ret;
}

代码示例来源:origin: OpenGamma/Strata

@Override
public Double apply(Double x) {
 try {
  return Gamma.regularizedGammaP(_a, x, _eps, _maxIter);
 } catch (MaxCountExceededException e) {
  throw new MathException(e);
 }
}

代码示例来源:origin: geogebra/geogebra

/**
 * @param a
 *            parameter
 * @param x
 *            x
 * @return gamma(a,x)
 */
final public static double gammaIncomplete(double a, double x) {
  try {
    // see http://mathworld.wolfram.com/RegularizedGammaFunction.html
    // http://en.wikipedia.org/wiki/Incomplete_gamma_function#Regularized_Gamma_functions_and_Poisson_random_variables
    return Gamma.regularizedGammaP(a, x) * gamma(a);
  } catch (RuntimeException e) {
    // catches ArithmeticException, IllegalStateException and
    // ArithmeticException
    return Double.NaN;
  }
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Returns the error function.
 *
 * <p>erf(x) = 2/&radic;&pi; <sub>0</sub>&int;<sup>x</sup> e<sup>-t<sup>2</sup></sup>dt </p>
 *
 * <p>This implementation computes erf(x) using the
 * {@link Gamma#regularizedGammaP(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 -1 and 1 (inclusive).
 * If {@code abs(x) > 40}, then {@code erf(x)} is indistinguishable from
 * either 1 or -1 as a double, so the appropriate extreme value is returned.
 * </p>
 *
 * @param x the value.
 * @return the error function erf(x)
 * @throws org.apache.commons.math3.exception.MaxCountExceededException
 * if the algorithm fails to converge.
 * @see Gamma#regularizedGammaP(double, double, double, int)
 */
public static double erf(double x) {
  if (FastMath.abs(x) > 40) {
    return x > 0 ? 1 : -1;
  }
  final double ret = Gamma.regularizedGammaP(0.5, x * x, 1.0e-15, 10000);
  return x < 0 ? -ret : ret;
}

代码示例来源:origin: geogebra/geogebra

ret = 1.0 - regularizedGammaP(a, x, epsilon, maxIterations);
} else {

代码示例来源:origin: OpenGamma/Strata

double logX = Math.log(halfX);
try {
 regGammaStart = Gamma.regularizedGammaP(_dofOverTwo + _k, halfX);
} catch (MaxCountExceededException ex) {
 throw new MathException(ex);

代码示例来源:origin: io.virtdata/virtdata-lib-realer

ret = 1.0 - regularizedGammaP(a, x, epsilon, maxIterations);
} else {

相关文章