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
()
| 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 |
no test coverage detected