public interface EmpiricalDistribution
Implementations of this interface maintain data structures, called distribution digests, that describe empirical distributions and support the following operations:
EmpiricalDistribution
implementations to
build grouped frequency histograms representing the input data or to
generate random values "like" those in the input file -- i.e., the values
generated will follow the distribution of the values in the file.Modifier and Type | Method and Description |
---|---|
int |
getBinCount()
Returns the number of bins.
|
java.util.List<SummaryStatistics> |
getBinStats()
Returns a list of
SummaryStatistics
containing statistics describing the values in each of the bins. |
double |
getNextValue()
Generates a random value from this distribution.
|
StatisticalSummary |
getSampleStats()
Returns a
StatisticalSummary
describing this distribution. |
double[] |
getUpperBounds()
Returns the array of upper bounds for the bins.
|
boolean |
isLoaded()
Property indicating whether or not the distribution has been loaded.
|
void |
load(double[] dataArray)
Computes the empirical distribution from the provided
array of numbers.
|
void |
load(java.io.File file)
Computes the empirical distribution from the input file.
|
void |
load(java.net.URL url)
Computes the empirical distribution using data read from a URL.
|
void load(double[] dataArray)
dataArray
- the data arrayvoid load(java.io.File file) throws java.io.IOException
file
- the input filejava.io.IOException
- if an IO error occursvoid load(java.net.URL url) throws java.io.IOException
url
- url of the input filejava.io.IOException
- if an IO error occursdouble getNextValue() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the distribution has not been loadedStatisticalSummary getSampleStats() throws java.lang.IllegalStateException
StatisticalSummary
describing this distribution.
Preconditions:java.lang.IllegalStateException
- if the distribution has not been loadedboolean isLoaded()
int getBinCount()
java.util.List<SummaryStatistics> getBinStats()
SummaryStatistics
containing statistics describing the values in each of the bins. The
List is indexed on the bin number.double[] getUpperBounds()
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"