public class DistNormal extends DistContinuous
(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.
Modifier and Type | Field and Description |
---|---|
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
|
Constructor and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
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() |
protected double mu
protected double sigma
protected boolean haveNextNextGaussian
public static final double[] CUMULATIVE_NORMAL_PROPABILITIES
public DistNormal(StreamInterface stream)
stream
- the numberstreampublic DistNormal(StreamInterface stream, double mu, double sigma)
stream
- the numberstreammu
- the mediumsigma
- the standard deviationpublic double draw()
DistContinuous
draw
in class DistContinuous
DistContinuous.draw()
public double getCumulativeProbability(double x)
x
- the obsevervation xpublic double getInverseCumulativeProbability(double cumulativeProbability)
cumulativeProbability
- reflects cum probprotected double nextGaussian()
public double probDensity(double x)
DistContinuous
probDensity
in class DistContinuous
x
- the observation.#probDensity(double)
public String toString()
toString
in class Object
Object.toString()
Copyright © 2002-2012 Delft University of Technology, the Netherlands. All Rights Reserved.