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.
|
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(File file)
Computes the empirical distribution from the input file.
|
void |
load(URL url)
Computes the empirical distribution using data read from a URL.
|
void load(double[] dataArray)
dataArray
- the data arrayvoid load(File file) throws IOException
file
- the input fileIOException
- if an IO error occursvoid load(URL url) throws IOException
url
- url of the input fileIOException
- if an IO error occursdouble getNextValue() throws IllegalStateException
IllegalStateException
- if the distribution has not been loadedStatisticalSummary getSampleStats() throws IllegalStateException
StatisticalSummary
describing this distribution.
Preconditions:IllegalStateException
- if the distribution has not been loadedboolean isLoaded()
int getBinCount()
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 © 2003–2018. All rights reserved.