|
|||||||||||
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 |
ArrayList |
getBinStats()
Returns a list of Univariates containing statistics describing the values in each of the bins. |
double |
getNextValue()
Generates a random value from this distribution. |
DescriptiveStatistics |
getSampleStats()
Returns a DescriptiveStatistics 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(File file)
Computes the empirical distribution from the input file. |
void |
load(String filePath)
Computes the empirical distribution from the input file. |
void |
load(URL url)
Computes the empirical distribution using data read from a URL. |
void |
loadDistribution(File file)
Loads a saved distribution from a file. |
void |
loadDistribution(String filePath)
Loads a saved distribution from a file. |
void |
saveDistribution(File file)
Saves distribution to a file. |
void |
saveDistribution(String filePath)
Saves distribution to a file. |
Method Detail |
public void load(String filePath) throws IOException
filePath
- fully qualified name of a file in the local file system
IOException
- if an IO error occurspublic void load(File file) throws IOException
file
- the input file
IOException
- if an IO error occurspublic void load(URL url) throws IOException
IOException
- if an IO error occurspublic double getNextValue() throws IllegalStateException
IllegalStateException
- if the distribution has not been loadedpublic DescriptiveStatistics getSampleStats() throws IllegalStateException
IllegalStateException
- if the distribution has not been loadedpublic void loadDistribution(File file) throws IOException
file
- File reference for a file containing a digested distribution
IOException
- if an error occurs reading the filepublic void loadDistribution(String filePath) throws IOException
filePath
- fully qualified file path for a file
containing a digested distribution
IOException
- if an error occurs reading the filepublic void saveDistribution(String filePath) throws IOException, IllegalStateException
filePath
- fully qualified file path for the file to be written
IOException
- if an error occurs reading the file
IllegalStateException
- if the distribution has not been loadedpublic void saveDistribution(File file) throws IOException, IllegalStateException
file
- File reference for the file to be written
IOException
- if an error occurs reading the file
IllegalStateException
- if the distribution has not been loadedpublic boolean isLoaded()
public int getBinCount()
public ArrayList getBinStats()
public double[] getUpperBounds()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |