| org.apache.commons.math.random.EmpiricalDistribution
All known Subclasses: org.apache.commons.math.random.EmpiricalDistributionImpl,
EmpiricalDistribution | public interface EmpiricalDistribution (Code) | | 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:
- loading the distribution from a file of observed data values
- dividing the input data into "bin ranges" and reporting bin frequency
counts (data for histogram)
- reporting univariate statistics describing the full set of data values
as well as the observations within each bin
- generating random values from the distribution
Applications can use 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.
version: $Revision: 155427 $ $Date: 2005-02-26 06:11:52 -0700 (Sat, 26 Feb 2005) $ |
getBinCount | int getBinCount()(Code) | | Returns the number of bins.
the number of bins |
getNextValue | double getNextValue() throws IllegalStateException(Code) | | Generates a random value from this distribution.
Preconditions:
- the distribution must be loaded before invoking this method
the random value. throws: IllegalStateException - if the distribution has not been loaded |
getUpperBounds | double[] getUpperBounds()(Code) | | Returns the array of upper bounds for the bins. Bins are:
[min,upperBounds[0]],(upperBounds[0],upperBounds[1]],...,
(upperBounds[binCount-1],max].
array of bin upper bounds |
isLoaded | boolean isLoaded()(Code) | | Property indicating whether or not the distribution has been loaded.
true if the distribution has been loaded |
load | void load(double[] dataArray)(Code) | | Computes the empirical distribution from the provided
array of numbers.
Parameters: dataArray - the data array |
load | void load(File file) throws IOException(Code) | | Computes the empirical distribution from the input file.
Parameters: file - the input file throws: IOException - if an IO error occurs |
load | void load(URL url) throws IOException(Code) | | Computes the empirical distribution using data read from a URL.
Parameters: url - url of the input file throws: IOException - if an IO error occurs |
|
|