public class ScalarDataDistribution extends DefaultDataDistribution<java.lang.Double> implements UnivariateDistribution<java.lang.Double>
Modifier and Type | Class and Description |
---|---|
static class |
ScalarDataDistribution.CDF
CDF of the ScalarDataDistribution, maintains the keys/domain in
sorted order (TreeMap), so it's slower than it's peers.
|
static class |
ScalarDataDistribution.Estimator
Estimator for a ScalarDataDistribution
|
static class |
ScalarDataDistribution.PMF
PMF of the ScalarDataDistribution
|
DefaultDataDistribution.DefaultFactory<DataType>, DefaultDataDistribution.WeightedEstimator<KeyType>
AbstractMutableDoubleMap.Entry<KeyType>, AbstractMutableDoubleMap.SimpleEntry<KeyType>, AbstractMutableDoubleMap.SimpleEntrySet<KeyType>, AbstractMutableDoubleMap.SimpleIterator<KeyType>
ScalarMap.Entry<KeyType>
DEFAULT_INITIAL_CAPACITY, total
map
Modifier | Constructor and Description |
---|---|
|
ScalarDataDistribution()
Creates a new instance of ScalarDataDistribution
|
|
ScalarDataDistribution(java.lang.Iterable<? extends java.lang.Number> data)
Creates a new instance of ScalarDataDistribution
|
protected |
ScalarDataDistribution(java.util.Map<java.lang.Double,MutableDouble> map,
double total)
Creates a new instance of ScalarDataDistribution
|
|
ScalarDataDistribution(ScalarDataDistribution other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
ScalarDataDistribution |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
ScalarDataDistribution.CDF |
getCDF()
Gets the CDF of a scalar distribution.
|
ScalarDataDistribution.Estimator |
getEstimator()
Gets an estimator associated with this distribution.
|
java.lang.Double |
getMaxSupport()
Gets the minimum support (domain or input) of the distribution.
|
java.lang.Double |
getMean()
Gets the arithmetic mean, or "first central moment" or "expectation",
of the distribution.
|
double |
getMeanAsDouble()
Gets the mean of the distribution as a double.
|
java.lang.Double |
getMinSupport()
Gets the minimum support (domain or input) of the distribution.
|
ScalarDataDistribution.PMF |
getProbabilityFunction()
Gets the distribution function associated with this Distribution,
either the PDF or PMF.
|
double |
getVariance()
Gets the variance of the distribution.
|
clear, 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
sample, sample, sampleInto
asMap, decrement, decrement, decrementAll, decrementAll, entrySet, get, increment, incrementAll, incrementAll, setAll, setAll
containsKey, getMaxValueKey, getMaxValueKeys, getMinValueKey, getMinValueKeys, isEmpty, keySet, size
public ScalarDataDistribution()
public ScalarDataDistribution(ScalarDataDistribution other)
other
- ScalarDataDistribution to copypublic ScalarDataDistribution(java.lang.Iterable<? extends java.lang.Number> data)
data
- Data to create the distributionprotected ScalarDataDistribution(java.util.Map<java.lang.Double,MutableDouble> map, double total)
map
- total
- public ScalarDataDistribution clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface DataDistribution<java.lang.Double>
clone
in interface CloneableSerializable
clone
in class DefaultDataDistribution<java.lang.Double>
public ScalarDataDistribution.PMF getProbabilityFunction()
ComputableDistribution
getProbabilityFunction
in interface ComputableDistribution<java.lang.Double>
getProbabilityFunction
in interface DataDistribution<java.lang.Double>
getProbabilityFunction
in interface DiscreteDistribution<java.lang.Double>
getProbabilityFunction
in class DefaultDataDistribution<java.lang.Double>
public java.lang.Double getMean()
DistributionWithMean
getMean
in interface DistributionWithMean<java.lang.Double>
public double getMeanAsDouble()
UnivariateDistribution
getMeanAsDouble
in interface UnivariateDistribution<java.lang.Double>
public ScalarDataDistribution.Estimator getEstimator()
EstimableDistribution
getEstimator
in interface DataDistribution<java.lang.Double>
getEstimator
in interface EstimableDistribution<java.lang.Double,DataDistribution<java.lang.Double>>
getEstimator
in class DefaultDataDistribution<java.lang.Double>
public java.lang.Double getMinSupport()
UnivariateDistribution
getMinSupport
in interface UnivariateDistribution<java.lang.Double>
public java.lang.Double getMaxSupport()
UnivariateDistribution
getMaxSupport
in interface UnivariateDistribution<java.lang.Double>
public ScalarDataDistribution.CDF getCDF()
UnivariateDistribution
getCDF
in interface UnivariateDistribution<java.lang.Double>
@PublicationReference(title="Algorithms for calculating variance", type=WebPage, year=2010, author="Wikipedia", url="http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance") public double getVariance()
UnivariateDistribution
getVariance
in interface UnivariateDistribution<java.lang.Double>