public static double varianceDouble ( double [ ] values , final int start , final int length ) { double mean = mean ( values , start , length ) ; double temp = 0 ; for ( int index = start ; index < length ; index ++ ) { double a = values [ index ] ; temp += ( mean - a ) * ( mean - a ) ; } return temp / length ; }
Calculate Variance .