MCPcopy Create free account
hub / github.com/antlr/codebuff / populationVariance

Method populationVariance

corpus/java/training/guava/math/Stats.java:216–225  ·  view source on GitHub ↗

Returns the population variance of the values. The count must be non-zero. This is guaranteed to return zero if the the dataset contains only exactly one finite value. It is not guaranteed to return zero when the dataset con

()

Source from the content-addressed store, hash-verified

214 * @throws IllegalStateException if the dataset is empty
215 */
216 public double populationVariance() {
217 checkState(count > 0);
218 if (isNaN(sumOfSquaresOfDeltas)) {
219 return NaN;
220 }
221 if (count == 1) {
222 return 0.0;
223 }
224 return ensureNonNegative(sumOfSquaresOfDeltas) / count();
225 }
226
227 /**
228 * Returns the

Callers 1

Calls 3

countMethod · 0.95
checkStateMethod · 0.45
ensureNonNegativeMethod · 0.45

Tested by

no test coverage detected