gov.sandia.cognition.statistics.distribution
Class MultivariateGaussianInverseGammaDistribution

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.statistics.AbstractDistribution<Vector>
          extended by gov.sandia.cognition.statistics.distribution.MultivariateGaussianInverseGammaDistribution
All Implemented Interfaces:
Vectorizable, ClosedFormDistribution<Vector>, Distribution<Vector>, DistributionWithMean<Vector>, CloneableSerializable, Serializable, Cloneable

public class MultivariateGaussianInverseGammaDistribution
extends AbstractDistribution<Vector>
implements ClosedFormDistribution<Vector>

A distribution where the mean is selected by a multivariate Gaussian and a variance parameter (either for a univariate Gaussian or isotropic Gaussian) is determined by an Inverse-Gamma distribution.

Since:
3.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Field Summary
static int DEFAULT_DIMENSIONALITY
          Default dimensionality, 2.
protected  MultivariateGaussian gaussian
          Gaussian component
protected  InverseGammaDistribution inverseGamma
          Inverse-Gamma component
 
Constructor Summary
MultivariateGaussianInverseGammaDistribution()
          Default constructor
MultivariateGaussianInverseGammaDistribution(int dimensionality)
          Creates a new instance of MultivariateGaussianInverseGammaDistribution
MultivariateGaussianInverseGammaDistribution(MultivariateGaussian gaussian, InverseGammaDistribution inverseGamma)
          Creates a new instance of MultivariateGaussianInverseGammaDistribution
 
Method Summary
 MultivariateGaussianInverseGammaDistribution clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 void convertFromVector(Vector parameters)
          Converts the object from a Vector of parameters.
 Vector convertToVector()
          Converts the object to a vector.
 MultivariateGaussian getGaussian()
          Getter for gaussian
 InverseGammaDistribution getInverseGamma()
          Getter for inverseGamma
 Vector getMean()
          Gets the arithmetic mean, or "first central moment" or "expectation", of the distribution.
 ArrayList<Vector> sample(Random random, int numSamples)
          Draws multiple random samples from the distribution.
 void setGaussian(MultivariateGaussian gaussian)
          Setter for gaussian
 void setInverseGamma(InverseGammaDistribution inverseGamma)
          Setter for inverseGamma
 
Methods inherited from class gov.sandia.cognition.statistics.AbstractDistribution
sample
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.statistics.Distribution
sample
 

Field Detail

DEFAULT_DIMENSIONALITY

public static final int DEFAULT_DIMENSIONALITY
Default dimensionality, 2.

See Also:
Constant Field Values

gaussian

protected MultivariateGaussian gaussian
Gaussian component


inverseGamma

protected InverseGammaDistribution inverseGamma
Inverse-Gamma component

Constructor Detail

MultivariateGaussianInverseGammaDistribution

public MultivariateGaussianInverseGammaDistribution()
Default constructor


MultivariateGaussianInverseGammaDistribution

public MultivariateGaussianInverseGammaDistribution(int dimensionality)
Creates a new instance of MultivariateGaussianInverseGammaDistribution

Parameters:
dimensionality - Dimensionality of the multivariate Gaussian

MultivariateGaussianInverseGammaDistribution

public MultivariateGaussianInverseGammaDistribution(MultivariateGaussian gaussian,
                                                    InverseGammaDistribution inverseGamma)
Creates a new instance of MultivariateGaussianInverseGammaDistribution

Parameters:
gaussian - Gaussian component
inverseGamma - Inverse-Gamma component
Method Detail

clone

public MultivariateGaussianInverseGammaDistribution clone()
Description copied from class: AbstractCloneableSerializable
This makes public the clone method on the Object class and removes the exception that it throws. Its default behavior is to automatically create a clone of the exact type of object that the clone is called on and to copy all primitives but to keep all references, which means it is a shallow copy. Extensions of this class may want to override this method (but call super.clone() to implement a "smart copy". That is, to target the most common use case for creating a copy of the object. Because of the default behavior being a shallow copy, extending classes only need to handle fields that need to have a deeper copy (or those that need to be reset). Some of the methods in ObjectUtil may be helpful in implementing a custom clone method. Note: The contract of this method is that you must use super.clone() as the basis for your implementation.

Specified by:
clone in interface Vectorizable
Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractCloneableSerializable
Returns:
A clone of this object.

getMean

public Vector getMean()
Description copied from interface: DistributionWithMean
Gets the arithmetic mean, or "first central moment" or "expectation", of the distribution.

Specified by:
getMean in interface DistributionWithMean<Vector>
Returns:
Mean of the distribution.

sample

public ArrayList<Vector> sample(Random random,
                                int numSamples)
Description copied from interface: Distribution
Draws multiple random samples from the distribution. It is generally more efficient to use this multiple-sample method than multiple calls of the single-sample method. (But not always.)

Specified by:
sample in interface Distribution<Vector>
Parameters:
random - Random-number generator to use in order to generate random numbers.
numSamples - Number of samples to draw from the distribution.
Returns:
Samples drawn according to this distribution.

getGaussian

public MultivariateGaussian getGaussian()
Getter for gaussian

Returns:
Gaussian component

setGaussian

public void setGaussian(MultivariateGaussian gaussian)
Setter for gaussian

Parameters:
gaussian - Gaussian component

getInverseGamma

public InverseGammaDistribution getInverseGamma()
Getter for inverseGamma

Returns:
Inverse-Gamma component

setInverseGamma

public void setInverseGamma(InverseGammaDistribution inverseGamma)
Setter for inverseGamma

Parameters:
inverseGamma - Inverse-Gamma component

convertToVector

public Vector convertToVector()
Description copied from interface: Vectorizable
Converts the object to a vector.

Specified by:
convertToVector in interface Vectorizable
Returns:
The Vector form of the object.

convertFromVector

public void convertFromVector(Vector parameters)
Description copied from interface: Vectorizable
Converts the object from a Vector of parameters.

Specified by:
convertFromVector in interface Vectorizable
Parameters:
parameters - The parameters to incorporate.