public static double determinationCoefficient(double[] y1,double[] y2,int n){
  return Math.pow(correlation(y1,y2),2);
}

public static double determinationCoefficient ( double [ ] y1 , double [ ] y2 , int n ) { return Math . pow ( correlation ( y1 , y2 ) , 2 ) ; }
this returns the determination coefficient of two vectors given a length
