Class Pearson


  • public final class Pearson
    extends java.lang.Object
    Here we compute Pearson correlation coefficient and turn that into a metric. We use the formula from https://en.wikipedia.org/wiki/Pearson_correlation_coefficient#For_a_sample for the Pearson computation. If input arrays are of different length we ignore the longer tail. In the end we turn Pearson's r into a metric moving it to the range 0..1
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double doubleMetric​(double[] a, double[] b)  
      static double floatMetric​(float[] a, float[] b)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • floatMetric

        public static double floatMetric​(float[] a,
                                         float[] b)
      • doubleMetric

        public static double doubleMetric​(double[] a,
                                          double[] b)