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


Java Gamma.regularizedGammaP方法代码示例

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


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

示例1: cumulativeProbability

import org.apache.commons.math3.special.Gamma; //导入方法依赖的package包/类
/**
 * {@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;
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:27,代码来源:CustomGammaDistribution.java

示例2: pValue

import org.apache.commons.math3.special.Gamma; //导入方法依赖的package包/类
public static double pValue(double chiSquared, long nbDegreesOfFreedom, double epsilon) {
  if (chiSquared <= 0.0) {
    return 1.0;
  } else {
    return 1.0 - Gamma.regularizedGammaP(nbDegreesOfFreedom / 2.0, chiSquared / 2.0, epsilon, Integer.MAX_VALUE);
  }
}
 
开发者ID:fpetitjean,项目名称:Chordalysis,代码行数:8,代码来源:ChiSquared.java

示例3: apply

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

示例4: cumulativeProbability

import org.apache.commons.math3.special.Gamma; //导入方法依赖的package包/类
/** {@inheritDoc} */
public double cumulativeProbability(double x) {
    return Gamma.regularizedGammaP(mu, mu * x * x / omega);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:5,代码来源:NakagamiDistribution.java

示例5: getCDF

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

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

  double regGammaStart = 0;
  double halfX = x / 2.0;
  double logX = Math.log(halfX);
  try {
    regGammaStart = Gamma.regularizedGammaP(_dofOverTwo + _k, halfX);
  } catch (MaxCountExceededException 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:OpenGamma,项目名称:Strata,代码行数:56,代码来源:NonCentralChiSquaredDistribution.java

示例6: cumulativeProbability

import org.apache.commons.math3.special.Gamma; //导入方法依赖的package包/类
/**
 * {@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;
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:26,代码来源:GammaDistribution.java

示例7: cumulativeProbability

import org.apache.commons.math3.special.Gamma; //导入方法依赖的package包/类
/**
 * {@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(alpha, x / beta);
    }

    return ret;
}
 
开发者ID:golharam,项目名称:FastQC,代码行数:26,代码来源:GammaDistribution.java

示例8: computePValue

import org.apache.commons.math3.special.Gamma; //导入方法依赖的package包/类
/**
 * Compute the p-value of the Chi-squared distribution. This is the cumulative probability of the chi-squared
 * distribution.
 * <p>
 * This is the probability of obtaining a value less extreme than this point by chance.
 *
 * @param chiSquared
 *            the chi squared
 * @param degreesOfFreedom
 *            the degrees of freedom
 * @return the p-value
 */
public static double computePValue(double chiSquared, int degreesOfFreedom)
{
	if (chiSquared <= 0)
	{
		return 0;
	}
	else
	{
		return Gamma.regularizedGammaP(degreesOfFreedom / 2.0, chiSquared / 2.0);
	}
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:24,代码来源:ChiSquaredDistributionTable.java


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