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

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

public class OpdfGaussian
extends java.lang.Object
implements Opdf<ObservationReal>

This class represents a (monovariate) gaussian distribution function.

See Also:
Serialized Form

Constructor Summary
OpdfGaussian()
          Builds a new gaussian probability distribution with zero mean and unit variance.
OpdfGaussian(double mean, double variance)
          Builds a new gaussian probability distribution with a given mean and covariance matrix.
 
Method Summary
 OpdfGaussian clone()
           
 void fit(java.util.Collection<? extends ObservationReal> co)
          Fits this observation probability (distribution) function to a (non empty) set of observations.
 void fit(java.util.Collection<? extends ObservationReal> co, double[] weights)
          Fits this observation probability (distribution) function to a weighted (non empty) set of observations.
 void fit(ObservationReal... oa)
          Fits this observation probability (distribution) function to a (non empty) set of observations.
 void fit(ObservationReal[] o, double[] weights)
          Fits this observation probability (distribution) function to a weighted (non empty) set of observations.
 ObservationReal generate()
          Generates a (pseudo) random observation according to this distribution.
 double mean()
          Returns this distribution's mean value.
 double probability(ObservationReal 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.
 double variance()
          Returns this distribution's variance.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpdfGaussian

public OpdfGaussian()
Builds a new gaussian probability distribution with zero mean and unit variance.


OpdfGaussian

public OpdfGaussian(double mean,
                    double variance)
Builds a new gaussian probability distribution with a given mean and covariance matrix.

Parameters:
mean - The distribution's mean.
variance - The distribution's variance.
Method Detail

mean

public double mean()
Returns this distribution's mean value.

Returns:
This distribution's mean value.

variance

public double variance()
Returns this distribution's variance.

Returns:
This distribution's variance.

probability

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

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

generate

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

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

fit

public void fit(ObservationReal... 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<ObservationReal>
Parameters:
oa - An array of observations compatible with this function.

fit

public void fit(java.util.Collection<? extends ObservationReal> 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<ObservationReal>
Parameters:
co - A set of observations compatible with this function.

fit

public void fit(ObservationReal[] 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<ObservationReal>
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 ObservationReal> 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<ObservationReal>
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 OpdfGaussian clone()
Specified by:
clone in interface Opdf<ObservationReal>
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<ObservationReal>
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.