@Override protected double test(double[] sample1, double[] sample2) { return pairedTTest(sample1, sample2); } }
/** * Perform a paired T-test on the F-Measures of two sets of values. * @param result1 The first value set. * @param result2 The second value set. * @param alpha The alpha value. * @return <code>true</code> iff the null hypothesis can be rejected with confidence <code>1 - alpha</code>. */ public static boolean performPairedTTest(double[] result1, double[] result2, double alpha) { // Null hypothesis - the hypothesis that there is no significant difference between specified populations, // any observed difference being due to sampling or experimental error. // Returns true iff the null hypothesis can be rejected with confidence 1 - alpha. return TestUtils.pairedTTest(result1, result2, alpha); }
p = TestUtils.pairedTTest(baselineValues, testValues); } else if ("wilcoxon".equals(method)) { p = new WilcoxonSignedRankTest().wilcoxonSignedRankTest(baselineValues, testValues, false);
/** * @param base int of the baseline to compare over * @param imp int of the alternative results that are tested for significant improvement * @return p-value of paired Student's T-test, 1-tailed. */ public double sigOver( int base, int imp ) { try { return TestUtils.pairedTTest(get(base).queryresult, get(imp).queryresult )/2; } catch (Exception ex) { log.fatalexception(ex, "sigOver( %d, %d)", base, imp); } return -2; } }
/** * @param base int of the baseline to compare over * @param imp int of the alternative results that are tested for significant improvement * @return p-value of paired Student's T-test, 1-tailed. */ public double sigOver( int base, int imp ) { try { return TestUtils.pairedTTest(get(base).queryresult, get(imp).queryresult )/2; } catch (Exception ex) { log.fatalexception(ex, "sigOver( %d, %d)", base, imp); } return -2; } }
public double getDouble(long... coordinates) { try { long var1 = coordinates[ROW]; long var2 = coordinates[COLUMN]; double[] sample1 = new double[(int) getSource().getRowCount()]; double[] sample2 = new double[(int) getSource().getRowCount()]; for (int r = 0; r < getSource().getRowCount(); r++) { sample1[r] = getSource().getAsDouble(r, var1); sample2[r] = getSource().getAsDouble(r, var2); } double pValue = TestUtils.pairedTTest(sample1, sample2); return pValue; } catch (Exception e) { throw new RuntimeException(e); } }
public double getDouble(long... coordinates) { try { long var1 = coordinates[ROW]; long var2 = coordinates[COLUMN]; double[] sample1 = new double[(int) getSource().getRowCount()]; double[] sample2 = new double[(int) getSource().getRowCount()]; for (int r = 0; r < getSource().getRowCount(); r++) { sample1[r] = getSource().getAsDouble(r, var1); sample2[r] = getSource().getAsDouble(r, var2); } double pValue = TestUtils.pairedTTest(sample1, sample2); return pValue; } catch (Exception e) { throw new RuntimeException(e); } }