Example usage for Java org.apache.commons.math.stat.descriptive.moment Variance fields, constructors, methods, implement or subclass
The text is from its open source code.
Variance() Constructs a Variance with default (true) isBiasCorrected property. | |
Variance(final SecondMoment m2) Constructs a Variance based on an external second moment. | |
Variance(boolean isBiasCorrected) Constructs a Variance with the specified isBiasCorrected property | |
Variance(Variance original) Copy constructor, creates a new Variance identical to the original |
double | evaluate(final double[] values) Returns the variance of the entries in the input array, or Double.NaN if the array is empty. |
double | evaluate(final double[] values, final double[] weights) Returns the weighted variance of the entries in the the input array. Uses the formula Σ(weights[i]*(values[i] - weightedMean)2)/(Σ(weights[i]) - 1)where weightedMean is the weighted mean This formula will not return the same result as the unweighted variance when all weights are equal, unless all weights are equal to 1. |
double | evaluate(final double[] values, final double mean) Returns the variance of the entries in the input array, using the precomputed mean value. |
double | getResult() |
void | increment(final double d) If all values are available, it is more accurate to use #evaluate(double[]) rather than adding values one at a time using this method and then executing #getResult , since |
void | incrementAll(double[] values) This default implementation just calls #increment in a loop over the input array. |