gov.sandia.cognition.statistics.distribution
Class CategoricalDistribution.PMF

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.statistics.AbstractDistribution<Vector>
          extended by gov.sandia.cognition.statistics.distribution.CategoricalDistribution
              extended by gov.sandia.cognition.statistics.distribution.CategoricalDistribution.PMF
All Implemented Interfaces:
Evaluator<Vector,Double>, VectorInputEvaluator<Vector,Double>, Vectorizable, ClosedFormComputableDiscreteDistribution<Vector>, ClosedFormComputableDistribution<Vector>, ClosedFormDistribution<Vector>, ComputableDistribution<Vector>, DiscreteDistribution<Vector>, Distribution<Vector>, DistributionWithMean<Vector>, ProbabilityFunction<Vector>, ProbabilityMassFunction<Vector>, CloneableSerializable, Serializable, Cloneable
Enclosing class:
CategoricalDistribution

public static class CategoricalDistribution.PMF
extends CategoricalDistribution
implements ProbabilityMassFunction<Vector>, VectorInputEvaluator<Vector,Double>

PMF of the Categorical Distribution

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class gov.sandia.cognition.statistics.distribution.CategoricalDistribution
CategoricalDistribution.PMF
 
Field Summary
 
Fields inherited from class gov.sandia.cognition.statistics.distribution.CategoricalDistribution
DEFAULT_NUM_CLASSES, parameters
 
Constructor Summary
CategoricalDistribution.PMF()
          Creates a new instance of CategoricalDistribution
CategoricalDistribution.PMF(CategoricalDistribution other)
          Copy constructor
CategoricalDistribution.PMF(int numClasses)
          Creates a new instance of CategoricalDistribution
CategoricalDistribution.PMF(Vector parameters)
          Creates a new instance of CategoricalDistribution
 
Method Summary
 Double evaluate(Vector input)
          Evaluates the function on the given input and returns the output.
 double getEntropy()
          Gets the entropy of the values in the histogram.
 CategoricalDistribution.PMF getProbabilityFunction()
          Gets the distribution function associated with this Distribution, either the PDF or PMF.
 double logEvaluate(Vector input)
          Evaluate the natural logarithm of the distribution function.
 
Methods inherited from class gov.sandia.cognition.statistics.distribution.CategoricalDistribution
clone, convertFromVector, convertToVector, getDomain, getDomainSize, getInputDimensionality, getMean, getParameters, sample, setParameters
 
Methods inherited from class gov.sandia.cognition.statistics.AbstractDistribution
sample
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.statistics.DiscreteDistribution
getDomain, getDomainSize
 
Methods inherited from interface gov.sandia.cognition.statistics.Distribution
sample, sample
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 
Methods inherited from interface gov.sandia.cognition.math.matrix.VectorInputEvaluator
getInputDimensionality
 

Constructor Detail

CategoricalDistribution.PMF

public CategoricalDistribution.PMF()
Creates a new instance of CategoricalDistribution


CategoricalDistribution.PMF

public CategoricalDistribution.PMF(int numClasses)
Creates a new instance of CategoricalDistribution

Parameters:
numClasses - Number of classes (labels or parameters) to use.

CategoricalDistribution.PMF

public CategoricalDistribution.PMF(Vector parameters)
Creates a new instance of CategoricalDistribution

Parameters:
parameters - Parameters of the multinomial distribution, must be at least 2-dimensional and each element must be nonnegative.

CategoricalDistribution.PMF

public CategoricalDistribution.PMF(CategoricalDistribution other)
Copy constructor

Parameters:
other - CategoricalDistribution to copy
Method Detail

getEntropy

public double getEntropy()
Description copied from interface: ProbabilityMassFunction
Gets the entropy of the values in the histogram.

Specified by:
getEntropy in interface ProbabilityMassFunction<Vector>
Returns:
The entropy of the values in the histogram.

logEvaluate

public double logEvaluate(Vector input)
Description copied from interface: ProbabilityFunction
Evaluate the natural logarithm of the distribution function. This is sometimes more efficient than evaluating the distribution function itself, and when evaluating the product of many independent or exchangeable samples.

Specified by:
logEvaluate in interface ProbabilityFunction<Vector>
Returns:
Natural logarithm of the distribution function.

evaluate

public Double evaluate(Vector input)
Description copied from interface: Evaluator
Evaluates the function on the given input and returns the output.

Specified by:
evaluate in interface Evaluator<Vector,Double>
Parameters:
input - The input to evaluate.
Returns:
The output produced by evaluating the input.

getProbabilityFunction

public CategoricalDistribution.PMF getProbabilityFunction()
Description copied from interface: ComputableDistribution
Gets the distribution function associated with this Distribution, either the PDF or PMF.

Specified by:
getProbabilityFunction in interface ComputableDistribution<Vector>
Specified by:
getProbabilityFunction in interface DiscreteDistribution<Vector>
Specified by:
getProbabilityFunction in interface ProbabilityMassFunction<Vector>
Overrides:
getProbabilityFunction in class CategoricalDistribution
Returns:
Distribution function associated with this Distribution.