gov.sandia.cognition.statistics.method
Class MaximumLikelihoodDistributionEstimator<DataType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.algorithm.AbstractParallelAlgorithm
          extended by gov.sandia.cognition.statistics.method.MaximumLikelihoodDistributionEstimator<DataType>
Type Parameters:
DataType - Type of data generated by the distributions.
All Implemented Interfaces:
ParallelAlgorithm, BatchLearner<Collection<? extends DataType>,ClosedFormComputableDistribution<DataType>>, CloneableSerializable, Serializable, Cloneable

public class MaximumLikelihoodDistributionEstimator<DataType>
extends AbstractParallelAlgorithm
implements BatchLearner<Collection<? extends DataType>,ClosedFormComputableDistribution<DataType>>

Estimates the most-likely distribution, and corresponding parameters, of that generated the given data from a pre-determined collection of candidate parameteric distributions.

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

Nested Class Summary
static class MaximumLikelihoodDistributionEstimator.DistributionEstimationTask<DataType>
          Estimates the optimal parameters of a single distribution
 
Constructor Summary
MaximumLikelihoodDistributionEstimator()
          Creates a new instance of MaximumLikelihoodDistributionEstimator
MaximumLikelihoodDistributionEstimator(Collection<? extends ClosedFormComputableDistribution<DataType>> distributions)
          Creates a new instance of MaximumLikelihoodDistributionEstimator
 
Method Summary
 MaximumLikelihoodDistributionEstimator<DataType> clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
static SmoothUnivariateDistribution estimateContinuousDistribution(Collection<Double> data)
          Estimates a continuous distribution.
static ClosedFormDiscreteUnivariateDistribution estimateDiscreteDistribution(Collection<? extends Number> data)
          Estimates a discrete distribution.
protected static
<DistributionType extends ClosedFormComputableDistribution<?>>
LinkedList<DistributionType>
getDistributionClasses(Class<? extends DistributionType> baseDistribution)
          Gets the distribution classes for the given base distribution.
 Collection<? extends ClosedFormComputableDistribution<DataType>> getDistributions()
          Getter for distributions
 ClosedFormComputableDistribution<DataType> learn(Collection<? extends DataType> data)
          The learn method creates an object of ResultType using data of type DataType, using some form of "learning" algorithm.
 void setDistributions(Collection<? extends ClosedFormComputableDistribution<DataType>> distributions)
          Setter for distributions
 
Methods inherited from class gov.sandia.cognition.algorithm.AbstractParallelAlgorithm
getNumThreads, getThreadPool, setThreadPool
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaximumLikelihoodDistributionEstimator

public MaximumLikelihoodDistributionEstimator()
Creates a new instance of MaximumLikelihoodDistributionEstimator


MaximumLikelihoodDistributionEstimator

public MaximumLikelihoodDistributionEstimator(Collection<? extends ClosedFormComputableDistribution<DataType>> distributions)
Creates a new instance of MaximumLikelihoodDistributionEstimator

Parameters:
distributions - Collection of Distributions to estimate the optimal parameters of
Method Detail

clone

public MaximumLikelihoodDistributionEstimator<DataType> 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 CloneableSerializable
Overrides:
clone in class AbstractParallelAlgorithm
Returns:
A clone of this object.

getDistributions

public Collection<? extends ClosedFormComputableDistribution<DataType>> getDistributions()
Getter for distributions

Returns:
Collection of Distributions to estimate the optimal parameters of

setDistributions

public void setDistributions(Collection<? extends ClosedFormComputableDistribution<DataType>> distributions)
Setter for distributions

Parameters:
distributions - Collection of Distributions to estimate the optimal parameters of

learn

public ClosedFormComputableDistribution<DataType> learn(Collection<? extends DataType> data)
Description copied from interface: BatchLearner
The learn method creates an object of ResultType using data of type DataType, using some form of "learning" algorithm.

Specified by:
learn in interface BatchLearner<Collection<? extends DataType>,ClosedFormComputableDistribution<DataType>>
Parameters:
data - The data that the learning algorithm will use to create an object of ResultType.
Returns:
The object that is created based on the given data using the learning algorithm.

estimateContinuousDistribution

public static SmoothUnivariateDistribution estimateContinuousDistribution(Collection<Double> data)
                                                                   throws Exception
Estimates a continuous distribution.

Parameters:
data - The data to estimate a distribution for.
Returns:
The estimated distribution.
Throws:
Exception - If there is an error in the estimation.

estimateDiscreteDistribution

public static ClosedFormDiscreteUnivariateDistribution estimateDiscreteDistribution(Collection<? extends Number> data)
                                                                             throws Exception
Estimates a discrete distribution.

Parameters:
data - The data to estimate a distribution for.
Returns:
The estimated distribution.
Throws:
Exception - If there is an error in the estimation.

getDistributionClasses

protected static <DistributionType extends ClosedFormComputableDistribution<?>> LinkedList<DistributionType> getDistributionClasses(Class<? extends DistributionType> baseDistribution)
                                                                                                          throws ClassNotFoundException,
                                                                                                                 IOException,
                                                                                                                 InstantiationException,
                                                                                                                 IllegalAccessException
Gets the distribution classes for the given base distribution.

Type Parameters:
DistributionType - The type of distribution.
Parameters:
baseDistribution - The class of the base distribution.
Returns:
The list of implementations of that distribution in the statistics distribution package.
Throws:
ClassNotFoundException
IOException
InstantiationException
IllegalAccessException