distribution
Class BasicMultivariateMixture

java.lang.Object
  extended by distribution.BasicMultivariateDistribution
      extended by distribution.BasicMultivariateMixture
All Implemented Interfaces:
MultivariateDistribution, MultivariateMixture

public class BasicMultivariateMixture
extends BasicMultivariateDistribution
implements MultivariateMixture

Implements the functionality in MultivariateMixture.

Author:
dgorur

Field Summary
 
Fields inherited from class distribution.BasicMultivariateDistribution
randomEngine
 
Constructor Summary
BasicMultivariateMixture()
          Default constructor.
 
Method Summary
 void addComponent(MultivariateDistribution dist)
          Adds the given MultivariateDistribution to the list of components of this mixture.
 double densityAt(double[] x)
          Computes the density at the given point.
 MultivariateDistribution getComponent(int index)
          Returns the requested component of this mixture.
 java.util.ArrayList<MultivariateDistribution> getComponents()
          Returns the list of components as an ArrayList.
 cern.colt.list.DoubleArrayList getMixingPmf()
          Returns a DoubleArrayList containing the mixing p.m.f.
 void nextSample(double[] arr)
          Generates the next random sample of this distribution and places the result in the supplied array.
 void setComponent(int index, MultivariateDistribution dist)
          Sets the desired component of the mixing p.m.f.
 void setComponents(java.util.ArrayList<MultivariateDistribution> components)
          Sets the list of components.
 void setMixingPmf(double[] pmf)
          Sets the mixing p.m.f.
 void setMixingPmf(cern.colt.matrix.DoubleMatrix1D pmf)
          Sets the mixing p.m.f.
 void setSeed(int seed)
          Sets the seed for the random number generator of this distribution instance.
 
Methods inherited from class distribution.BasicMultivariateDistribution
densityAt, densityAt, densityAt, densityAt, getInputDimension, makeNextSample, makeNextSample, nextSample, nextSample, nextSample, setInputDimension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface distribution.MultivariateDistribution
densityAt, densityAt, densityAt, densityAt, getInputDimension, makeNextSample, makeNextSample, nextSample, nextSample, nextSample, setInputDimension
 

Constructor Detail

BasicMultivariateMixture

public BasicMultivariateMixture()
Default constructor. Creates an empty mixture.

Method Detail

addComponent

public void addComponent(MultivariateDistribution dist)
Adds the given MultivariateDistribution to the list of components of this mixture.

Parameters:
dist - the given MultivariateDistribution.

densityAt

public double densityAt(double[] x)
Description copied from interface: MultivariateDistribution
Computes the density at the given point.

Specified by:
densityAt in interface MultivariateDistribution
Parameters:
x - the given point.
Returns:
the density at the given point.

getComponent

public MultivariateDistribution getComponent(int index)
Description copied from interface: MultivariateMixture
Returns the requested component of this mixture.

Specified by:
getComponent in interface MultivariateMixture
Parameters:
index - the index of the required component.
Returns:
the specified component of this mixture.

getComponents

public java.util.ArrayList<MultivariateDistribution> getComponents()
Description copied from interface: MultivariateMixture
Returns the list of components as an ArrayList.

Specified by:
getComponents in interface MultivariateMixture
Returns:
a list of components in this mixture.

getMixingPmf

public cern.colt.list.DoubleArrayList getMixingPmf()
Description copied from interface: MultivariateMixture
Returns a DoubleArrayList containing the mixing p.m.f.

Specified by:
getMixingPmf in interface MultivariateMixture
Returns:
the mixing p.m.f. for the mixture.

nextSample

public void nextSample(double[] arr)
Description copied from interface: MultivariateDistribution
Generates the next random sample of this distribution and places the result in the supplied array.

Specified by:
nextSample in interface MultivariateDistribution
Parameters:
arr - array to store the result, cannot be null.

setComponent

public void setComponent(int index,
                         MultivariateDistribution dist)
Description copied from interface: MultivariateMixture
Sets the desired component of the mixing p.m.f.

Specified by:
setComponent in interface MultivariateMixture
Parameters:
index - the index of the desired component of the p.m.f.

setComponents

public void setComponents(java.util.ArrayList<MultivariateDistribution> components)
Description copied from interface: MultivariateMixture
Sets the list of components.

Specified by:
setComponents in interface MultivariateMixture
Parameters:
components - the given list of components.

setMixingPmf

public void setMixingPmf(double[] pmf)
Description copied from interface: MultivariateMixture
Sets the mixing p.m.f.

Specified by:
setMixingPmf in interface MultivariateMixture
Parameters:
pmf - the given mixing p.m.f.

setMixingPmf

public void setMixingPmf(cern.colt.matrix.DoubleMatrix1D pmf)
Description copied from interface: MultivariateMixture
Sets the mixing p.m.f.

Specified by:
setMixingPmf in interface MultivariateMixture
Parameters:
pmf - the given mixing p.m.f.

setSeed

public void setSeed(int seed)
Description copied from interface: MultivariateDistribution
Sets the seed for the random number generator of this distribution instance.

Specified by:
setSeed in interface MultivariateDistribution
Parameters:
seed - the given seed.