public static class MultinomialDistribution.PMF extends MultinomialDistribution implements ProbabilityMassFunction<Vector>, VectorInputEvaluator<Vector,java.lang.Double>
MultinomialDistribution.Domain, MultinomialDistribution.PMF
DEFAULT_NUM_CLASSES, DEFAULT_NUM_TRIALS
Constructor and Description |
---|
PMF()
Creates a new instance of MultinomialDistribution.PMF
|
PMF(int numClasses,
int numTrials)
Creates a new instance of MultinomialDistribution.PMF
|
PMF(MultinomialDistribution other)
Copy constructor
|
PMF(Vector parameters,
int numTrials)
Creates a new instance of MultinomialDistribution.PMF
|
Modifier and Type | Method and Description |
---|---|
java.lang.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.
|
clone, convertFromVector, convertToVector, getDomain, getDomainSize, getMean, getNumTrials, getParameters, sampleInto, setNumTrials, setParameters
sample, sample
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDomain, getDomainSize
sample, sample, sampleInto
clone
public PMF()
public PMF(int numClasses, int numTrials)
numClasses
- Number of classes (labels or parameters) to use.numTrials
- Number of trials in the distribution, must be greater than 0.public PMF(Vector parameters, int numTrials)
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.public PMF(MultinomialDistribution other)
other
- MultinomialDistribution to copypublic int getInputDimensionality()
VectorInputEvaluator
getInputDimensionality
in interface VectorInputEvaluator<Vector,java.lang.Double>
public java.lang.Double evaluate(Vector input)
Evaluator
public double logEvaluate(Vector input)
ProbabilityFunction
logEvaluate
in interface ProbabilityFunction<Vector>
input
- The input to be evaluatedpublic double getEntropy()
ProbabilityMassFunction
getEntropy
in interface ProbabilityMassFunction<Vector>
public MultinomialDistribution.PMF getProbabilityFunction()
ComputableDistribution
getProbabilityFunction
in interface ComputableDistribution<Vector>
getProbabilityFunction
in interface DiscreteDistribution<Vector>
getProbabilityFunction
in interface ProbabilityMassFunction<Vector>
getProbabilityFunction
in class MultinomialDistribution