@Test public void testPPMCC() { double[] a = new double[] { 2, 3, 4, 5, 6 }; double[] b = new double[] { 2.2, 33.2, 44.4, 55.5, 66.6 }; PearsonsCorrelation corr = new PearsonsCorrelation(); double ppmcc = MathUtils.ppmcc(a, b); double correlation = corr.correlation(a, b); assertEquals(correlation, ppmcc, 0.001); }
public static double ppmcc(double[] a, double[] b) { double amean = MathUtils.mean(a); double aStdDev = MathUtils.standardDeviation(a, amean); double bmean = MathUtils.mean(b); double bStdDev = MathUtils.standardDeviation(b, bmean); double cor = (MathUtils.covariance(a, aStdDev, b, bmean)) / (aStdDev * bStdDev); return cor; }
MathUtils { public static double ppmcc(double[] a, double[] b) { double amean = MathUtils.mean(a); double aStdDev = MathUtils.standardDeviation(a, amean); double bmean = MathUtils.mean(b); double bStdDev = MathUtils.standardDeviation(b, bmean); double cor = (MathUtils.covariance(a, aStdDev, b, bmean)) / (aStdDev * bStdDev); return cor; } }
MathUtils { public static double ppmcc(double[] a, double[] b) { double amean = MathUtils.mean(a); double aStdDev = MathUtils.standardDeviation(a, amean); double bmean = MathUtils.mean(b); double bStdDev = MathUtils.standardDeviation(b, bmean); double cor = (MathUtils.covariance(a, aStdDev, b, bmean)) / (aStdDev * bStdDev); return cor; }  }
MathUtils { public static double ppmcc(double[] a, double[] b) { double amean = MathUtils.mean(a); double aStdDev = MathUtils.standardDeviation(a, amean); double bmean = MathUtils.mean(b); double bStdDev = MathUtils.standardDeviation(b, bmean); double cor = (MathUtils.covariance(a, aStdDev, b, bmean)) / (aStdDev * bStdDev); return cor; }  static double ppmcc(double[] a, double[] b); static double mean(double[] a); static long mean(long[] a); static double covariance(double[] a, double amean, double[] b, double bmean); static long standardDeviation(long[] a, long avg); static double standardDeviation(double[] a, double avg); static double[] ppmcc(double[][] ary, int baseIndex); }
MathUtils { public static double ppmcc(double[] a, double[] b) { double amean = MathUtils.mean(a); double aStdDev = MathUtils.standardDeviation(a, amean); double bmean = MathUtils.mean(b); double bStdDev = MathUtils.standardDeviation(b, bmean); double cor = (MathUtils.covariance(a, aStdDev, b, bmean)) / (aStdDev * bStdDev); return cor; }  static double ppmcc(double[] a, double[] b); static double mean(double[] a); static long mean(long[] a); static double covariance(double[] a, double amean, double[] b, double bmean); static long standardDeviation(long[] a, long avg); static double standardDeviation(double[] a, double avg); static double[] ppmcc(double[][] ary, int baseIndex);  }