Package org.apache.commons.math.distribution

Examples of org.apache.commons.math.distribution.BinomialDistributionImpl.probability()


  public static double binomialProbEqualGreater(int trials, int success, double prob) throws MathException {
    BinomialDistribution bd = new BinomialDistributionImpl(trials, prob);
    double score = 0;
    for(int i=success;i<=trials;i++) {
      score += bd.probability(i);
    }
    //double score = bd.cumulativeProbability(success-1);
    System.out.println("bd:\t" + trials + "\t" + success + "\t" + prob + "\t" + (1.0-score) + "\t" + bd.cumulativeProbability(success-1));
    return 1.0 - score;
  }
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.