Tabnine Logo
org.apache.commons.math.stat.descriptive
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.commons.math.stat.descriptive

Best Java code snippets using org.apache.commons.math.stat.descriptive (Showing top 20 results out of 315)

origin: apache/incubator-pinot

public void addValue(double value) {
 synchronized (_statistics) {
  _statistics.addValue(value);
 }
}
origin: apache/incubator-pinot

 public void clear() {
  synchronized (_statistics) {
   _statistics.clear();
  }
 }
}
origin: thinkaurelius/titan

public static void main(String[] args) {
  SummaryStatistics statObject = new SummaryStatistics();
  SummaryStatistics statByte = new SummaryStatistics();
  for (int i = 0; i < 10; i++) {
    statByte.addValue(testByte());
    statObject.addValue(testObject());
  }
  System.out.println("Time (ms) Object: " + statObject.getMean() + " | " + statObject.getStandardDeviation());
  System.out.println("Time (ms) Byte: " + statByte.getMean() + " | " + statByte.getStandardDeviation());
}
origin: org.apache.commons/commons-math

/**
 * Return a {@link StatisticalSummaryValues} instance reporting current
 * statistics.
 * @return Current values of statistics
 */
public StatisticalSummary getSummary() {
  return new StatisticalSummaryValues(getMean(), getVariance(), getN(),
      getMax(), getMin(), getSum());
}
origin: apache/incubator-pinot

protected void printSegmentAssignment(Map<String, Map<String, String>> mapping)
  throws Exception {
 LOGGER.info(JsonUtils.objectToPrettyString(mapping));
 Map<String, List<String>> serverToSegmentMapping = new TreeMap<>();
 for (String segment : mapping.keySet()) {
  Map<String, String> serverToStateMap = mapping.get(segment);
  for (String server : serverToStateMap.keySet()) {
   if (!serverToSegmentMapping.containsKey(server)) {
    serverToSegmentMapping.put(server, new ArrayList<>());
   }
   serverToSegmentMapping.get(server).add(segment);
  }
 }
 DescriptiveStatistics stats = new DescriptiveStatistics();
 for (String server : serverToSegmentMapping.keySet()) {
  List<String> list = serverToSegmentMapping.get(server);
  LOGGER.info("server " + server + " has " + list.size() + " segments");
  stats.addValue(list.size());
 }
 LOGGER.info("Segment Distrbution stat");
 LOGGER.info(stats.toString());
}
origin: apache/incubator-pinot

public void report() {
 synchronized (_statistics) {
  LOGGER.info("--------------------------------------------------------------------------------");
  LOGGER.info("{}:", _name);
  LOGGER.info(_statistics.toString());
  LOGGER.info("10th percentile: {}", _statistics.getPercentile(10.0));
  LOGGER.info("25th percentile: {}", _statistics.getPercentile(25.0));
  LOGGER.info("50th percentile: {}", _statistics.getPercentile(50.0));
  LOGGER.info("90th percentile: {}", _statistics.getPercentile(90.0));
  LOGGER.info("95th percentile: {}", _statistics.getPercentile(95.0));
  LOGGER.info("99th percentile: {}", _statistics.getPercentile(99.0));
  LOGGER.info("99.9th percentile: {}", _statistics.getPercentile(99.9));
  LOGGER.info("--------------------------------------------------------------------------------");
 }
}
origin: org.apache.commons/commons-math

/**
 * Return a {@link StatisticalSummaryValues} instance reporting current
 * aggregate statistics.
 *
 * @return Current values of aggregate statistics
 */
public StatisticalSummary getSummary() {
  synchronized (statistics) {
    return new StatisticalSummaryValues(getMean(), getVariance(), getN(),
        getMax(), getMin(), getSum());
  }
}
origin: org.apache.commons/commons-math

/**
 * Initializes a new AggregateSummaryStatistics with default statistics
 * implementations.
 *
 */
public AggregateSummaryStatistics() {
  this(new SummaryStatistics());
}
origin: apache/helix

public StatCollector() {
 _stats = new SynchronizedDescriptiveStatistics();
 _stats.setWindowSize(DEFAULT_WINDOW_SIZE);
}
origin: org.apache.commons/commons-math

/**
 * {@inheritDoc}.  This version returns a sum of all the aggregated data.
 *
 * @see StatisticalSummary#getSum()
 */
public double getSum() {
  synchronized (statistics) {
    return statistics.getSum();
  }
}
origin: org.apache.commons/commons-math

/**
 * Returns the <a href="http://www.xycoon.com/geometric_mean.htm">
 * geometric mean </a> of the available values
 * @return The geometricMean, Double.NaN if no values have been added,
 * or if the product of the available values is less than or equal to 0.
 */
public double getGeometricMean() {
  return apply(geometricMeanImpl);
}
origin: org.apache.commons/commons-math

/**
 * Construct a DescriptiveStatistics instance with the specified window
 *
 * @param window the window size.
 */
public DescriptiveStatistics(int window) {
  setWindowSize(window);
}
origin: JanusGraph/janusgraph

public static void main(String[] args) {
  SummaryStatistics statObject = new SummaryStatistics();
  SummaryStatistics statByte = new SummaryStatistics();
  for (int i = 0; i < 10; i++) {
    statByte.addValue(testByte());
    statObject.addValue(testObject());
  }
  System.out.println("Time (ms) Object: " + statObject.getMean() + " | " + statObject.getStandardDeviation());
  System.out.println("Time (ms) Byte: " + statByte.getMean() + " | " + statByte.getStandardDeviation());
}
origin: commons-math/commons-math

/**
 * Return a {@link StatisticalSummaryValues} instance reporting current
 * statistics.
 * 
 * @return Current values of statistics 
 */
public StatisticalSummary getSummary() {
  return new StatisticalSummaryValues(getMean(), getVariance(), getN(),
      getMax(), getMin(), getSum());
}

origin: apache/incubator-pinot

public static void generateReport(String dataFileName)
  throws IOException {
 List<DescriptiveStatistics> statisticsList = new ArrayList<>();
 String dataString;
 BufferedReader dataReader = new BufferedReader(new FileReader(dataFileName));
 // First line is treated as header
 String[] columns = dataReader.readLine().split("\\s+");
 int numColumns = columns.length;
 for (int i = 0; i < numColumns; ++i) {
  statisticsList.add(new DescriptiveStatistics());
 }
 while ((dataString = dataReader.readLine()) != null) {
  String[] dataArray = dataString.trim().split(" ");
  if (dataArray.length != numColumns) {
   throw new RuntimeException(
     "Row has missing columns: " + Arrays.toString(dataArray) + " Expected: " + numColumns + " columns.");
  }
  for (int i = 0; i < dataArray.length; ++i) {
   double data = Double.valueOf(dataArray[i]);
   statisticsList.get(i).addValue(data);
  }
 }
 for (int i = 0; i < numColumns; i++) {
  LOGGER.info("Stats: {}: {}", columns[i], statisticsList.get(i).toString().replace("\n", "\t"));
 }
}
origin: org.apache.commons/math

/**
 * Return a {@link StatisticalSummaryValues} instance reporting current
 * aggregate statistics.
 *
 * @return Current values of aggregate statistics
 */
public StatisticalSummary getSummary() {
  synchronized (statistics) {
    return new StatisticalSummaryValues(getMean(), getVariance(), getN(),
        getMax(), getMin(), getSum());
  }
}
origin: org.apache.commons/commons-math

/**
 * Returns the Kurtosis of the available values. Kurtosis is a
 * measure of the "peakedness" of a distribution
 * @return The kurtosis, Double.NaN if no values have been added, or 0.0
 * for a value set &lt;=3.
 */
public double getKurtosis() {
  return apply(kurtosisImpl);
}
origin: thinkaurelius/titan

@Test
public void testMemoryLeakage() {
  long memoryBaseline = 0;
  SummaryStatistics stats = new SummaryStatistics();
  int numRuns = 25;
  for (int r = 0; r < numRuns; r++) {
    if (r == 1 || r == (numRuns - 1)) {
      memoryBaseline = MemoryAssess.getMemoryUse();
      stats.addValue(memoryBaseline);
      //System.out.println("Memory before run "+(r+1)+": " + memoryBaseline / 1024 + " KB");
    }
    for (int t = 0; t < 1000; t++) {
      graph.addVertex();
      graph.tx().rollback();
      TitanTransaction tx = graph.newTransaction();
      tx.addVertex();
      tx.rollback();
    }
    if (r == 1 || r == (numRuns - 1)) {
      memoryBaseline = MemoryAssess.getMemoryUse();
      stats.addValue(memoryBaseline);
      //System.out.println("Memory after run " + (r + 1) + ": " + memoryBaseline / 1024 + " KB");
    }
    clopen();
  }
  System.out.println("Average: " + stats.getMean() + " Std. Dev: " + stats.getStandardDeviation());
  assertTrue(stats.getStandardDeviation() < stats.getMin());
}
origin: org.apache.commons/math

/**
 * Return a {@link StatisticalSummaryValues} instance reporting current
 * statistics.
 * @return Current values of statistics
 */
public StatisticalSummary getSummary() {
  return new StatisticalSummaryValues(getMean(), getVariance(), getN(),
      getMax(), getMin(), getSum());
}
origin: JanusGraph/janusgraph

@Test
public void testMemoryLeakage() {
  long memoryBaseline = 0;
  SummaryStatistics stats = new SummaryStatistics();
  int numRuns = 25;
  for (int r = 0; r < numRuns; r++) {
    if (r == 1 || r == (numRuns - 1)) {
      memoryBaseline = MemoryAssess.getMemoryUse();
      stats.addValue(memoryBaseline);
      //System.out.println("Memory before run "+(r+1)+": " + memoryBaseline / 1024 + " KB");
    }
    for (int t = 0; t < 1000; t++) {
      graph.addVertex();
      graph.tx().rollback();
      JanusGraphTransaction tx = graph.newTransaction();
      tx.addVertex();
      tx.rollback();
    }
    if (r == 1 || r == (numRuns - 1)) {
      memoryBaseline = MemoryAssess.getMemoryUse();
      stats.addValue(memoryBaseline);
      //System.out.println("Memory after run " + (r + 1) + ": " + memoryBaseline / 1024 + " KB");
    }
    clopen();
  }
  System.out.println("Average: " + stats.getMean() + " Std. Dev: " + stats.getStandardDeviation());
  assertTrue(stats.getStandardDeviation() < stats.getMin());
}
org.apache.commons.math.stat.descriptive

Most used classes

  • DescriptiveStatistics
    Maintains a dataset of values of a single variable and computes descriptive statistics based on stor
  • SummaryStatistics
    Computes summary statistics for a stream of data values added using the #addValue(double) method. T
  • Mean
    Computes the arithmetic mean of a set of values. Uses the definitional formula: mean = sum(x_i) /
  • StandardDeviation
    Computes the sample standard deviation. The standard deviation is the positive square root of the va
  • Percentile
    Provides percentile computation. There are several commonly used methods for estimating percentiles
  • Min,
  • Sum,
  • StatisticalSummary,
  • SynchronizedDescriptiveStatistics,
  • UnivariateStatistic,
  • SecondMoment,
  • SumOfSquares,
  • AbstractUnivariateStatistic,
  • AggregateSummaryStatistics,
  • MultivariateSummaryStatistics,
  • Variance,
  • AbstractStorelessUnivariateStatistic,
  • StatisticalSummaryValues,
  • StorelessUnivariateStatistic
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now