本文整理汇总了Java中org.apache.commons.math.distribution.ChiSquaredDistributionImpl.cumulativeProbability方法的典型用法代码示例。如果您正苦于以下问题:Java ChiSquaredDistributionImpl.cumulativeProbability方法的具体用法?Java ChiSquaredDistributionImpl.cumulativeProbability怎么用?Java ChiSquaredDistributionImpl.cumulativeProbability使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.math.distribution.ChiSquaredDistributionImpl
的用法示例。
在下文中一共展示了ChiSquaredDistributionImpl.cumulativeProbability方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: chiSquareTest
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入方法依赖的package包/类
/**
* @param counts array representation of 2-way table
* @return p-value
* @throws MathIllegalArgumentException if preconditions are not met
* @throws MathException if an error occurs computing the p-value
*/
public double chiSquareTest(long[][] counts)
throws MathException {
checkArray(counts);
double df = ((double) counts.length -1) * ((double) counts[0].length - 1);
distribution = new ChiSquaredDistributionImpl(df);
return 1 - distribution.cumulativeProbability(chiSquare(counts));
}
示例2: chiSquareTestDataSetsComparison
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入方法依赖的package包/类
/**
* @param observed1 array of observed frequency counts of the first data set
* @param observed2 array of observed frequency counts of the second data set
* @return p-value
* @throws MathIllegalArgumentException if preconditions are not met
* @throws MathException if an error occurs computing the p-value
* @since 1.2
*/
public double chiSquareTestDataSetsComparison(long[] observed1, long[] observed2)
throws MathException {
distribution = new ChiSquaredDistributionImpl((double) observed1.length - 1);
return 1 - distribution.cumulativeProbability(
chiSquareDataSetsComparison(observed1, observed2));
}