Example usage for org.apache.commons.math3.stat.descriptive.moment Variance evaluate

List of usage examples for org.apache.commons.math3.stat.descriptive.moment Variance evaluate

Introduction

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

Prototype

public double evaluate(final double[] values, final double mean, final int begin, final int length)
        throws MathIllegalArgumentException 

Source Link

Document

Returns the variance of the entries in the specified portion of the input array, using the precomputed mean value.

Usage

From source file:pt.minha.calibration.AbstractBenchmark.java

protected Result stop(boolean interarrival) {
    double cpu = ((double) (mxbean.getCurrentThreadCpuTime() - cputime)) / idx;
    if (interarrival) {
        for (int i = idx - 1; i > 0; i--)
            times[i] -= times[i - 1];/*from  w ww .j  av a 2s .c o  m*/
        begin = 1;
    }
    Mean mean = new Mean();
    double m = mean.evaluate(times, begin, idx - begin);
    Variance var = new Variance();
    double v = var.evaluate(times, m, begin, idx - begin);
    return new Result(m, v, cpu);
}