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

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


    final double mu = -1.3;
    final double sigma = 0.4;
    final ProbabilityDistribution<Double> p1 = new NormalDistribution(mu, sigma, new MersenneTwister64(MersenneTwister.DEFAULT_SEED));
    final double[] x = new double[n];
    for (int i = 0; i < n; i++) {
      x[i] = p1.nextRandom();
    }
    final NormalDistribution p2 = (NormalDistribution) ESTIMATOR.evaluate(x);
    assertEquals(p2.getMean(), mu, eps);
    assertEquals(p2.getStandardDeviation(), sigma, eps);
  }
View Full Code Here


    final double mu = 4.5;
    final double sigma = 0.86;
    final ProbabilityDistribution<Double> p1 = new NormalDistribution(mu, sigma, new MersenneTwister64(MersenneTwister.DEFAULT_SEED));
    final double[] x = new double[n];
    for (int i = 0; i < n; i++) {
      x[i] = p1.nextRandom();
    }
    final NormalDistribution p2 = (NormalDistribution) CALCULATOR.evaluate(x);
    assertEquals(p2.getMean(), mu, 2.5e-2);
    assertEquals(p2.getStandardDeviation(), sigma, 2.5e-2);
  }
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.