Java Code Examples for org.apache.commons.math3.stat.inference.TestUtils#tTest()

The following examples show how to use org.apache.commons.math3.stat.inference.TestUtils#tTest() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StatsUtil.java    From MeteoInfo with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * One sample t test
 * @param a Input data
 * @param mu Expected value in null hypothesis
 * @return t_statistic and p_value
 */
public static double[] tTest(Array a, double mu){
    double[] ad = (double[]) ArrayUtil.copyToNDJavaArray_Double(a);
    double s = TestUtils.t(mu, ad);
    double p = TestUtils.tTest(mu, ad);
    
    return new double[]{s, p};
}
 
Example 2
Source File: StatsUtil.java    From MeteoInfo with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * unpaired, two-sided, two-sample t-test.
 * 
 * @param a Sample a.
 * @param b Sample b.
 * @return t_statistic and p_value
 */
public static double[] tTest(Array a, Array b) {
    double[] ad = (double[]) ArrayUtil.copyToNDJavaArray_Double(a);
    double[] bd = (double[]) ArrayUtil.copyToNDJavaArray_Double(b);
    double s = TestUtils.t(ad, bd);
    double p = TestUtils.tTest(ad, bd);
    
    return new double[]{s, p};
}
 
Example 3
Source File: OwlSimPValue.java    From owltools with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public PValue getPValue(Set<OWLClass> candidates, IRI referenceEntity) throws OwlSimVarianceEntityReferenceNotFoundException {
	if (!refBasedStats.getReferenceStats().containsKey(referenceEntity)) {
		throw new OwlSimVarianceEntityReferenceNotFoundException(referenceEntity);
	}

	// Create IC list for candidates provided
	double[] icData = refBasedStats.retrieveCandidatesIC(candidates);
	List<double[]> sets = new ArrayList<double[]>();
	sets.add(icData);
	sets.add(refBasedStats.getReferenceStats().get(referenceEntity).getValues());

	return new PValue(TestUtils.tTest(refBasedStats.getReferenceStats().get(referenceEntity).getMean(), icData),
			TestUtils.oneWayAnovaPValue(sets), 
			TestUtils.kolmogorovSmirnovStatistic(icData, refBasedStats.getReferenceStats().get(referenceEntity).getValues()));
}
 
Example 4
Source File: BenchmarkUtils.java    From aws-sdk-java-v2 with Apache License 2.0 4 votes vote down vote up
private static boolean isDifferent(SdkBenchmarkStatistics current, SdkBenchmarkStatistics other, double confidence) {
    return TestUtils.tTest(current, other, 1 - confidence);
}
 
Example 5
Source File: ColumnCounter.java    From HMMRATAC with GNU General Public License v3.0 4 votes vote down vote up
private static double getonesidedPValue(double mu,double[] sample1){
	double PValue = TestUtils.tTest(mu, sample1);
	
	return PValue;
}
 
Example 6
Source File: SignificanceTester.java    From HMMRATAC with GNU General Public License v3.0 4 votes vote down vote up
private static double getonesidedPValue(double mu,double[] sample1){
	double PValue = TestUtils.tTest(mu, sample1);
	
	return PValue;
}
 
Example 7
Source File: ColumnCounter.java    From HMMRATAC with GNU General Public License v3.0 3 votes vote down vote up
private static double gettwosidedPValue(double[] sample1,double[] sample2){
	
	double PValue = TestUtils.tTest(sample1, sample2);
	return PValue;
	

}
 
Example 8
Source File: SignificanceTester.java    From HMMRATAC with GNU General Public License v3.0 3 votes vote down vote up
private static double gettwosidedPValue(double[] sample1,double[] sample2){
	
	double PValue = TestUtils.tTest(sample1, sample2);
	return PValue;
	

}