@Test public void test4(){ double[] v1 = new double[]{638, 398, 337, 529, 514}; double[] v2 = new double[]{689, 869, 383, 706, 620}; Asserts.assertEqualLength(v1, v2); Asserts.assertGreaterThanZero(v1); Asserts.assertGreaterThanZero(v2); double res = RMSLogSpectral.distance(v1, v2); Asserts.assertEquals(res, 0.38743696333733296); }
public static double distance(double[] v1,double[] v2){ double res=0; for(int i=0;i<v1.length;i++){ res += Math.pow(Math.log(v1[i])-Math.log(v2[i]),2); } return Math.sqrt(res/v1.length); }
RMSLogSpectral { public static double distance(double[] v1,double[] v2){ double res=0; for(int i=0;i<v1.length;i++){ res += Math.pow(Math.log(v1[i])-Math.log(v2[i]),2); } return Math.sqrt(res/v1.length); } }
RMSLogSpectral { public static double distance(double[] v1,double[] v2){ double res=0; for(int i=0;i<v1.length;i++){ res += Math.pow(Math.log(v1[i])-Math.log(v2[i]),2); } return Math.sqrt(res/v1.length); }  }
RMSLogSpectral { public static double distance(double[] v1,double[] v2){ double res=0; for(int i=0;i<v1.length;i++){ res += Math.pow(Math.log(v1[i])-Math.log(v2[i]),2); } return Math.sqrt(res/v1.length); }  static double distance(double[] v1,double[] v2); }
RMSLogSpectral { public static double distance(double[] v1,double[] v2){ double res=0; for(int i=0;i<v1.length;i++){ res += Math.pow(Math.log(v1[i])-Math.log(v2[i]),2); } return Math.sqrt(res/v1.length); }  static double distance(double[] v1,double[] v2);  }