Example usage for org.apache.commons.math3.distribution LogNormalDistribution cumulativeProbability

List of usage examples for org.apache.commons.math3.distribution LogNormalDistribution cumulativeProbability

Introduction

In this page you can find the example usage for org.apache.commons.math3.distribution LogNormalDistribution cumulativeProbability.

Prototype

public double cumulativeProbability(double x) 

Source Link

Document

For scale m , and shape s of this distribution, the CDF is given by
  • 0 if x <= 0 ,
  • 0 if ln(x) - m < 0 and m - ln(x) > 40 * s , as in these cases the actual value is within Double.MIN_VALUE of 0,
  • 1 if ln(x) - m >= 0 and ln(x) - m > 40 * s , as in these cases the actual value is within Double.MIN_VALUE of 1,
  • 0.5 + 0.5 * erf((ln(x) - m) / (s * sqrt(2)) otherwise.

Usage

From source file:fr.assoba.open.perf.FindDist.java

/**
 * @param args/*from   www.j  a  v  a 2 s .c  o m*/
 */
public static void main(String[] args) {
    for (double s = 5; s < 9; s = s + 0.01) {
        for (double c = 0.5; c < 5; c = c + 0.01) {
            LogNormalDistribution distribution = new LogNormalDistribution(s, c);
            if ((distribution.cumulativeProbability(200) > .248)
                    && (distribution.cumulativeProbability(200) < .252)) {
                System.out.println(s + ":" + c);
                System.out.println("\t" + distribution.cumulativeProbability(200));
                System.out.println("\t" + distribution.cumulativeProbability(600));
                System.out.println("\t" + distribution.cumulativeProbability(1000 * 1000));
            }
        }
    }
}