gov.sandia.cognition.statistics.distribution
Class MultinomialDistribution.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.MultinomialDistribution
              extended by gov.sandia.cognition.statistics.distribution.MultinomialDistribution.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:
MultinomialDistribution

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

Probability Mass Function of the Multinomial Distribution.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class gov.sandia.cognition.statistics.distribution.MultinomialDistribution
MultinomialDistribution.Domain, MultinomialDistribution.PMF
 
Field Summary
 
Fields inherited from class gov.sandia.cognition.statistics.distribution.MultinomialDistribution
DEFAULT_NUM_CLASSES, DEFAULT_NUM_TRIALS
 
Constructor Summary
MultinomialDistribution.PMF()
          Creates a new instance of MultinomialDistribution.PMF
MultinomialDistribution.PMF(int numClasses, int numTrials)
          Creates a new instance of MultinomialDistribution.PMF
MultinomialDistribution.PMF(MultinomialDistribution other)
          Copy constructor
MultinomialDistribution.PMF(Vector parameters, int numTrials)
          Creates a new instance of MultinomialDistribution.PMF
 
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.
 int getInputDimensionality()
          Gets the expected dimensionality of the input vector to the evaluator, if it is known.
 MultinomialDistribution.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.MultinomialDistribution
clone, convertFromVector, convertToVector, getDomain, getDomainSize, getMean, getNumTrials, getParameters, sample, setNumTrials, 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
 

Constructor Detail

MultinomialDistribution.PMF

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


MultinomialDistribution.PMF

public MultinomialDistribution.PMF(int numClasses,
                                   int numTrials)
Creates a new instance of MultinomialDistribution.PMF

Parameters:
numClasses - Number of classes (labels or parameters) to use.
numTrials - Number of trials in the distribution, must be greater than 0.

MultinomialDistribution.PMF

public MultinomialDistribution.PMF(Vector parameters,
                                   int numTrials)
Creates a new instance of MultinomialDistribution.PMF

Parameters:
numTrials - Number of trials in the distribution, must be greater than 0.
parameters - Parameters of the multinomial distribution, must be at least 2-dimensional and each element must be nonnegative.

MultinomialDistribution.PMF

public MultinomialDistribution.PMF(MultinomialDistribution other)
Copy constructor

Parameters:
other - MultinomialDistribution to copy
Method Detail

getInputDimensionality

public int getInputDimensionality()
Description copied from interface: VectorInputEvaluator
Gets the expected dimensionality of the input vector to the evaluator, if it is known. If it is not known, -1 is returned.

Specified by:
getInputDimensionality in interface VectorInputEvaluator<Vector,Double>
Returns:
The expected dimensionality of the input vector to the evaluator, or -1 if it is not known.

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.

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.

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.

getProbabilityFunction

public MultinomialDistribution.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 MultinomialDistribution
Returns:
Distribution function associated with this Distribution.