Example usage for org.apache.commons.math3.stat.descriptive StatisticalSummaryValues StatisticalSummaryValues

List of usage examples for org.apache.commons.math3.stat.descriptive StatisticalSummaryValues StatisticalSummaryValues

Introduction

In this page you can find the example usage for org.apache.commons.math3.stat.descriptive StatisticalSummaryValues StatisticalSummaryValues.

Prototype

public StatisticalSummaryValues(double mean, double variance, long n, double max, double min, double sum) 

Source Link

Document

Constructor

Usage

From source file:com.teradata.benchto.driver.graphite.GraphiteMetricsLoader.java

private Optional<StatisticalSummary> getStats(Map<String, double[]> loadedMetrics, String metricName) {
    double[] metricValues = loadedMetrics.get(metricName);
    if (metricValues.length >= 2) {
        return Optional.of(new DescriptiveStatistics(metricValues));
    } else if (metricValues.length == 1) {
        double value = metricValues[0];
        return Optional.of(new StatisticalSummaryValues(value, 0, 1, value, value, value));
    } else {/*ww  w  . j  a v  a2s  .  com*/
        return Optional.empty();
    }
}

From source file:org.briljantframework.statistics.FastStatistics.java

public StatisticalSummary getSummary() {
    return new StatisticalSummaryValues(getMean(), getVariance(), getN(), getMax(), getMin(), getSum());
}