private double mean(double[] vec){
  double result=0;
  for (int i=0; i < vec.length; i++)   result+=vec[i];
  return result / vec.length;
}

private double mean ( double [ ] vec ) { double result = 0 ; for ( int i = 0 ; i < vec . length ; i ++ ) result += vec [ i ] ; return result / vec . length ; }
the mean of the values in the double array
