org.apache.mahout.math.jet.random
Class Exponential
java.lang.Object
org.apache.mahout.math.PersistentObject
org.apache.mahout.math.jet.random.AbstractDistribution
org.apache.mahout.math.jet.random.AbstractContinousDistribution
org.apache.mahout.math.jet.random.Exponential
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, org.apache.mahout.math.function.DoubleFunction, IntFunction, UnaryFunction
public class Exponential
- extends AbstractContinousDistribution
- See Also:
- Serialized Form
Constructor Summary |
Exponential(double lambda,
java.util.Random randomGenerator)
Provides a negative exponential distribution given a rate parameter lambda and an underlying
random number generator. |
Method Summary |
double |
cdf(double x)
Returns the cumulative distribution function. |
double |
nextDouble()
Returns a random number from the distribution. |
double |
pdf(double x)
Returns the value of the probability density function at a particular point. |
void |
setState(double lambda)
Sets the rate parameter. |
java.lang.String |
toString()
Returns a String representation of the receiver. |
Methods inherited from class org.apache.mahout.math.PersistentObject |
clone |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Exponential
public Exponential(double lambda,
java.util.Random randomGenerator)
- Provides a negative exponential distribution given a rate parameter lambda and an underlying
random number generator. The mean of this distribution will be equal to 1/lambda.
- Parameters:
lambda
- The rate parameter of the distribution.randomGenerator
- The PRNG that is used to generate values.
cdf
public double cdf(double x)
- Returns the cumulative distribution function.
- Overrides:
cdf
in class AbstractContinousDistribution
- Parameters:
x
- The point at which the cumulative distribution function is to be evaluated.
- Returns:
- Returns the integral from -infinity to x of the PDF, also known as the cumulative distribution
function.
nextDouble
public double nextDouble()
- Returns a random number from the distribution.
- Specified by:
nextDouble
in class AbstractDistribution
- Returns:
- A new sample from this distribution.
pdf
public double pdf(double x)
- Returns the value of the probability density function at a particular point.
- Overrides:
pdf
in class AbstractContinousDistribution
- Parameters:
x
- The point at which the probability density function is to be evaluated.
- Returns:
- The value of the probability density function at the specified point.
setState
public void setState(double lambda)
- Sets the rate parameter.
- Parameters:
lambda
- The new value of the rate parameter.
toString
public java.lang.String toString()
- Returns a String representation of the receiver.
- Overrides:
toString
in class java.lang.Object
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.