import org.apache.commons.math3.distribution.NormalDistribution import org.apache.commons.math3.distribution.PoissonDistribution object test{ def main(args:Array[String])={ var norm=new NormalDistribution(1.0,0.5); println(norm.cumulativeProbability(1.2)); println(norm.density(1.2)); var poi=new PoissonDistribution(3.2); println(poi.cumulativeProbability(2)); println(poi.probability(4)); } }
実行
結果
0.6554217416103242
0.7365402806066468
0.3799037410783862
0.17809278666174724
参考:
http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/distribution/PoissonDistribution.html
http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/distribution/NormalDistribution.html
http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/distribution/package-summary.html#package_description