Package org.apache.commons.math.stat.descriptive

Examples of org.apache.commons.math.stat.descriptive.DescriptiveStatistics.addValue()


    for (int columns = 0; columns < peakList.length; columns++) {
      stdDevStats.clear();
      for (int row = 0; row < peakList[columns].length; row++) {
        if (!Double.isInfinite(peakList[columns][row])
            && !Double.isNaN(peakList[columns][row])) {
          stdDevStats.addValue(peakList[columns][row]);
        }
      }

      double stdDev = stdDevStats.getStandardDeviation();
View Full Code Here


                if (!Double.isInfinite(peak.getArea())
                    && !Double.isNaN(peak.getArea())) {

                  if (area) {

                    meanGroupStats.addValue(peak.getArea());
                  } else {

                    meanGroupStats.addValue(peak
                        .getHeight());
                  }
View Full Code Here

                  if (area) {

                    meanGroupStats.addValue(peak.getArea());
                  } else {

                    meanGroupStats.addValue(peak
                        .getHeight());
                  }
                }

              }
View Full Code Here

        int steps = (int) Math.max(1, Math.floor(density * size));
        int step = (int) Math.max(1, size / steps);
        if (step == last)
          break;
        for (int i = 0; i < 30; i++) {
          stats.addValue(insertTime(type, size, step)
              / (double) steps);
        }

        mems[index2++] = stats.getMean();
        last = step;
View Full Code Here

            List<Object> values = createRandomSample(uniques, (int) (uniques * 1.5));

            long actual = estimateGroupByCount(values);
            double error = (actual - uniques) * 1.0 / uniques;

            stats.addValue(error);
        }

        assertLessThan(stats.getMean(), 1.0e-2);
        assertLessThan(Math.abs(stats.getStandardDeviation() - ApproximateCountDistinctAggregation.getStandardError()), 1.0e-2);
    }
View Full Code Here

        for (int i = 0; i < 100; i++) {
            List<MaterializedTuple> values = computeActual("SELECT orderkey FROM ORDERS TABLESAMPLE BERNOULLI (50)").getMaterializedTuples();

            assertEquals(values.size(), ImmutableSet.copyOf(values).size(), "TABLESAMPLE produced duplicate rows");
            stats.addValue(values.size() * 1.0 / total);
        }

        double mean = stats.getGeometricMean();
        assertTrue(mean > 0.45 && mean < 0.55, format("Expected mean sampling rate to be ~0.5, but was %s", mean));
    }
View Full Code Here

        for (int i = 0; i < 100; i++) {
            List<MaterializedTuple> values = computeActual("SELECT orderkey FROM ORDERS TABLESAMPLE BERNOULLI (50)").getMaterializedTuples();

            assertEquals(values.size(), ImmutableSet.copyOf(values).size(), "TABLESAMPLE produced duplicate rows");
            stats.addValue(values.size() * 1.0 / total);
        }

        double mean = stats.getGeometricMean();
        assertTrue(mean > 0.45 && mean < 0.55, String.format("Expected mean sampling rate to be ~0.5, but was %s", mean));
    }
View Full Code Here

        for (int i = 0; i < 100; i++) {
            List<MaterializedTuple> values = computeActual("SELECT orderkey FROM ORDERS TABLESAMPLE BERNOULLI (50)").getMaterializedTuples();

            assertEquals(values.size(), ImmutableSet.copyOf(values).size(), "TABLESAMPLE produced duplicate rows");
            stats.addValue(values.size() * 1.0 / total);
        }

        double mean = stats.getGeometricMean();
        assertTrue(mean > 0.45 && mean < 0.55, String.format("Expected mean sampling rate to be ~0.5, but was %s", mean));
    }
View Full Code Here

            // Run test iterations, and capture the execution times
            int iterations = 0;
            long runtimeEnd = System.currentTimeMillis() + RUNTIME;
            while (iterations++ < 10
                    || System.currentTimeMillis() < runtimeEnd) {
                statistics.addValue(execute());
            }
        } finally {
            tearDown();
        }
View Full Code Here

            }

            // Run test iterations, and capture the execution times
            long runtimeEnd = System.currentTimeMillis() + runtime;
            while (System.currentTimeMillis() < runtimeEnd) {
                statistics.addValue(test.execute());
            }
        } finally {
            test.tearDown();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.