gov.sandia.cognition.statistics.method
Class DistributionParameterEstimator<DataType,DistributionType extends ClosedFormDistribution<? extends DataType>>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.algorithm.AbstractIterativeAlgorithm
          extended by gov.sandia.cognition.algorithm.AnytimeAlgorithmWrapper<DistributionType,FunctionMinimizer<Vector,Double,? super DistributionParameterEstimator.DistributionWrapper>>
              extended by gov.sandia.cognition.statistics.method.DistributionParameterEstimator<DataType,DistributionType>
Type Parameters:
DataType - Type of data generated by the distribution
DistributionType - Type of distribution to estimate the parameters of.
All Implemented Interfaces:
AnytimeAlgorithm<DistributionType>, IterativeAlgorithm, IterativeAlgorithmListener, MeasurablePerformanceAlgorithm, StoppableAlgorithm, BatchLearner<Collection<? extends DataType>,DistributionType>, CloneableSerializable, Serializable, Cloneable

public class DistributionParameterEstimator<DataType,DistributionType extends ClosedFormDistribution<? extends DataType>>
extends AnytimeAlgorithmWrapper<DistributionType,FunctionMinimizer<Vector,Double,? super DistributionParameterEstimator.DistributionWrapper>>
implements BatchLearner<Collection<? extends DataType>,DistributionType>, MeasurablePerformanceAlgorithm

A method of estimating the parameters of a distribution using an arbitrary CostFunction and FunctionMinimizer algorithm.

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

Nested Class Summary
protected  class DistributionParameterEstimator.DistributionWrapper
          Maps the parameters of a Distribution and a CostFunction into a Vector/Double Evaluator.
 
Field Summary
 
Fields inherited from class gov.sandia.cognition.algorithm.AbstractIterativeAlgorithm
DEFAULT_ITERATION, iteration
 
Constructor Summary
DistributionParameterEstimator(DistributionType distribution, CostFunction<? super DistributionType,Collection<? extends DataType>> costFunction)
          Creates a new instance of DistributionParameterEstimator
DistributionParameterEstimator(DistributionType distribution, CostFunction<? super DistributionType,Collection<? extends DataType>> costFunction, FunctionMinimizer<Vector,Double,? super DistributionParameterEstimator.DistributionWrapper> algorithm)
          Creates a new instance of DistributionParameterEstimator
 
Method Summary
 DistributionParameterEstimator<DataType,DistributionType> clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 NamedValue<? extends Number> getPerformance()
          Gets the name-value pair that describes the current performance of the algorithm.
 DistributionType getResult()
          Gets the current result of the algorithm.
 DistributionType learn(Collection<? extends DataType> minimizationParameters)
          The learn method creates an object of ResultType using data of type DataType, using some form of "learning" algorithm.
 
Methods inherited from class gov.sandia.cognition.algorithm.AnytimeAlgorithmWrapper
algorithmEnded, algorithmStarted, getAlgorithm, getIteration, getMaxIterations, isResultValid, readResolve, setAlgorithm, setMaxIterations, stepEnded, stepStarted, stop
 
Methods inherited from class gov.sandia.cognition.algorithm.AbstractIterativeAlgorithm
addIterativeAlgorithmListener, fireAlgorithmEnded, fireAlgorithmStarted, fireStepEnded, fireStepStarted, getListeners, removeIterativeAlgorithmListener, setIteration, setListeners
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.algorithm.IterativeAlgorithm
addIterativeAlgorithmListener, removeIterativeAlgorithmListener
 

Constructor Detail

DistributionParameterEstimator

public DistributionParameterEstimator(DistributionType distribution,
                                      CostFunction<? super DistributionType,Collection<? extends DataType>> costFunction)
Creates a new instance of DistributionParameterEstimator

Parameters:
distribution - Distribution to estimate the parameters of
costFunction - Cost function to use in the minimization procedure

DistributionParameterEstimator

public DistributionParameterEstimator(DistributionType distribution,
                                      CostFunction<? super DistributionType,Collection<? extends DataType>> costFunction,
                                      FunctionMinimizer<Vector,Double,? super DistributionParameterEstimator.DistributionWrapper> algorithm)
Creates a new instance of DistributionParameterEstimator

Parameters:
distribution - Distribution to estimate the parameters of
costFunction - Cost function to use in the minimization procedure
algorithm - Minimization algorithm to use, such as FunctionMinimizerBFGS, FunctionMinimizerDirectionSetPowell, etc.
Method Detail

clone

public DistributionParameterEstimator<DataType,DistributionType> 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 AnytimeAlgorithmWrapper<DistributionType extends ClosedFormDistribution<? extends DataType>,FunctionMinimizer<Vector,Double,? super DistributionParameterEstimator.DistributionWrapper>>
Returns:
A clone of this object.

learn

public DistributionType learn(Collection<? extends DataType> minimizationParameters)
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>,DistributionType extends ClosedFormDistribution<? extends DataType>>
Parameters:
minimizationParameters - 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.

getResult

public DistributionType getResult()
Description copied from interface: AnytimeAlgorithm
Gets the current result of the algorithm.

Specified by:
getResult in interface AnytimeAlgorithm<DistributionType extends ClosedFormDistribution<? extends DataType>>
Returns:
Current result of the algorithm.

getPerformance

public NamedValue<? extends Number> getPerformance()
Description copied from interface: MeasurablePerformanceAlgorithm
Gets the name-value pair that describes the current performance of the algorithm. For most algorithms, this is the value that they are attempting to optimize.

Specified by:
getPerformance in interface MeasurablePerformanceAlgorithm
Returns:
The name-value pair that describes the current performance of the algorithm.