org.encog.ml.hmm.distributions
Class ContinousDistribution

java.lang.Object
  extended by org.encog.ml.hmm.distributions.ContinousDistribution
All Implemented Interfaces:
Serializable, Cloneable, StateDistribution

public class ContinousDistribution
extends Object
implements StateDistribution

A continuous distribution represents an infinite range of choices between two real numbers. A gaussian distribution is used to distribute the probability.

See Also:
Serialized Form

Constructor Summary
ContinousDistribution(double[] mean, double[][] covariance)
          Construct a continuous distribution.
ContinousDistribution(int dimension)
          Construct a continuous distribution with the specified number of dimensions.
 
Method Summary
 ContinousDistribution clone()
          
 void fit(MLDataSet co)
          Fit this distribution to the specified data set.
 void fit(MLDataSet co, double[] weights)
          Fit this distribution to the specified data set, given the specified weights, per element.
 MLDataPair generate()
          Generate a random data pair, based on the probabilities.
 Matrix getCovariance()
           
 double[] getMean()
           
 double probability(MLDataPair o)
          Determine the probability of the specified data pair.
 void update(double[][] covariance)
          Update the covariance.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContinousDistribution

public ContinousDistribution(double[] mean,
                             double[][] covariance)
Construct a continuous distribution.

Parameters:
mean - The mean.
covariance - The covariance.

ContinousDistribution

public ContinousDistribution(int dimension)
Construct a continuous distribution with the specified number of dimensions.

Parameters:
dimension - The dimensions.
Method Detail

clone

public ContinousDistribution clone()

Specified by:
clone in interface StateDistribution
Overrides:
clone in class Object
Returns:
A clone of this distribution.

fit

public void fit(MLDataSet co)
Fit this distribution to the specified data set.

Specified by:
fit in interface StateDistribution
Parameters:
co - The data set to fit to.

fit

public void fit(MLDataSet co,
                double[] weights)
Fit this distribution to the specified data set, given the specified weights, per element.

Specified by:
fit in interface StateDistribution
Parameters:
co - The data set to fit to.
weights - The weights.

generate

public MLDataPair generate()
Generate a random data pair, based on the probabilities.

Specified by:
generate in interface StateDistribution
Returns:
A random data pair.

probability

public double probability(MLDataPair o)
Determine the probability of the specified data pair.

Specified by:
probability in interface StateDistribution
Parameters:
o - The pair to consider.
Returns:
The probability.

update

public void update(double[][] covariance)
Update the covariance.

Parameters:
covariance - The new covariance.

getMean

public double[] getMean()
Returns:
The mean for the dimensions of the gaussian curve.

getCovariance

public Matrix getCovariance()
Returns:
The covariance matrix.


Copyright © 2014. All Rights Reserved.