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


Java Arithmetic.logFactorial方法代码示例

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


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

示例1: computePValue

import cern.jet.math.Arithmetic; //导入方法依赖的package包/类
private static double computePValue(int[][] table) {

        int[] rowSums = {sumRow(table, 0), sumRow(table, 1)};
        int[] colSums = {sumColumn(table, 0), sumColumn(table, 1)};
        int N = rowSums[0] + rowSums[1];

        // calculate in log space so we don't die with high numbers
        double pCutoff = Arithmetic.logFactorial(rowSums[0])
                + Arithmetic.logFactorial(rowSums[1])
                + Arithmetic.logFactorial(colSums[0])
                + Arithmetic.logFactorial(colSums[1])
                - Arithmetic.logFactorial(table[0][0])
                - Arithmetic.logFactorial(table[0][1])
                - Arithmetic.logFactorial(table[1][0])
                - Arithmetic.logFactorial(table[1][1])
                - Arithmetic.logFactorial(N);
        return Math.exp(pCutoff);
    }
 
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:19,代码来源:FisherStrand.java

示例2: computePValue

import cern.jet.math.Arithmetic; //导入方法依赖的package包/类
private static double computePValue(int[][] table) {

        int[] rowSums = { sumRow(table, 0), sumRow(table, 1) };
        int[] colSums = { sumColumn(table, 0), sumColumn(table, 1) };
        int N = rowSums[0] + rowSums[1];

        // calculate in log space so we don't die with high numbers
        double pCutoff = Arithmetic.logFactorial(rowSums[0])
                         + Arithmetic.logFactorial(rowSums[1])
                         + Arithmetic.logFactorial(colSums[0])
                         + Arithmetic.logFactorial(colSums[1])
                         - Arithmetic.logFactorial(table[0][0])
                         - Arithmetic.logFactorial(table[0][1])
                         - Arithmetic.logFactorial(table[1][0])
                         - Arithmetic.logFactorial(table[1][1])
                         - Arithmetic.logFactorial(N);
        return Math.exp(pCutoff);
    }
 
开发者ID:BGI-flexlab,项目名称:SOAPgaea,代码行数:19,代码来源:FisherStrand.java

示例3: computePValue

import cern.jet.math.Arithmetic; //导入方法依赖的package包/类
public static double computePValue(int[][] table) {

        int[] rowSums = { sumRow(table, 0), sumRow(table, 1) };
        int[] colSums = { sumColumn(table, 0), sumColumn(table, 1) };
        int N = rowSums[0] + rowSums[1];

        // calculate in log space for better precision
        double pCutoff = Arithmetic.logFactorial(rowSums[0])
                + Arithmetic.logFactorial(rowSums[1])
                + Arithmetic.logFactorial(colSums[0])
                + Arithmetic.logFactorial(colSums[1])
                - Arithmetic.logFactorial(table[0][0])
                - Arithmetic.logFactorial(table[0][1])
                - Arithmetic.logFactorial(table[1][0])
                - Arithmetic.logFactorial(table[1][1])
                - Arithmetic.logFactorial(N);
        return Math.exp(pCutoff);
    }
 
开发者ID:BGI-flexlab,项目名称:SOAPgaea,代码行数:19,代码来源:StrandBiasTableUtils.java

示例4: setNandP

import cern.jet.math.Arithmetic; //导入方法依赖的package包/类
/**
 * Sets the parameters number of trials and the probability of success.
 * @param n the number of trials
 * @param p the probability of success.
 * @throws IllegalArgumentException if <tt>n*Math.min(p,1-p) &lt;= 0.0</tt>
 */
public void setNandP(int n, double p) {
	if (n*Math.min(p,1-p) <= 0.0) throw new IllegalArgumentException();
	this.n = n;
	this.p = p;
	
	this.log_p = Math.log(p);
	this.log_q = Math.log(1.0-p);
	this.log_n = Arithmetic.logFactorial(n);
}
 
开发者ID:dmcennis,项目名称:jAudioGIT,代码行数:16,代码来源:Binomial.java

示例5: fc_lnpk

import cern.jet.math.Arithmetic; //导入方法依赖的package包/类
private static double fc_lnpk(int k, int N_Mn, int M, int n) {
	return(Arithmetic.logFactorial(k) + Arithmetic.logFactorial(M - k) + Arithmetic.logFactorial(n - k) + Arithmetic.logFactorial(N_Mn + k));
}
 
开发者ID:dmcennis,项目名称:jAudioGIT,代码行数:4,代码来源:HyperGeometric.java

示例6: poissonLogPDF

import cern.jet.math.Arithmetic; //导入方法依赖的package包/类
/**
 * Computes the log-space PDF of the Poisson distribution with the
 * specified mean. Code lifted from the COLT Poisson class so that it can
 * be implemented as a static method instead of having to instantiate a
 * COLT Poisson object
 * @param mean
 * @param k
 * @return
 */
public static double poissonLogPDF(double mean, int k) {
  return k * Math.log(mean) - Arithmetic.logFactorial(k) - mean;
}
 
开发者ID:seqcode,项目名称:seqcode-core,代码行数:13,代码来源:Numerical.java


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