public static double rootMeansSquaredError(double[] real,double[] predicted){
  double ret=0.0;
  for (int i=0; i < real.length; i++) {
    ret+=Math.pow((real[i] - predicted[i]),2);
  }
  return Math.sqrt(ret / real.length);
}

public static double rootMeansSquaredError ( double [ ] real , double [ ] predicted ) { double ret = 0.0 ; for ( int i = 0 ; i < real . length ; i ++ ) { ret += Math . pow ( ( real [ i ] - predicted [ i ] ) , 2 ) ; } return Math . sqrt ( ret / real . length ) ; }
this returns the root mean squared error of two data sets
