本文整理汇总了Java中org.apache.commons.math.distribution.ChiSquaredDistributionImpl类的典型用法代码示例。如果您正苦于以下问题:Java ChiSquaredDistributionImpl类的具体用法?Java ChiSquaredDistributionImpl怎么用?Java ChiSquaredDistributionImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChiSquaredDistributionImpl类属于org.apache.commons.math.distribution包,在下文中一共展示了ChiSquaredDistributionImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pchisq
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入依赖的package包/类
public static double pchisq(final double q, final double df, boolean lowerTail, boolean logP) {
if(df == 0) {
return p(new ChisquareZeroDfDistribution(), q, lowerTail, logP);
} else {
return p(new ChiSquaredDistributionImpl(df), q, lowerTail, logP);
}
}
示例2: qchisq
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入依赖的package包/类
public static double qchisq(final double p, final double df, boolean lowerTail, boolean logP) {
if(df == 0) {
return q(new ChisquareZeroDfDistribution(), p, lowerTail, logP);
} else {
return q(new ChiSquaredDistributionImpl(df), p, lowerTail, logP);
}
}
示例3: 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));
}
示例4: testNextChiSquare
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入依赖的package包/类
public void testNextChiSquare() throws Exception {
double[] quartiles = TestUtils.getDistributionQuartiles(new ChiSquaredDistributionImpl(12));
long[] counts = new long[4];
randomData.reSeed(1000);
for (int i = 0; i < 1000; i++) {
double value = randomData.nextChiSquare(12);
TestUtils.updateCounts(value, counts, quartiles);
}
TestUtils.assertChiSquareAccept(expected, counts, 0.001);
}
示例5: testNextChiSquare
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入依赖的package包/类
@Test
public void testNextChiSquare() throws Exception {
double[] quartiles = TestUtils.getDistributionQuartiles(new ChiSquaredDistributionImpl(12));
long[] counts = new long[4];
randomData.reSeed(1000);
for (int i = 0; i < 1000; i++) {
double value = randomData.nextChiSquare(12);
TestUtils.updateCounts(value, counts, quartiles);
}
TestUtils.assertChiSquareAccept(expected, counts, 0.001);
}
示例6: pchisq
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入依赖的package包/类
public static double pchisq(@Recycle double q, @Recycle double df, boolean lowerTail, boolean logP) {
if(df == 0) {
return p(new ChisquareZeroDfDistribution(), q, lowerTail, logP);
} else {
return p(new ChiSquaredDistributionImpl(df), q, lowerTail, logP);
}
}
示例7: qchisq
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入依赖的package包/类
public static double qchisq(@Recycle double p, @Recycle double df, boolean lowerTail, boolean logP) {
if(df == 0) {
return q(new ChisquareZeroDfDistribution(), p, lowerTail, logP);
} else {
return q(new ChiSquaredDistributionImpl(df), p, lowerTail, logP);
}
}
示例8: ChiSquareTestImpl
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入依赖的package包/类
/**
* Construct a ChiSquareTestImpl
*/
public ChiSquareTestImpl() {
this(new ChiSquaredDistributionImpl(1.0));
}
示例9: dchisq
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入依赖的package包/类
public static double dchisq(final double x, final double df, boolean log) {
return d(new ChiSquaredDistributionImpl(df), x, log);
}
示例10: ChiSquareTestImpl
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入依赖的package包/类
/**
* Construct a ChiSquareTestImpl
*/
public ChiSquareTestImpl() {
this(new ChiSquaredDistributionImpl(1.0));
}
示例11: criticalValue
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入依赖的package包/类
public double criticalValue(double alpha) throws MathException {
ChiSquaredDistribution XS = new ChiSquaredDistributionImpl(k - 1);
return XS.inverseCumulativeProbability(1.0 - alpha);
}
示例12: criticalValue
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入依赖的package包/类
public double criticalValue(double alpha) throws MathException {
ChiSquaredDistribution XS = new ChiSquaredDistributionImpl(m - 1);
return XS.inverseCumulativeProbability(1.0 - alpha);
}
示例13: dchisq
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入依赖的package包/类
public static double dchisq(@Recycle double x, @Recycle double df, boolean log) {
return d(new ChiSquaredDistributionImpl(df), x, log);
}
示例14: 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));
}
示例15: nextChiSquare
import org.apache.commons.math.distribution.ChiSquaredDistributionImpl; //导入依赖的package包/类
/**
* Generates a random value from the {@link ChiSquaredDistributionImpl ChiSquare Distribution}.
* This implementation uses {@link #nextInversionDeviate(ContinuousDistribution) inversion}
* to generate random values.
*
* @param df the degrees of freedom of the ChiSquare distribution
* @return random value sampled from the ChiSquare(df) distribution
* @throws MathException if an error occurs generating the random value
* @since 2.2
*/
public double nextChiSquare(double df) throws MathException {
return nextInversionDeviate(new ChiSquaredDistributionImpl(df));
}