Example usage for org.apache.commons.math3.distribution ExponentialDistribution ExponentialDistribution

List of usage examples for org.apache.commons.math3.distribution ExponentialDistribution ExponentialDistribution

Introduction

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

Prototype

public ExponentialDistribution(RandomGenerator rng, double mean, double inverseCumAccuracy)
        throws NotStrictlyPositiveException 

Source Link

Document

Creates an exponential distribution.

Usage

From source file:com.anhth12.distributions.Distributions.java

public static RealDistribution exponential(RandomGenerator rng, double mean) {
    if (exponentialDist.get(rng, mean) == null) {
        RealDistribution ret = new ExponentialDistribution(rng, 1.0,
                ExponentialDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
        exponentialDist.put(rng, mean, ret);
    }//from  w w w .ja  v a2 s. c o  m
    return exponentialDist.get(rng, mean);
}