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


Java Beta.regularizedBeta方法代码示例

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


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

示例1: cumulativeProbability

import org.apache.commons.math3.special.Beta; //导入方法依赖的package包/类
/** {@inheritDoc} */
public double cumulativeProbability(double x) {
    double ret;
    if (x == 0) {
        ret = 0.5;
    } else {
        double t =
            Beta.regularizedBeta(
                degreesOfFreedom / (degreesOfFreedom + (x * x)),
                0.5 * degreesOfFreedom,
                0.5);
        if (x < 0.0) {
            ret = 0.5 * t;
        } else {
            ret = 1.0 - 0.5 * t;
        }
    }

    return ret;
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:21,代码来源:TDistribution.java

示例2: initialMinorFractions

import org.apache.commons.math3.special.Beta; //导入方法依赖的package包/类
/**
 *  Initialize minor fractions assuming no allelic bias <p></p>
 *
 * We integrate over f to get posterior probabilities (responsibilities) of alt / ref minor
 * that is, responsibility of alt minor is int_{0 to 1/2} f^a (1-f)^r df
 *          responsibility of ref minor is int_{0 to 1/2} f^r (1-f)^a df
 * these are proportional to I(1/2, a + 1, r + 1) and I(1/2, r + 1, a + 1),
 * respectively, where I is the (incomplete) regularized Beta function.
 * By definition these likelihoods sum to 1, ie they are already normalized. <p></p>
 *
 * Finally, we set each minor fraction to the responsibility-weighted total count of
 * reads in minor allele divided by total reads, ignoring outliers.
 */
private AlleleFractionState.MinorFractions initialMinorFractions(final AlleleFractionData data) {
    final int numSegments = data.getNumSegments();
    final AlleleFractionState.MinorFractions result = new AlleleFractionState.MinorFractions(numSegments);
    for (int segment = 0; segment < numSegments; segment++) {
        double responsibilityWeightedMinorAlleleReadCount = 0.0;
        double responsibilityWeightedTotalReadCount = 0.0;
        for (final AllelicCount count : data.getCountsInSegment(segment)) {
            final int a = count.getAltReadCount();
            final int r = count.getRefReadCount();
            double altMinorResponsibility;
            try {
                altMinorResponsibility = Beta.regularizedBeta(0.5, a + 1, r + 1);
            } catch (final MaxCountExceededException e) {
                altMinorResponsibility = a < r ? 1.0 : 0.0; //if the special function can't be computed, give an all-or-nothing responsibility
            }
            responsibilityWeightedMinorAlleleReadCount += altMinorResponsibility * a + (1 - altMinorResponsibility) * r;
            responsibilityWeightedTotalReadCount += a + r;
        }

        // we achieve a flat prior via a single pseudocount for minor and non-minor reads, hence the  +1 and +2
        result.add((responsibilityWeightedMinorAlleleReadCount + 1)/(responsibilityWeightedTotalReadCount + 2));
    }
    return result;
}
 
开发者ID:broadinstitute,项目名称:gatk-protected,代码行数:38,代码来源:AlleleFractionInitializer.java

示例3: cumulativeProbability

import org.apache.commons.math3.special.Beta; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 *
 * The implementation of this method is based on
 * <ul>
 *  <li>
 *   <a href="http://mathworld.wolfram.com/F-Distribution.html">
 *   F-Distribution</a>, equation (4).
 *  </li>
 * </ul>
 */
public double cumulativeProbability(double x)  {
    double ret;
    if (x <= 0) {
        ret = 0;
    } else {
        double n = numeratorDegreesOfFreedom;
        double m = denominatorDegreesOfFreedom;

        ret = Beta.regularizedBeta((n * x) / (m + n * x),
            0.5 * n,
            0.5 * m);
    }
    return ret;
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:26,代码来源:FDistribution.java

示例4: cumulativeProbability

import org.apache.commons.math3.special.Beta; //导入方法依赖的package包/类
/** {@inheritDoc} */
public double cumulativeProbability(double x)  {
    if (x <= 0) {
        return 0;
    } else if (x >= 1) {
        return 1;
    } else {
        return Beta.regularizedBeta(x, alpha, beta);
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:11,代码来源:BetaDistribution.java

示例5: cumulativeProbability

import org.apache.commons.math3.special.Beta; //导入方法依赖的package包/类
/** {@inheritDoc} */
public double cumulativeProbability(int x) {
    double ret;
    if (x < 0) {
        ret = 0.0;
    } else if (x >= numberOfTrials) {
        ret = 1.0;
    } else {
        ret = 1.0 - Beta.regularizedBeta(probabilityOfSuccess,
                x + 1.0, numberOfTrials - x);
    }
    return ret;
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:14,代码来源:BinomialDistribution.java

示例6: cumulativeProbability

import org.apache.commons.math3.special.Beta; //导入方法依赖的package包/类
/** {@inheritDoc} */
public double cumulativeProbability(int x) {
    double ret;
    if (x < 0) {
        ret = 0.0;
    } else {
        ret = Beta.regularizedBeta(probabilityOfSuccess,
                numberOfSuccesses, x + 1.0);
    }
    return ret;
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:12,代码来源:PascalDistribution.java

示例7: cumulativeProbability

import org.apache.commons.math3.special.Beta; //导入方法依赖的package包/类
/** {@inheritDoc} */
public double cumulativeProbability(int x) {
    double ret;
    if (x < 0) {
        ret = 0.0;
    } else {
        ret = Beta.regularizedBeta(probabilityOfSuccess,
                numberOfSuccesses, x + 1);
    }
    return ret;
}
 
开发者ID:golharam,项目名称:FastQC,代码行数:12,代码来源:PascalDistribution.java

示例8: apply

import org.apache.commons.math3.special.Beta; //导入方法依赖的package包/类
/**
 * Evaluates the function.
 * 
 * @param x  x
 * @return the value of the function
 * @throws IllegalArgumentException if $x < 0$ or $x > 1$
 */
@Override
public Double apply(Double x) {
  ArgChecker.isTrue(x >= 0 && x <= 1, "x must be in the range 0 to 1");
  try {
    return Beta.regularizedBeta(x, _a, _b, _eps, _maxIter);
  } catch (MaxCountExceededException e) {
    throw new MathException(e);
  }
}
 
开发者ID:OpenGamma,项目名称:Strata,代码行数:17,代码来源:IncompleteBetaFunction.java

示例9: cumulativeProbability

import org.apache.commons.math3.special.Beta; //导入方法依赖的package包/类
@Override
public double cumulativeProbability(double x) {

    double ret;
    if (x < 0) {
        ret = 0.0D;
    } else if (x >= this.numberOfTrials) {
        ret = 1.0D;
    } else {
        ret = 1.0D - Beta.regularizedBeta(this.probabilityOfSuccess, x + 1.0D, (this.numberOfTrials - x));
    }

    return ret;
}
 
开发者ID:deeplearning4j,项目名称:nd4j,代码行数:15,代码来源:BinomialDistribution.java

示例10: calculateHomozygousLogRatio

import org.apache.commons.math3.special.Beta; //导入方法依赖的package包/类
private static double calculateHomozygousLogRatio(final AllelicCount allelicCount,
                                                  final double genotypingBaseErrorRate) {
    final int r = allelicCount.getRefReadCount();
    final int n = allelicCount.getTotalReadCount();
    final double betaAll = Beta.regularizedBeta(1, r + 1, n - r + 1);
    final double betaError = Beta.regularizedBeta(genotypingBaseErrorRate, r + 1, n - r + 1);
    final double betaOneMinusError = Beta.regularizedBeta(1 - genotypingBaseErrorRate, r + 1, n - r + 1);
    final double betaHom = betaError + betaAll - betaOneMinusError;
    final double betaHet = betaOneMinusError - betaError;
    return FastMath.log(betaHom) - FastMath.log(betaHet);
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:12,代码来源:ModelSegments.java

示例11: cdf

import org.apache.commons.math3.special.Beta; //导入方法依赖的package包/类
public double cdf(double x) {
    double r = -1 * (mean*mean) / (mean - stdev*stdev);
    double p = mean / (stdev*stdev);
    return Beta.regularizedBeta(p, r, x + 1);
}
 
开发者ID:armanbilge,项目名称:B3,代码行数:6,代码来源:NegativeBinomialDistribution.java


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