|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents an empirical probability distribution -- a probability distribution derived from observed data without making any assumptions about the functional form of the population distribution that the data come from.
Implementations of this interface maintain data structures, called distribution digests, that describe empirical distributions and support the following operations:
EmpiricalDistribution
implementations to
build grouped frequnecy 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.
Method Summary | |
int |
getBinCount()
Returns the number of bins. |
java.util.List |
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. |
Method Detail |
public void load(double[] dataArray)
dataArray
- the data arraypublic void load(java.io.File file) throws java.io.IOException
file
- the input file
java.io.IOException
- if an IO error occurspublic void load(java.net.URL url) throws java.io.IOException
url
- url of the input file
java.io.IOException
- if an IO error occurspublic double getNextValue() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if the distribution has not been loadedpublic StatisticalSummary getSampleStats() throws java.lang.IllegalStateException
StatisticalSummary
describing this distribution.
Preconditions:
java.lang.IllegalStateException
- if the distribution has not been loadedpublic boolean isLoaded()
public int getBinCount()
public java.util.List getBinStats()
SummaryStatistics
containing statistics describing the values in each of the bins. The
List is indexed on the bin number.
public double[] getUpperBounds()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |