/** * @see org.apache.commons.math3.stat.inference.GTest#gTestDataSetsComparison(long[], long[]) * @since 3.1 */ public static double gTestDataSetsComparison(final long[] observed1, final long[] observed2) throws DimensionMismatchException, NotPositiveException, ZeroException, MaxCountExceededException { return G_TEST.gTestDataSetsComparison(observed1, observed2); }
/** * @see org.apache.commons.math3.stat.inference.GTest#gTestDataSetsComparison(long[],long[],double) * @since 3.1 */ public static boolean gTestDataSetsComparison(final long[] observed1, final long[] observed2, final double alpha) throws DimensionMismatchException, NotPositiveException, ZeroException, OutOfRangeException, MaxCountExceededException { return G_TEST.gTestDataSetsComparison(observed1, observed2, alpha); }
LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL, alpha, 0, 0.5); return gTestDataSetsComparison(observed1, observed2) < alpha;
/** * @see org.apache.commons.math3.stat.inference.GTest#gTestDataSetsComparison(long[],long[],double) * @since 3.1 */ public static boolean gTestDataSetsComparison(final long[] observed1, final long[] observed2, final double alpha) throws DimensionMismatchException, NotPositiveException, ZeroException, OutOfRangeException, MaxCountExceededException { return G_TEST.gTestDataSetsComparison(observed1, observed2, alpha); }
/** * @see org.apache.commons.math3.stat.inference.GTest#gTestDataSetsComparison(long[], long[]) * @since 3.1 */ public static double gTestDataSetsComparison(final long[] observed1, final long[] observed2) throws DimensionMismatchException, NotPositiveException, ZeroException, MaxCountExceededException { return G_TEST.gTestDataSetsComparison(observed1, observed2); }
@Override public Object doWork(Object value1, Object value2) throws IOException { List<Number> listA = (List<Number>) value1; List<Number> listB = (List<Number>) value2; long[] sampleA = new long[listA.size()]; long[] sampleB = new long[listB.size()]; for(int i=0; i<sampleA.length; i++) { sampleA[i] = listA.get(i).longValue(); } for(int i=0; i<sampleB.length; i++) { sampleB[i] = listB.get(i).longValue(); } GTest gTest = new GTest(); double g = gTest.gDataSetsComparison(sampleA, sampleB); double p = gTest.gTestDataSetsComparison(sampleA, sampleB); Map<String,Number> m = new HashMap<>(); m.put("G-statistic", g); m.put("p-value", p); return new Tuple(m); } }
LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL, alpha, 0, 0.5); return gTestDataSetsComparison(observed1, observed2) < alpha;
LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL, alpha, 0, 0.5); return gTestDataSetsComparison(observed1, observed2) < alpha;