Example usage for org.apache.commons.math.distribution ExponentialDistributionImpl inverseCumulativeProbability

List of usage examples for org.apache.commons.math.distribution ExponentialDistributionImpl inverseCumulativeProbability

Introduction

In this page you can find the example usage for org.apache.commons.math.distribution ExponentialDistributionImpl inverseCumulativeProbability.

Prototype

@Override
public double inverseCumulativeProbability(double p) throws MathException 

Source Link

Document

For this distribution, X, this method returns the critical point x, such that P(X < x) = p.

Usage

From source file:de.tud.kom.p2psim.impl.util.stat.distributions.ExponentialDistribution.java

/**
 * returns a random value exponentially distributed with mu = _mu.
 * //from   w ww .ja v a  2  s .com
 * @param _mu
 * @return as double
 */
public static double returnValue(double _mu) {
    try {
        ExponentialDistributionImpl d = new ExponentialDistributionImpl(_mu);
        return d.inverseCumulativeProbability(Simulator.getRandom().nextDouble());
    } catch (MathException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        return 0;
    }
}