scalaで確率分布 正規分布(Normal Distribution)、ポアソン分布(Poisson Distribution)

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));

        }
}

実行

scala -cp "./commons-math3-3.1.1.jar" test.scala

結果

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