org.apache.mahout.math.jet.random
Class Normal

java.lang.Object
  extended by org.apache.mahout.math.PersistentObject
      extended by org.apache.mahout.math.jet.random.AbstractDistribution
          extended by org.apache.mahout.math.jet.random.AbstractContinousDistribution
              extended by org.apache.mahout.math.jet.random.Normal
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.apache.mahout.math.function.DoubleFunction, IntFunction, UnaryFunction

public class Normal
extends AbstractContinousDistribution

Implements a normal distribution specified mean and standard deviation.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.mahout.math.jet.random.AbstractDistribution
randomGenerator
 
Constructor Summary
Normal(double mean, double standardDeviation, java.util.Random randomGenerator)
           
 
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 probability density function.
 void setRandomGenerator(java.util.Random randomGenerator)
          Sets the uniform random generator internally used.
 void setState(double mean, double standardDeviation)
          Sets the mean and variance.
 java.lang.String toString()
          Returns a String representation of the receiver.
 
Methods inherited from class org.apache.mahout.math.jet.random.AbstractContinousDistribution
nextInt
 
Methods inherited from class org.apache.mahout.math.jet.random.AbstractDistribution
apply, apply, getRandomGenerator
 
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
 

Constructor Detail

Normal

public Normal(double mean,
              double standardDeviation,
              java.util.Random randomGenerator)
Parameters:
mean - The mean of the resulting distribution.
standardDeviation - The standard deviation of the distribution.
randomGenerator - The random number generator to use. This can be null if you don't need to generate any numbers.
Method Detail

cdf

public double cdf(double x)
Returns the cumulative distribution function.

Overrides:
cdf in class AbstractContinousDistribution

pdf

public double pdf(double x)
Returns the probability density function.

Overrides:
pdf in class AbstractContinousDistribution

nextDouble

public double nextDouble()
Returns a random number from the distribution.

Specified by:
nextDouble in class AbstractDistribution
Returns:
A new sample from this distribution.

setRandomGenerator

public final void setRandomGenerator(java.util.Random randomGenerator)
Sets the uniform random generator internally used.

Overrides:
setRandomGenerator in class AbstractDistribution
Parameters:
randomGenerator - the new PRNG

setState

public final void setState(double mean,
                           double standardDeviation)
Sets the mean and variance.

Parameters:
mean - The new value for the mean.
standardDeviation - The new value for the standard deviation.

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.