be.ac.ulg.montefiore.run.jahmm
Class OpdfMultiGaussian

java.lang.Object
  extended by be.ac.ulg.montefiore.run.jahmm.OpdfMultiGaussian
All Implemented Interfaces:
Opdf<ObservationVector>, java.io.Serializable, java.lang.Cloneable

public class OpdfMultiGaussian
extends java.lang.Object
implements Opdf<ObservationVector>

This class represents a multivariate gaussian distribution function.

See Also:
Serialized Form

Constructor Summary
OpdfMultiGaussian(double[] mean, double[][] covariance)
          Builds a new gaussian probability distribution with a given mean and covariance matrix.
OpdfMultiGaussian(int dimension)
          Builds a new gaussian probability distribution with zero mean and identity covariance matrix.
 
Method Summary
 OpdfMultiGaussian clone()
           
 double[][] covariance()
          Returns (a copy of) this distribution's covariance matrix.
 int dimension()
          Returns the dimension of the vectors handled by this distribution.
 void fit(java.util.Collection<? extends ObservationVector> co)
          Fits this observation probability (distribution) function to a (non empty) set of observations.
 void fit(java.util.Collection<? extends ObservationVector> co, double[] weights)
          Fits this observation probability (distribution) function to a weighted (non empty) set of observations.
 void fit(ObservationVector... oa)
          Fits this observation probability (distribution) function to a (non empty) set of observations.
 void fit(ObservationVector[] o, double[] weights)
          Fits this observation probability (distribution) function to a weighted (non empty) set of observations.
 ObservationVector generate()
          Generates a (pseudo) random observation according to this distribution.
 double[] mean()
          Returns (a copy of) this distribution's mean vector.
 double probability(ObservationVector o)
          Returns the probability (density) of an observation given a distribution.
 java.lang.String toString()
           
 java.lang.String toString(java.text.NumberFormat numberFormat)
          Returns a String describing this distribution.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpdfMultiGaussian

public OpdfMultiGaussian(int dimension)
Builds a new gaussian probability distribution with zero mean and identity covariance matrix.

Parameters:
dimension - The dimension of the vectors.

OpdfMultiGaussian

public OpdfMultiGaussian(double[] mean,
                         double[][] covariance)
Builds a new gaussian probability distribution with a given mean and covariance matrix.

Parameters:
mean - The distribution's mean.
covariance - The distribution's covariance matrix.
Method Detail

mean

public double[] mean()
Returns (a copy of) this distribution's mean vector.

Returns:
The mean vector.

covariance

public double[][] covariance()
Returns (a copy of) this distribution's covariance matrix.

Returns:
The covariance matrix.

dimension

public int dimension()
Returns the dimension of the vectors handled by this distribution.

Returns:
The dimension of the vectors handled by this distribution.

probability

public double probability(ObservationVector o)
Description copied from interface: Opdf
Returns the probability (density) of an observation given a distribution.

Specified by:
probability in interface Opdf<ObservationVector>
Parameters:
o - An observation.
Returns:
The probability (density, if o takes continuous values) of o for this function.

generate

public ObservationVector generate()
Description copied from interface: Opdf
Generates a (pseudo) random observation according to this distribution.

Specified by:
generate in interface Opdf<ObservationVector>
Returns:
An observation.

fit

public void fit(ObservationVector... oa)
Description copied from interface: Opdf
Fits this observation probability (distribution) function to a (non empty) set of observations. The meaning to give to fits should be has the maximum likelihood if possible.

Specified by:
fit in interface Opdf<ObservationVector>
Parameters:
oa - An array of observations compatible with this function.

fit

public void fit(java.util.Collection<? extends ObservationVector> co)
Description copied from interface: Opdf
Fits this observation probability (distribution) function to a (non empty) set of observations. The meaning to give to fits should be has the maximum likelihood if possible.

Specified by:
fit in interface Opdf<ObservationVector>
Parameters:
co - A set of observations compatible with this function.

fit

public void fit(ObservationVector[] o,
                double[] weights)
Description copied from interface: Opdf
Fits this observation probability (distribution) function to a weighted (non empty) set of observations. Equations (53) and (54) of Rabiner's A Tutorial on Hidden Markov Models and Selected Applications in Speech Recognition explain how the weights can be used.

Specified by:
fit in interface Opdf<ObservationVector>
Parameters:
o - An array of observations compatible with this factory.
weights - The weight associated to each observation (such that weight.length == o.length and the sum of all the elements equals 1).

fit

public void fit(java.util.Collection<? extends ObservationVector> co,
                double[] weights)
Description copied from interface: Opdf
Fits this observation probability (distribution) function to a weighted (non empty) set of observations. Equations (53) and (54) of Rabiner's A Tutorial on Hidden Markov Models and Selected Applications in Speech Recognition explain how the weights can be used.

Specified by:
fit in interface Opdf<ObservationVector>
Parameters:
co - A set of observations compatible with this factory.
weights - The weight associated to each observation (such that weight.length == o.length and the sum of all the elements equals 1).

clone

public OpdfMultiGaussian clone()
Specified by:
clone in interface Opdf<ObservationVector>
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.text.NumberFormat numberFormat)
Description copied from interface: Opdf
Returns a String describing this distribution.

Specified by:
toString in interface Opdf<ObservationVector>
Parameters:
numberFormat - A formatter used to convert the numbers (e.g. probabilities) to strings.
Returns:
A String describing this distribution.


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