public Double getVariance ( ) { if ( counter == 0 ) { return Double . NaN ; } else { final double mean = computeMean ( ) ; final double meanSquare = mean * mean ; final double squareMean = ( ( double ) squareTotal ) / counter ; return squareMean - meanSquare ; } }
Compute variance .