@Grab(group='org.apache.commons', module='commons-math', version='2.2') import org.apache.commons.math.stat.correlation.* // 相関係数を求める list1 = [100, 110, 120, 130, 150, 80, 110] as double[] list2 = [102, 101, 100, 131, 155, 48, 100] as double[] pc = new PearsonsCorrelation() println "correlation coefficient:" + pc.correlation(list1, list2)動作環境
groovy 1.8.2, JDK6 Update27, Apache Commons Math 2.2
0 件のコメント:
コメントを投稿