@Override public double[] compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch1 = (ArrayOfDoublesSketch) getFields().get(0).compute(combinedAggregators); final ArrayOfDoublesSketch sketch2 = (ArrayOfDoublesSketch) getFields().get(1).compute(combinedAggregators); if (sketch1.getNumValues() != sketch2.getNumValues()) { throw new IAE( "Sketches have different number of values: %d and %d", sketch1.getNumValues(), sketch2.getNumValues() ); } final SummaryStatistics[] stats1 = getStats(sketch1); final SummaryStatistics[] stats2 = getStats(sketch2); final int numberOfValues = sketch1.getNumValues(); final double[] pValues = new double[numberOfValues]; final TTest test = new TTest(); for (int i = 0; i < pValues.length; i++) { pValues[i] = test.tTest(stats1[i], stats2[i]); } return pValues; }
/** * Creates a new filter. * @param minSampleSize The minimum sample size before tests are used * to filter the entities. * @param alpha The alpha value for the test. 0.5 for 95% is recommended. */ public HeuristicConfidenceFilter(ConfidenceFilterSerializer serializer, int minSampleSize, double alpha) { this.serializer = serializer; this.minSampleSize = minSampleSize; this.alpha = alpha; ttest = new TTest(); }
@Override public Object doWork(Object value1, Object value2) throws IOException { TTest tTest = new TTest(); Map map = new HashMap(); Tuple tuple = new Tuple(map);
@Override public Object doWork(Object value1, Object value2) throws IOException { TTest tTest = new TTest(); Map map = new HashMap(); Tuple tuple = new Tuple(map);
LOGGER.trace(Arrays.toString(c2d)); TTest test = new TTest(); double p = test.pairedTTest(c1d, c2d); double r = ApproximateRandomization.test(1000, c1d, c2d);
/** * Returns the result of a two-tailed paired t-test. * Since n should always be greater 30, normality can be assumed. * @param otherAlgorithm - * @return the p-value result of a paired t-test */ public double getTTestPValue(HypothesisTestableMetric otherAlgorithm){ return new TTest().pairedTTest(getDetailedResults().toDoubleArray(), otherAlgorithm.getDetailedResults().toDoubleArray()); }
case StatisticsModel.INFER_TINT: if (tTestImpl == null) { tTestImpl = new TTest();
@Override public double[] compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch1 = (ArrayOfDoublesSketch) getFields().get(0).compute(combinedAggregators); final ArrayOfDoublesSketch sketch2 = (ArrayOfDoublesSketch) getFields().get(1).compute(combinedAggregators); if (sketch1.getNumValues() != sketch2.getNumValues()) { throw new IAE( "Sketches have different number of values: %d and %d", sketch1.getNumValues(), sketch2.getNumValues() ); } final SummaryStatistics[] stats1 = getStats(sketch1); final SummaryStatistics[] stats2 = getStats(sketch2); final int numberOfValues = sketch1.getNumValues(); final double[] pValues = new double[numberOfValues]; final TTest test = new TTest(); for (int i = 0; i < pValues.length; i++) { pValues[i] = test.tTest(stats1[i], stats2[i]); } return pValues; }
tTestImpl = new TTest();
tTestImpl = new TTest();