Package com.opengamma.analytics.math.statistics.distribution

Examples of com.opengamma.analytics.math.statistics.distribution.GammaDistribution.nextRandom()


    final double k = 0.97;
    final double theta = 0.46;
    final ProbabilityDistribution<Double> p1 = new GammaDistribution(k, theta, new MersenneTwister(MersenneTwister.DEFAULT_SEED));
    final double[] x = new double[n];
    for (int i = 0; i < n; i++) {
      x[i] = p1.nextRandom();
    }
    final GammaDistribution p2 = (GammaDistribution) CALCULATOR.evaluate(x);
    final double eps = 0.025;
    assertEquals(p2.getK(), k, eps);
    assertEquals(p2.getTheta(), theta, eps);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.