gov.sandia.cognition.statistics.distribution
Class UnivariateGaussian.MaximumLikelihoodEstimator

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.statistics.distribution.UnivariateGaussian.MaximumLikelihoodEstimator
All Implemented Interfaces:
BatchLearner<Collection<? extends Double>,UnivariateGaussian.PDF>, DistributionEstimator<Double,UnivariateGaussian.PDF>, CloneableSerializable, Serializable, Cloneable
Enclosing class:
UnivariateGaussian

public static class UnivariateGaussian.MaximumLikelihoodEstimator
extends AbstractCloneableSerializable
implements DistributionEstimator<Double,UnivariateGaussian.PDF>

Creates a UnivariateGaussian from data

See Also:
Serialized Form

Field Summary
static double DEFAULT_VARIANCE
          Typical value of a defaultVariance, 1.0E-5
 
Constructor Summary
UnivariateGaussian.MaximumLikelihoodEstimator()
          Default constructor
UnivariateGaussian.MaximumLikelihoodEstimator(double defaultVariance)
          Creates a new instance of MaximumLikelihoodEstimator
 
Method Summary
 double getDefaultVariance()
          Gets the default variance, which is the amount added to the variance.
 UnivariateGaussian.PDF learn(Collection<? extends Double> data)
          Creates a new instance of UnivariateGaussian from the given data
static UnivariateGaussian.PDF learn(Collection<? extends Number> data, double defaultVariance)
          Creates a new instance of UnivariateGaussian from the given data
 void setDefaultVariance(double defaultVariance)
          Sets the default variance, which is the amount added to the variance.
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Field Detail

DEFAULT_VARIANCE

public static final double DEFAULT_VARIANCE
Typical value of a defaultVariance, 1.0E-5

See Also:
Constant Field Values
Constructor Detail

UnivariateGaussian.MaximumLikelihoodEstimator

public UnivariateGaussian.MaximumLikelihoodEstimator()
Default constructor


UnivariateGaussian.MaximumLikelihoodEstimator

public UnivariateGaussian.MaximumLikelihoodEstimator(double defaultVariance)
Creates a new instance of MaximumLikelihoodEstimator

Parameters:
defaultVariance - Amount to add to the variance to keep it from being 0.0
Method Detail

learn

public UnivariateGaussian.PDF learn(Collection<? extends Double> data)
Creates a new instance of UnivariateGaussian from the given data

Specified by:
learn in interface BatchLearner<Collection<? extends Double>,UnivariateGaussian.PDF>
Parameters:
data - Data to fit a UnivariateGaussian against
Returns:
Maximum likelihood estimate of the UnivariateGaussian that generated the data

learn

public static UnivariateGaussian.PDF learn(Collection<? extends Number> data,
                                           double defaultVariance)
Creates a new instance of UnivariateGaussian from the given data

Parameters:
data - Data to fit a UnivariateGaussian against
defaultVariance - Amount to add to the variance to keep it from being 0.0
Returns:
Maximum likelihood estimate of the UnivariateGaussian that generated the data

getDefaultVariance

public double getDefaultVariance()
Gets the default variance, which is the amount added to the variance. If this is greater than zero, it avoids creating zero variance.

Returns:
The default variance. Cannot be negative.

setDefaultVariance

public void setDefaultVariance(double defaultVariance)
Sets the default variance, which is the amount added to the variance. If this is greater than zero, it avoids creating zero variance.

Parameters:
defaultVariance - The default variance. Cannot be negative.