DataType
- Type of data generated by the distributions.public class MaximumLikelihoodDistributionEstimator<DataType> extends AbstractParallelAlgorithm implements BatchLearner<java.util.Collection<? extends DataType>,ClosedFormComputableDistribution<DataType>>
Modifier and Type | Class and Description |
---|---|
static class |
MaximumLikelihoodDistributionEstimator.DistributionEstimationTask<DataType>
Estimates the optimal parameters of a single distribution
|
Constructor and Description |
---|
MaximumLikelihoodDistributionEstimator()
Creates a new instance of MaximumLikelihoodDistributionEstimator
|
MaximumLikelihoodDistributionEstimator(java.util.Collection<? extends ClosedFormComputableDistribution<DataType>> distributions)
Creates a new instance of MaximumLikelihoodDistributionEstimator
|
Modifier and Type | Method and Description |
---|---|
MaximumLikelihoodDistributionEstimator<DataType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
static SmoothUnivariateDistribution |
estimateContinuousDistribution(java.util.Collection<java.lang.Double> data)
Estimates a continuous distribution.
|
static ClosedFormDiscreteUnivariateDistribution |
estimateDiscreteDistribution(java.util.Collection<? extends java.lang.Number> data)
Estimates a discrete distribution.
|
protected static <DistributionType extends ClosedFormComputableDistribution<?>> |
getDistributionClasses(java.lang.Class<? extends DistributionType> baseDistribution)
Gets the distribution classes for the given base distribution.
|
java.util.Collection<? extends ClosedFormComputableDistribution<DataType>> |
getDistributions()
Getter for distributions
|
ClosedFormComputableDistribution<DataType> |
learn(java.util.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(java.util.Collection<? extends ClosedFormComputableDistribution<DataType>> distributions)
Setter for distributions
|
getNumThreads, getThreadPool, setThreadPool
public MaximumLikelihoodDistributionEstimator()
public MaximumLikelihoodDistributionEstimator(java.util.Collection<? extends ClosedFormComputableDistribution<DataType>> distributions)
distributions
- Collection of Distributions to estimate the optimal parameters ofpublic MaximumLikelihoodDistributionEstimator<DataType> clone()
AbstractCloneableSerializable
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.clone
in interface CloneableSerializable
clone
in class AbstractParallelAlgorithm
public java.util.Collection<? extends ClosedFormComputableDistribution<DataType>> getDistributions()
public void setDistributions(java.util.Collection<? extends ClosedFormComputableDistribution<DataType>> distributions)
distributions
- Collection of Distributions to estimate the optimal parameters ofpublic ClosedFormComputableDistribution<DataType> learn(java.util.Collection<? extends DataType> data)
BatchLearner
learn
method creates an object of ResultType
using
data of type DataType
, using some form of "learning" algorithm.learn
in interface BatchLearner<java.util.Collection<? extends DataType>,ClosedFormComputableDistribution<DataType>>
data
- The data that the learning algorithm will use to create an
object of ResultType
.public static SmoothUnivariateDistribution estimateContinuousDistribution(java.util.Collection<java.lang.Double> data) throws java.lang.Exception
data
- The data to estimate a distribution for.java.lang.Exception
- If there is an error in the estimation.public static ClosedFormDiscreteUnivariateDistribution estimateDiscreteDistribution(java.util.Collection<? extends java.lang.Number> data) throws java.lang.Exception
data
- The data to estimate a distribution for.java.lang.Exception
- If there is an error in the estimation.protected static <DistributionType extends ClosedFormComputableDistribution<?>> java.util.LinkedList<DistributionType> getDistributionClasses(java.lang.Class<? extends DistributionType> baseDistribution) throws java.lang.ClassNotFoundException, java.io.IOException, java.lang.InstantiationException, java.lang.IllegalAccessException
DistributionType
- The type of distribution.baseDistribution
- The class of the base distribution.java.lang.ClassNotFoundException
java.io.IOException
java.lang.InstantiationException
java.lang.IllegalAccessException