gov.sandia.cognition.statistics.distribution
Class DataCountTreeSetBinnedMapHistogram<ValueType extends Comparable<? super ValueType>>

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<ValueType>
                      extended by gov.sandia.cognition.statistics.distribution.DataCountTreeSetBinnedMapHistogram<ValueType>
Type Parameters:
ValueType - Value for the domain (x-axis, independent variable), may be something like an Integer, etc; must be Comparable for use with TreeSetBinner.
All Implemented Interfaces:
NumericMap<ValueType>, ScalarMap<ValueType>, ComputableDistribution<ValueType>, DataDistribution<ValueType>, DiscreteDistribution<ValueType>, Distribution<ValueType>, EstimableDistribution<ValueType,DataDistribution<ValueType>>, CloneableSerializable, Serializable, Cloneable

@CodeReview(reviewer="Justin Basilico",
            date="2009-05-29",
            changesNeeded=false,
            comments="Cleaned up the formatting and javadoc.")
public class DataCountTreeSetBinnedMapHistogram<ValueType extends Comparable<? super ValueType>>
extends DefaultDataDistribution<ValueType>

The DataCountTreeSetBinnedMapHistogram class extends a DefaultDataDistribution by mapping values to user defined bins using a TreeSetBinner. The values in a given bin are inclusive of the lower bound of the bin and exclusive of the upper bound of the bin.

Since:
2.0
Author:
Zachary Benz
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.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
DataCountTreeSetBinnedMapHistogram(Collection<? extends ValueType> binBoundaries)
          Creates a new DataCountTreeBinnedMapHistogram using the provided list of bin boundaries.
DataCountTreeSetBinnedMapHistogram(TreeSetBinner<ValueType> binner)
          Creates a new DataCountTreeBinnedMapHistogram using the provided TreeSetBinner.
 
Method Summary
 double decrement(ValueType key, double value)
          Decrements the value associated with the given key by the given amount.
 int getBinCount()
          Gets the total number of bins.
 TreeSetBinner<ValueType> getBinner()
          Gets the TreeSetBinner used to perform value binning.
 double increment(ValueType key, double value)
          Increments the value associated with the given key by the given amount.
 
Methods inherited from class gov.sandia.cognition.statistics.distribution.DefaultDataDistribution
clear, clone, getEstimator, getMeanValue, getProbabilityFunction, getTotal, 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, 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.collection.ScalarMap
asMap, decrement, decrementAll, decrementAll, entrySet, get, increment, incrementAll, incrementAll, setAll
 
Methods inherited from interface gov.sandia.cognition.collection.NumericMap
containsKey, getMaxValueKey, getMaxValueKeys, getMinValueKey, getMinValueKeys, isEmpty, keySet, size
 

Constructor Detail

DataCountTreeSetBinnedMapHistogram

public DataCountTreeSetBinnedMapHistogram(TreeSetBinner<ValueType> binner)
Creates a new DataCountTreeBinnedMapHistogram using the provided TreeSetBinner.

Parameters:
binner - The TreeSetBinner to use to perform value binning.

DataCountTreeSetBinnedMapHistogram

public DataCountTreeSetBinnedMapHistogram(Collection<? extends ValueType> binBoundaries)
Creates a new DataCountTreeBinnedMapHistogram using the provided list of bin boundaries. The bin boundary list will be used to initialize a TreeSetBinner for performing value binning.

Parameters:
binBoundaries - The values to be used as boundary cutoffs for bins; bin membership is inclusive of the lower bin bound and exclusive of the upper bin bound.
Method Detail

increment

public double increment(ValueType key,
                        double value)
Description copied from interface: ScalarMap
Increments the value associated with the given key by the given amount.

Specified by:
increment in interface ScalarMap<ValueType extends Comparable<? super ValueType>>
Overrides:
increment in class DefaultDataDistribution<ValueType extends Comparable<? super ValueType>>
Parameters:
key - A key.
value - The amount to increment the value associated with the given key by.
Returns:
The new value associated with the key.

decrement

public double decrement(ValueType key,
                        double value)
Description copied from interface: ScalarMap
Decrements the value associated with the given key by the given amount.

Specified by:
decrement in interface ScalarMap<ValueType extends Comparable<? super ValueType>>
Overrides:
decrement in class AbstractScalarMap<ValueType extends Comparable<? super ValueType>>
Parameters:
key - A key.
value - The amount to decrement the value associated with the given key by.
Returns:
The new value associated with the key.

getBinCount

public int getBinCount()
Gets the total number of bins.

Returns:
The total number of bins.

getBinner

public TreeSetBinner<ValueType> getBinner()
Gets the TreeSetBinner used to perform value binning.

Returns:
TreeSetBinner used to perform value binning.