KeyType
- Type of Key in the distributionpublic static class DefaultDataDistribution.PMF<KeyType> extends DefaultDataDistribution<KeyType> implements DataDistribution.PMF<KeyType>
DefaultDataDistribution.DefaultFactory<DataType>, DefaultDataDistribution.Estimator<KeyType>, DefaultDataDistribution.PMF<KeyType>, DefaultDataDistribution.WeightedEstimator<KeyType>
AbstractMutableDoubleMap.Entry<KeyType>, AbstractMutableDoubleMap.SimpleEntry<KeyType>, AbstractMutableDoubleMap.SimpleEntrySet<KeyType>, AbstractMutableDoubleMap.SimpleIterator<KeyType>
DataDistribution.PMF<KeyType>
ScalarMap.Entry<KeyType>
DEFAULT_INITIAL_CAPACITY, total
map
Constructor and Description |
---|
PMF()
Default constructor
|
PMF(DataDistribution<KeyType> other)
Copy constructor
|
PMF(int initialCapacity)
Creates a new instance of DefaultDataDistribution
|
PMF(java.lang.Iterable<? extends KeyType> data)
Creates a new instance of ScalarDataDistribution
|
Modifier and Type | Method and Description |
---|---|
java.lang.Double |
evaluate(KeyType input)
Evaluates the function on the given input and returns the output.
|
DefaultDataDistribution.PMF<KeyType> |
getProbabilityFunction()
Gets the distribution function associated with this Distribution,
either the PDF or PMF.
|
double |
logEvaluate(KeyType input)
Evaluate the natural logarithm of the distribution function.
|
clear, clone, getEstimator, getMeanValue, getTotal, increment, set
fromInfiniteVector, getDomain, getDomainSize, getEntropy, getFraction, getLogFraction, getMaxValue, getMinValue, sample, sample, sampleInto, toInfiniteVector
asMap, compact, entrySet, get
containsKey, decrement, decrement, decrementAll, decrementAll, getMaxValueKey, getMaxValueKeys, getMinValueKey, getMinValueKeys, increment, incrementAll, incrementAll, isEmpty, keySet, setAll, setAll, size
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone, fromInfiniteVector, getEntropy, getEstimator, getFraction, getLogFraction, getTotal, toInfiniteVector
asMap, decrement, decrement, decrementAll, decrementAll, entrySet, get, getMaxValue, getMinValue, increment, increment, incrementAll, incrementAll, set, setAll, setAll
clear, containsKey, getMaxValueKey, getMaxValueKeys, getMinValueKey, getMinValueKeys, isEmpty, keySet, size
getEntropy
getDomain, getDomainSize
sample, sample, sampleInto
public PMF()
public PMF(DataDistribution<KeyType> other)
other
- ScalarDataDistribution to copypublic PMF(int initialCapacity)
initialCapacity
- Initial capacity of the Mappublic PMF(java.lang.Iterable<? extends KeyType> data)
data
- Data to create the distributionpublic double logEvaluate(KeyType input)
ProbabilityFunction
logEvaluate
in interface ProbabilityFunction<KeyType>
input
- The input to be evaluatedpublic java.lang.Double evaluate(KeyType input)
Evaluator
public DefaultDataDistribution.PMF<KeyType> getProbabilityFunction()
ComputableDistribution
getProbabilityFunction
in interface ComputableDistribution<KeyType>
getProbabilityFunction
in interface DataDistribution<KeyType>
getProbabilityFunction
in interface DiscreteDistribution<KeyType>
getProbabilityFunction
in interface ProbabilityMassFunction<KeyType>
getProbabilityFunction
in class DefaultDataDistribution<KeyType>