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

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

Introduction

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

Prototype

double inverseCumulativeProbability(double p) throws MathException;

Source Link

Document

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

Usage

From source file:geogebra.kernel.statistics.AlgoInverseExponential.java

protected final void compute() {

    if (input[0].isDefined() && input[1].isDefined()) {
        double param = a.getDouble();
        double val = b.getDouble();
        try {/*from   w  w  w . j  ava  2 s.c  o m*/
            ExponentialDistribution dist = getExponentialDistribution(param);
            num.setValue(dist.inverseCumulativeProbability(val)); // P(T <= val)

        } catch (Exception e) {
            num.setUndefined();
        }
    } else
        num.setUndefined();
}

From source file:geogebra.common.kernel.statistics.AlgoInverseExponential.java

@Override
public final void compute() {

    if (input[0].isDefined() && input[1].isDefined()) {
        double param = a.getDouble();
        double val = b.getDouble();
        try {//w w  w. ja  v  a2  s  .co  m
            ExponentialDistribution dist = getExponentialDistribution(param);
            num.setValue(dist.inverseCumulativeProbability(val)); // P(T <=
            // val)

        } catch (Exception e) {
            num.setUndefined();
        }
    } else
        num.setUndefined();
}