public static double ttest(double[] arrA, double[] arrB) { if ((arrA.length == 1) && (arrB.length == 1)) { // return a NULL value for score (does not make sense) return Double.NaN; } try { if (arrA.length == 1) { return ttest.tTest(arrA[0], arrB); } else if (arrB.length == 1) { return ttest.tTest(arrB[0], arrA); } else { return ttest.tTest(arrA, arrB); } } catch (Exception e) { e.printStackTrace(); return Double.NaN; } }
/** * @see org.apache.commons.math.stat.inference.TTest#homoscedasticTTest(double[], double[]) */ public static double homoscedasticTTest(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException { return tTest.homoscedasticTTest(sample1, sample2); }
/** * @see org.apache.commons.math.stat.inference.ChiSquareTest#chiSquareTest(double[], long[]) */ public static double chiSquareTest(double[] expected, long[] observed) throws IllegalArgumentException, MathException { return chiSquareTest.chiSquareTest(expected, observed); }
/** * @see org.apache.commons.math.stat.inference.ChiSquareTest#chiSquare(double[], long[]) */ public static double chiSquare(double[] expected, long[] observed) throws IllegalArgumentException { return chiSquareTest.chiSquare(expected, observed); }
/** * @see org.apache.commons.math.stat.inference.TTest#t(double, org.apache.commons.math.stat.descriptive.StatisticalSummary) */ public static double t(double mu, StatisticalSummary sampleStats) throws IllegalArgumentException { return tTest.t(mu, sampleStats); }
/** * @see org.apache.commons.math.stat.inference.TTest#pairedT(double[], double[]) */ public static double pairedT(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException { return tTest.pairedT(sample1, sample2); }
/** * @see org.apache.commons.math.stat.inference.UnknownDistributionChiSquareTest#chiSquareDataSetsComparison(long[], long[]) * * @since 1.2 */ public static double chiSquareDataSetsComparison(long[] observed1, long[] observed2) throws IllegalArgumentException { return unknownDistributionChiSquareTest.chiSquareDataSetsComparison(observed1, observed2); }
/** * @see org.apache.commons.math.stat.inference.OneWayAnova#anovaPValue(Collection) * * @since 1.2 */ public static double oneWayAnovaPValue(Collection<double[]> categoryData) throws IllegalArgumentException, MathException { return oneWayAnova.anovaPValue(categoryData); }
/** * @see org.apache.commons.math.stat.inference.UnknownDistributionChiSquareTest#chiSquareTestDataSetsComparison(long[], long[], double) * * @since 1.2 */ public static boolean chiSquareTestDataSetsComparison(long[] observed1, long[] observed2, double alpha) throws IllegalArgumentException, MathException { return unknownDistributionChiSquareTest.chiSquareTestDataSetsComparison(observed1, observed2, alpha); }
/** * Create a TTest instance. * * @return a new TTest instance */ public TTest createTTest() { return new TTestImpl(); }
private static double tTest(double d, List<Double> group) { try { double[] arr = listToArray(group); return ttest.tTest(d, arr); } catch (Exception e) { e.printStackTrace(); return Double.NaN; } }
/** * @see org.apache.commons.math.stat.inference.TTest#homoscedasticTTest(org.apache.commons.math.stat.descriptive.StatisticalSummary, org.apache.commons.math.stat.descriptive.StatisticalSummary) */ public static double homoscedasticTTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) throws IllegalArgumentException, MathException { return tTest.homoscedasticTTest(sampleStats1, sampleStats2); }
/** * @see org.apache.commons.math.stat.inference.ChiSquareTest#chiSquareTest(long[][], double) */ public static boolean chiSquareTest(long[][] counts, double alpha) throws IllegalArgumentException, MathException { return chiSquareTest. chiSquareTest(counts, alpha); }
/** * @see org.apache.commons.math.stat.inference.ChiSquareTest#chiSquare(long[][]) */ public static double chiSquare(long[][] counts) throws IllegalArgumentException { return chiSquareTest.chiSquare(counts); }
/** * @see org.apache.commons.math.stat.inference.TTest#t(double[], double[]) */ public static double t(double[] sample1, double[] sample2) throws IllegalArgumentException { return tTest.t(sample1, sample2); }
private static double tTest(List<Double> groupA, List<Double> groupB) { try { double[] arrA = listToArray(groupA); double[] arrB = listToArray(groupB); return ttest.tTest(arrA, arrB); } catch (Exception e) { e.printStackTrace(); return 0.0d; } }
/** * @see org.apache.commons.math.stat.inference.TTest#homoscedasticTTest(double[], double[], double) */ public static boolean homoscedasticTTest(double[] sample1, double[] sample2, double alpha) throws IllegalArgumentException, MathException { return tTest. homoscedasticTTest(sample1, sample2, alpha); }
/** * @see org.apache.commons.math.stat.inference.ChiSquareTest#chiSquareTest(long[][]) */ public static double chiSquareTest(long[][] counts) throws IllegalArgumentException, MathException { return chiSquareTest. chiSquareTest(counts); }
/** * @see org.apache.commons.math.stat.inference.TTest#tTest(double[], double[]) */ public static double tTest(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException { return tTest.tTest(sample1, sample2); }
/** * @see org.apache.commons.math.stat.inference.TTest#tTest(double, org.apache.commons.math.stat.descriptive.StatisticalSummary, double) */ public static boolean tTest(double mu, StatisticalSummary sampleStats, double alpha) throws IllegalArgumentException, MathException { return tTest. tTest(mu, sampleStats, alpha); }