当前位置: 首页>>代码示例>>Java>>正文


Java Gamma.regularizedGammaP方法代码示例

本文整理汇总了Java中org.apache.commons.math.special.Gamma.regularizedGammaP方法的典型用法代码示例。如果您正苦于以下问题:Java Gamma.regularizedGammaP方法的具体用法?Java Gamma.regularizedGammaP怎么用?Java Gamma.regularizedGammaP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.math.special.Gamma的用法示例。


在下文中一共展示了Gamma.regularizedGammaP方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: evaluate

import org.apache.commons.math.special.Gamma; //导入方法依赖的package包/类
@Override
public Double evaluate(final Double x) {
  try {
    return Gamma.regularizedGammaP(_a, x, _eps, _maxIter);
  } catch (final org.apache.commons.math.MathException e) {
    throw new MathException(e);
  }
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:9,代码来源:IncompleteGammaFunction.java

示例2: callAndUpdate

import org.apache.commons.math.special.Gamma; //导入方法依赖的package包/类
@Override
boolean callAndUpdate(int from, int to, int k, int n, int n0) {
    if (k == 0 || n < 4) {
        return false;
    }

    totalMigs.incrementAndGet();
    logMigSize.addAndGet(Math.log(n));

    boolean pass = false;

    try {
        double lambda = n * seqErrorRate;
        double p = Gamma.regularizedGammaP(k, lambda) +
                0.5 * Math.exp(k * Math.log(lambda) - lambda - Gamma.logGamma(k + 1));

        if (assemblerParameters.isMinorCallerDebug()) {
            results.add(new CallResult(from, to, k, n, n0, p));
        }

        pass = p < assemblerParameters.getPcrMinorTestPValue();

        m[from][to].incrementAndGet();
        pValueSum[from][to].addAndGet(p);

        if (pass) {
            m1[from][to].incrementAndGet();
            minorReadCountSumArr[from][to].addAndGet(k);
            totalReadCountSumArr[from][to].addAndGet(n);
            totalReadCountSumArrNoQFilter[from][to].addAndGet(n0);
        }
    } catch (MathException e) {
        e.printStackTrace();
    }

    return pass;
}
 
开发者ID:mikessh,项目名称:mageri,代码行数:38,代码来源:PoissonTestMinorCaller.java

示例3: getCDF

import org.apache.commons.math.special.Gamma; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public double getCDF(final Double x) {
  Validate.notNull(x, "x");
  if (x < 0) {
    return 0.0;
  }

  if ((_dofOverTwo + _lambdaOverTwo) > 1000) {
    return getFraserApproxCDF(x);
  }

  double regGammaStart = 0;
  final double halfX = x / 2.0;
  final double logX = Math.log(halfX);
  try {
    regGammaStart = Gamma.regularizedGammaP(_dofOverTwo + _k, halfX);
  } catch (final org.apache.commons.math.MathException ex) {
    throw new MathException(ex);
  }

  double sum = _pStart * regGammaStart;
  double oldSum = Double.NEGATIVE_INFINITY;
  double p = _pStart;
  double regGamma = regGammaStart;
  double temp;
  int i = _k;

  // first add terms below _k
  while (i > 0 && Math.abs(sum - oldSum) / sum > _eps) {
    i--;
    p *= (i + 1) / _lambdaOverTwo;
    temp = (_dofOverTwo + i) * logX - halfX - Gamma.logGamma(_dofOverTwo + i + 1);
    regGamma += Math.exp(temp);
    oldSum = sum;
    sum += p * regGamma;
  }

  p = _pStart;
  regGamma = regGammaStart;
  oldSum = Double.NEGATIVE_INFINITY;
  i = _k;
  while (Math.abs(sum - oldSum) / sum > _eps) {
    i++;
    p *= _lambdaOverTwo / i;
    temp = (_dofOverTwo + i - 1) * logX - halfX - Gamma.logGamma(_dofOverTwo + i);
    regGamma -= Math.exp(temp);
    oldSum = sum;
    sum += p * regGamma;
  }

  return sum;
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:56,代码来源:NonCentralChiSquaredDistribution.java

示例4: cumulativeProbability

import org.apache.commons.math.special.Gamma; //导入方法依赖的package包/类
/**
 * For this disbution, X, this method returns P(X &lt; x).
 * 
 * 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>
 * 
 * @param x the value at which the CDF is evaluated.
 * @return CDF for this distribution. 
 * @throws MathException if the cumulative probability can not be
 *            computed due to convergence or other numerical errors.
 */
public double cumulativeProbability(double x) throws MathException{
    double ret;

    if (x <= 0.0) {
        ret = 0.0;
    } else {
        ret = Gamma.regularizedGammaP(getAlpha(), x / getBeta());
    }

    return ret;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:29,代码来源:GammaDistributionImpl.java

示例5: cumulativeProbability

import org.apache.commons.math.special.Gamma; //导入方法依赖的package包/类
/**
    * For this distribution, X, this method returns P(X &lt; x).
    * <p/>
    * 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>
    *
    * @param x the value at which the CDF is evaluated.
    * @return CDF for this distribution.
    * @throws MathException if the cumulative probability can not be
    *                       computed due to convergence or other numerical errors.
    */
   @Override
public double cumulativeProbability(double x) throws MathException {
       double ret;

       if (x <= 0.0) {
           ret = 0.0;
       } else {
           ret = Gamma.regularizedGammaP(alpha, x / beta);
       }

       return ret;
   }
 
开发者ID:CompEvol,项目名称:beast2,代码行数:30,代码来源:GammaDistributionImpl.java

示例6: cumulativeProbability

import org.apache.commons.math.special.Gamma; //导入方法依赖的package包/类
/**
 * For this distribution, X, this method returns P(X &lt; x).
 *
 * 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>
 *
 * @param x the value at which the CDF is evaluated.
 * @return CDF for this distribution.
 * @throws MathException if the cumulative probability can not be
 *            computed due to convergence or other numerical errors.
 */
public double cumulativeProbability(double x) throws MathException{
    double ret;

    if (x <= 0.0) {
        ret = 0.0;
    } else {
        ret = Gamma.regularizedGammaP(getAlpha(), x / getBeta());
    }

    return ret;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:29,代码来源:GammaDistributionImpl.java

示例7: cumulativeProbability

import org.apache.commons.math.special.Gamma; //导入方法依赖的package包/类
/**
 * For this distribution, {@code X}, this method returns {@code P(X < x)}.
 *
 * 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>
 *
 * @param x Value at which the CDF is evaluated.
 * @return CDF for this distribution.
 * @throws MathException if the cumulative probability can not be
 * computed due to convergence or other numerical errors.
 */
public double cumulativeProbability(double x) throws MathException{
    double ret;

    if (x <= 0) {
        ret = 0;
    } else {
        ret = Gamma.regularizedGammaP(alpha, x / beta);
    }

    return ret;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:31,代码来源:GammaDistributionImpl.java

示例8: cumulativeProbability

import org.apache.commons.math.special.Gamma; //导入方法依赖的package包/类
/**
 * For this distribution, X, this method returns P(X &lt; x).
 *
 * 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>
 *
 * @param x the value at which the CDF is evaluated.
 * @return CDF for this distribution.
 * @throws MathException if the cumulative probability can not be
 *            computed due to convergence or other numerical errors.
 */
public double cumulativeProbability(double x) throws MathException{
    double ret;

    if (x <= 0.0) {
        ret = 0.0;
    } else {
        ret = Gamma.regularizedGammaP(alpha, x / beta);
    }

    return ret;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:29,代码来源:GammaDistributionImpl.java

示例9: cumulativeProbability

import org.apache.commons.math.special.Gamma; //导入方法依赖的package包/类
/**
 * For this distribution, X, this method returns P(X &lt; x).
 * 
 * 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>
 * 
 * @param x the value at which the CDF is evaluated.
 * @return CDF for this distribution. 
 * @throws MathException if the cumulative probability can not be
 *            computed due to convergence or other numerical errors.
 */
public double cumulativeProbability(double x) throws MathException{
    double ret;

    if (x <= 0.0) {
        ret = 0.0;
    } else {
        ret = Gamma.regularizedGammaP(getAlpha(), x / getBeta());
    }

    return ret;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:29,代码来源:GammaDistributionImpl.java

示例10: cumulativeProbability

import org.apache.commons.math.special.Gamma; //导入方法依赖的package包/类
/**
 * For this distribution, X, this method returns P(X &lt; x).
 * <p/>
 * 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>
 *
 * @param x the value at which the CDF is evaluated.
 * @return CDF for this distribution.
 * @throws MathException if the cumulative probability can not be
 *                       computed due to convergence or other numerical errors.
 */
public double cumulativeProbability(double x) throws MathException {
    double ret;

    if (x <= 0.0) {
        ret = 0.0;
    } else {
        ret = Gamma.regularizedGammaP(alpha, x / beta);
    }

    return ret;
}
 
开发者ID:rbouckaert,项目名称:YABBY,代码行数:29,代码来源:GammaDistributionImpl.java


注:本文中的org.apache.commons.math.special.Gamma.regularizedGammaP方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。