gov.sandia.cognition.learning.function.cost
Class NegativeLogLikelihood<DataType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.function.cost.AbstractCostFunction<ComputableDistribution<DataType>,Collection<? extends DataType>>
          extended by gov.sandia.cognition.learning.function.cost.NegativeLogLikelihood<DataType>
Type Parameters:
DataType - Type of data generated by the Distribution
All Implemented Interfaces:
Evaluator<ComputableDistribution<DataType>,Double>, CostFunction<ComputableDistribution<DataType>,Collection<? extends DataType>>, CloneableSerializable, Serializable, Cloneable
Direct Known Subclasses:
ParallelNegativeLogLikelihood

public class NegativeLogLikelihood<DataType>
extends AbstractCostFunction<ComputableDistribution<DataType>,Collection<? extends DataType>>

CostFunction for computing the maximum likelihood (because we are minimizing the negative of the log likelihood)

See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.sandia.cognition.learning.function.cost.AbstractCostFunction
costParameters
 
Constructor Summary
NegativeLogLikelihood()
          Default constructor
NegativeLogLikelihood(Collection<? extends DataType> costParameters)
          Creates a new instance of NegativeLogLikelihood
 
Method Summary
 Double evaluate(ComputableDistribution<DataType> target)
          Computes the cost of the given target.
static
<DataType> double
evaluate(ProbabilityFunction<DataType> f, Collection<? extends DataType> data)
          Evaluates the negative log-likelihood of the given collection of data according to the given probability function.
 
Methods inherited from class gov.sandia.cognition.learning.function.cost.AbstractCostFunction
clone, getCostParameters, setCostParameters
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NegativeLogLikelihood

public NegativeLogLikelihood()
Default constructor


NegativeLogLikelihood

public NegativeLogLikelihood(Collection<? extends DataType> costParameters)
Creates a new instance of NegativeLogLikelihood

Parameters:
costParameters - Data generated by the target distribution
Method Detail

evaluate

public Double evaluate(ComputableDistribution<DataType> target)
Description copied from interface: CostFunction
Computes the cost of the given target.

Parameters:
target - The object to evaluate.
Returns:
The cost of the given object.

evaluate

public static <DataType> double evaluate(ProbabilityFunction<DataType> f,
                                         Collection<? extends DataType> data)
Evaluates the negative log-likelihood of the given collection of data according to the given probability function.

Type Parameters:
DataType - The type of data generated by the distribution.
Parameters:
f - The function to compute the log-likelihood.
data - The data to compute the log-likelihood of.
Returns:
The total negative log-likelihood of the data according to the function.