gov.sandia.cognition.statistics.distribution
Class DefaultDataDistribution.PMF<KeyType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.collection.AbstractScalarMap<KeyType>
          extended by gov.sandia.cognition.collection.AbstractMutableDoubleMap<KeyType>
              extended by gov.sandia.cognition.statistics.AbstractDataDistribution<KeyType>
                  extended by gov.sandia.cognition.statistics.distribution.DefaultDataDistribution<KeyType>
                      extended by gov.sandia.cognition.statistics.distribution.DefaultDataDistribution.PMF<KeyType>
Type Parameters:
KeyType - Type of Key in the distribution
All Implemented Interfaces:
NumericMap<KeyType>, ScalarMap<KeyType>, Evaluator<KeyType,Double>, ComputableDistribution<KeyType>, DataDistribution<KeyType>, DataDistribution.PMF<KeyType>, DiscreteDistribution<KeyType>, Distribution<KeyType>, EstimableDistribution<KeyType,DataDistribution<KeyType>>, ProbabilityFunction<KeyType>, ProbabilityMassFunction<KeyType>, CloneableSerializable, Serializable, Cloneable
Enclosing class:
DefaultDataDistribution<KeyType>

public static class DefaultDataDistribution.PMF<KeyType>
extends DefaultDataDistribution<KeyType>
implements DataDistribution.PMF<KeyType>

PMF of the DefaultDataDistribution

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class gov.sandia.cognition.statistics.distribution.DefaultDataDistribution
DefaultDataDistribution.DefaultFactory<DataType>, DefaultDataDistribution.Estimator<KeyType>, DefaultDataDistribution.PMF<KeyType>, DefaultDataDistribution.WeightedEstimator<KeyType>
 
Nested classes/interfaces inherited from class gov.sandia.cognition.collection.AbstractMutableDoubleMap
AbstractMutableDoubleMap.SimpleEntry<KeyType>, AbstractMutableDoubleMap.SimpleEntrySet<KeyType>, AbstractMutableDoubleMap.SimpleIterator<KeyType>
 
Nested classes/interfaces inherited from class gov.sandia.cognition.collection.AbstractScalarMap
AbstractScalarMap.MapWrapper
 
Nested classes/interfaces inherited from interface gov.sandia.cognition.statistics.DataDistribution
DataDistribution.PMF<KeyType>
 
Nested classes/interfaces inherited from interface gov.sandia.cognition.collection.ScalarMap
ScalarMap.Entry<KeyType>
 
Field Summary
 
Fields inherited from class gov.sandia.cognition.statistics.distribution.DefaultDataDistribution
DEFAULT_INITIAL_CAPACITY, total
 
Fields inherited from class gov.sandia.cognition.collection.AbstractMutableDoubleMap
map
 
Constructor Summary
DefaultDataDistribution.PMF()
          Default constructor
DefaultDataDistribution.PMF(DataDistribution<KeyType> other)
          Copy constructor
DefaultDataDistribution.PMF(int initialCapacity)
          Creates a new instance of DefaultDataDistribution
DefaultDataDistribution.PMF(Iterable<? extends KeyType> data)
          Creates a new instance of ScalarDataDistribution
 
Method Summary
 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.
 
Methods inherited from class gov.sandia.cognition.statistics.distribution.DefaultDataDistribution
clear, clone, getEstimator, getMeanValue, getTotal, increment, set
 
Methods inherited from class gov.sandia.cognition.statistics.AbstractDataDistribution
fromInfiniteVector, getDomain, getDomainSize, getEntropy, getFraction, getLogFraction, getMaxValue, getMinValue, sample, sample, toInfiniteVector
 
Methods inherited from class gov.sandia.cognition.collection.AbstractMutableDoubleMap
asMap, compact, containsKey, entrySet, get, keySet, size
 
Methods inherited from class gov.sandia.cognition.collection.AbstractScalarMap
decrement, decrement, decrementAll, decrementAll, getMaxValueKey, getMaxValueKeys, getMinValueKey, getMinValueKeys, increment, incrementAll, incrementAll, isEmpty, setAll
 
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.DataDistribution
clone, fromInfiniteVector, getEntropy, getEstimator, getFraction, getLogFraction, getTotal, toInfiniteVector
 
Methods inherited from interface gov.sandia.cognition.collection.ScalarMap
asMap, decrement, decrement, decrementAll, decrementAll, entrySet, get, getMaxValue, getMinValue, increment, increment, incrementAll, incrementAll, set, setAll
 
Methods inherited from interface gov.sandia.cognition.collection.NumericMap
clear, containsKey, getMaxValueKey, getMaxValueKeys, getMinValueKey, getMinValueKeys, isEmpty, keySet, size
 
Methods inherited from interface gov.sandia.cognition.statistics.ProbabilityMassFunction
getEntropy
 
Methods inherited from interface gov.sandia.cognition.statistics.DiscreteDistribution
getDomain, getDomainSize
 
Methods inherited from interface gov.sandia.cognition.statistics.Distribution
sample, sample
 

Constructor Detail

DefaultDataDistribution.PMF

public DefaultDataDistribution.PMF()
Default constructor


DefaultDataDistribution.PMF

public DefaultDataDistribution.PMF(DataDistribution<KeyType> other)
Copy constructor

Parameters:
other - ScalarDataDistribution to copy

DefaultDataDistribution.PMF

public DefaultDataDistribution.PMF(int initialCapacity)
Creates a new instance of DefaultDataDistribution

Parameters:
initialCapacity - Initial capacity of the Map

DefaultDataDistribution.PMF

public DefaultDataDistribution.PMF(Iterable<? extends KeyType> data)
Creates a new instance of ScalarDataDistribution

Parameters:
data - Data to create the distribution
Method Detail

logEvaluate

public double logEvaluate(KeyType 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<KeyType>
Returns:
Natural logarithm of the distribution function.

evaluate

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

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

getProbabilityFunction

public DefaultDataDistribution.PMF<KeyType> 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<KeyType>
Specified by:
getProbabilityFunction in interface DataDistribution<KeyType>
Specified by:
getProbabilityFunction in interface DiscreteDistribution<KeyType>
Specified by:
getProbabilityFunction in interface ProbabilityMassFunction<KeyType>
Overrides:
getProbabilityFunction in class DefaultDataDistribution<KeyType>
Returns:
Distribution function associated with this Distribution.