de.unidu.is.statistics
Class NormalDistribution

java.lang.Object
  extended byde.unidu.is.statistics.Distribution
      extended byde.unidu.is.statistics.NormalDistribution

public class NormalDistribution
extends Distribution

An class modelling a normal (Gaussian) probabilistic distributions.

The normal distribution is defined by the expectation E(x) and the variance E((x^2 - * E(x)^2).

Since:
2002-04-09
Version:
$Revision: 1.11 $, $Date: 2005/03/19 16:13:23 $
Author:
Henrik Nottelmann

Field Summary
protected  Moments moments
          Moments of the normal distribution.
 
Constructor Summary
NormalDistribution()
          Constructs a new object.
NormalDistribution(double expectation, double variance)
          Constructs a new normal distribution, based on the specified expectation and variance.
NormalDistribution(Moments moments)
          Constructs a new normal distribution, based on the specified expectation and variance.
 
Method Summary
 void computeValues(int num, double[] ret)
          Computes actual values based on the underlying normal distribution when having the specified number of items, and writes them in decreasing order into the specified array (as many values as possible).
 double getExpectation()
          Returns the expectation of this normal distribution.
 Moments getMoments()
          Returns the moments of this normal distribution.
 double getVariance()
          Returns the variance of this normal distribution.
 double inverse(double y)
          The point a such that the integral from -infinity to a equals y.
 void setMoments(Moments moments)
          Sets the moments.
 
Methods inherited from class de.unidu.is.statistics.Distribution
computeValues, eliminateZero
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

moments

protected Moments moments
Moments of the normal distribution.

Constructor Detail

NormalDistribution

public NormalDistribution()
Constructs a new object.


NormalDistribution

public NormalDistribution(Moments moments)
Constructs a new normal distribution, based on the specified expectation and variance.

Parameters:
moments - moments of the normal distribution

NormalDistribution

public NormalDistribution(double expectation,
                          double variance)
Constructs a new normal distribution, based on the specified expectation and variance.

Parameters:
expectation - expectation of the normal distribution
variance - variance of the normal distribution
Method Detail

inverse

public double inverse(double y)
The point a such that the integral from -infinity to a equals y.

Parameters:
y - y
Returns:
a

computeValues

public void computeValues(int num,
                          double[] ret)
Computes actual values based on the underlying normal distribution when having the specified number of items, and writes them in decreasing order into the specified array (as many values as possible).

Specified by:
computeValues in class Distribution
Parameters:
num - number of items in total
ret - array for the actual values

getExpectation

public double getExpectation()
Returns the expectation of this normal distribution.

Returns:
expectation

getVariance

public double getVariance()
Returns the variance of this normal distribution.

Returns:
variance

getMoments

public Moments getMoments()
Returns the moments of this normal distribution.

Returns:
moments

setMoments

public void setMoments(Moments moments)
Sets the moments.

Parameters:
moments - moments to set.