nl.tudelft.simulation.jstats.distributions
Class DistNormal

java.lang.Object
  extended by nl.tudelft.simulation.jstats.distributions.Dist
      extended by nl.tudelft.simulation.jstats.distributions.DistContinuous
          extended by nl.tudelft.simulation.jstats.distributions.DistNormal
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DistLogNormal

public class DistNormal
extends DistContinuous

The Normal distribution. For more information on this distribution see http://mathworld.wolfram.com/NormalDistribution.html

(c) copyright 2002-2004 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Since:
1.2
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:25:42 $
Author:
Alexander Verbraeck
Peter Jacobs
See Also:
Serialized Form

Field Summary
static double[] CUMULATIVE_NORMAL_PROPABILITIES
          CUMULATIVE_NORMAL_PROPABILITIES represents the NORMAL DISTRIBUTION FUNCTION TABLE.
protected  boolean haveNextNextGaussian
          haveNextNextGaussian is a helper attribute
protected  double mu
          mu refers to the mean of the normal distribution
protected  double sigma
          mu refers to the mean of the normal distribution
 
Fields inherited from class nl.tudelft.simulation.jstats.distributions.Dist
stream
 
Constructor Summary
DistNormal(StreamInterface stream)
          constructs a normal distribution with mu=0 and sigma=1.
DistNormal(StreamInterface stream, double mu, double sigma)
          constructs a normal distribution with mu=0 and sigma=1
 
Method Summary
 double draw()
          draws the next stream value according to the probability of this this distribution.
 double getCumulativeProbability(double x)
          returns the cumulative probability of the x-value.
 double getInverseCumulativeProbability(double cumulativeProbability)
          returns the x-value of the given cumulativePropability.
protected  double nextGaussian()
          Generates the next pseudorandom, Gaussian (normally) distributed double value, with mean 0.0 and standard deviation 1.0 see section 3.4.1 of The Art of Computer Programming, Volume 2 by Donald Knuth.
 double probDensity(double x)
          returns the propbability density value of an observation
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mu

protected double mu
mu refers to the mean of the normal distribution


sigma

protected double sigma
mu refers to the mean of the normal distribution


haveNextNextGaussian

protected boolean haveNextNextGaussian
haveNextNextGaussian is a helper attribute


CUMULATIVE_NORMAL_PROPABILITIES

public static final double[] CUMULATIVE_NORMAL_PROPABILITIES
CUMULATIVE_NORMAL_PROPABILITIES represents the NORMAL DISTRIBUTION FUNCTION TABLE. In order to keep this table as fast as possible no x values are stored. The range of the tabel is {0.00,0.01,0.02,...,10.00}

Constructor Detail

DistNormal

public DistNormal(StreamInterface stream)
constructs a normal distribution with mu=0 and sigma=1. Errors of various types, e.g., in the impact point of a bomb; quantities that are the sum of a large number of other quantities by the vitue of the central limit theorem.

Parameters:
stream - the numberstream

DistNormal

public DistNormal(StreamInterface stream,
                  double mu,
                  double sigma)
constructs a normal distribution with mu=0 and sigma=1

Parameters:
stream - the numberstream
mu - the medium
sigma - the standard deviation
Method Detail

draw

public double draw()
Description copied from class: DistContinuous
draws the next stream value according to the probability of this this distribution.

Specified by:
draw in class DistContinuous
Returns:
the next double value drawn.
See Also:
DistContinuous.draw()

getCumulativeProbability

public double getCumulativeProbability(double x)
returns the cumulative probability of the x-value.

Parameters:
x - the obsevervation x
Returns:
double the cumulative probability

getInverseCumulativeProbability

public double getInverseCumulativeProbability(double cumulativeProbability)
returns the x-value of the given cumulativePropability.

Parameters:
cumulativeProbability - reflects cum prob
Returns:
double the inverse cumulative probability

nextGaussian

protected double nextGaussian()
Generates the next pseudorandom, Gaussian (normally) distributed double value, with mean 0.0 and standard deviation 1.0 see section 3.4.1 of The Art of Computer Programming, Volume 2 by Donald Knuth.

Returns:
double the next gaussian value

probDensity

public double probDensity(double x)
Description copied from class: DistContinuous
returns the propbability density value of an observation

Specified by:
probDensity in class DistContinuous
Parameters:
x - the observation.
Returns:
double the probability density.
See Also:
#probDensity(double)

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2002-2011 Delft University of Technology, the Netherlands. All Rights Reserved.