be.ac.ulg.montefiore.run.distributions
Class GaussianMixtureDistribution

java.lang.Object
  extended by be.ac.ulg.montefiore.run.distributions.GaussianMixtureDistribution
All Implemented Interfaces:
RandomDistribution, java.io.Serializable

public class GaussianMixtureDistribution
extends java.lang.Object
implements RandomDistribution

This class implements a Gaussian mixture distribution.

Author:
Jean-Marc Francois (based on code from Benjamin Chung)
See Also:
Serialized Form

Constructor Summary
GaussianMixtureDistribution(double[] means, double[] variances, double[] proportions)
          Creates a new pseudo-random, Gaussian mixture distribution.
GaussianMixtureDistribution(int nbGaussians)
          Creates a new pseudo-random, Gaussian mixture distribution.
 
Method Summary
 GaussianDistribution[] distributions()
          Returns the distributions composing this mixture.
 double generate()
          Generates a pseudo-random number.
 int nbGaussians()
          Returns the number of Gaussians composing this mixture.
 double probability(double n)
          Returns the probability (density) of a given number.
 double[] proportions()
          Returns the proportions of the distributions in this mixture.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GaussianMixtureDistribution

public GaussianMixtureDistribution(int nbGaussians)
Creates a new pseudo-random, Gaussian mixture distribution. It is made of Gaussian distributions evently distributed between 0 and 1 with a unitary variance.

Parameters:
nbGaussians - The number of distributions composing the mixture.

GaussianMixtureDistribution

public GaussianMixtureDistribution(double[] means,
                                   double[] variances,
                                   double[] proportions)
Creates a new pseudo-random, Gaussian mixture distribution. The mean values, variances and proportions of each distribution is given as an argument.

Parameters:
means - The mean values of the Gaussian distributions.
variances - The variances of the Gaussian distributions.
proportions - The mixing proportions. This array does not have to be normalized, but each element must be positive and the sum of its elements must be strictly positive.
Method Detail

nbGaussians

public int nbGaussians()
Returns the number of Gaussians composing this mixture.

Returns:
The number of Gaussians composing this mixture.

distributions

public GaussianDistribution[] distributions()
Returns the distributions composing this mixture.

Returns:
A copy of the distributions array.

proportions

public double[] proportions()
Returns the proportions of the distributions in this mixture. The sum of the proportions equals 1.

Returns:
A copy of the distributions' proportions array.

generate

public double generate()
Description copied from interface: RandomDistribution
Generates a pseudo-random number. The numbers generated by this function are drawn according to the pseudo-random distribution described by the object that implements it.

Specified by:
generate in interface RandomDistribution
Returns:
A pseudo-random number.

probability

public double probability(double n)
Description copied from interface: RandomDistribution
Returns the probability (density) of a given number.

Specified by:
probability in interface RandomDistribution
Parameters:
n - A number.


Copyright © 2004,2005 Jean-Marc François.