|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.commons.math.random.EmpiricalDistributionImpl
Implements EmpiricalDistribution interface. This implementation
uses what amounts to the
Variable Kernel Method with Gaussian smoothing:
Digesting the input file
binCount "bins."USAGE NOTES:
binCount is set by default to 1000. A good rule of thumb
is to set the bin count to approximately the length of the input file divided
by 10.
| Constructor Summary | |
EmpiricalDistributionImpl()
Creates a new EmpiricalDistribution with the default bin count. |
|
EmpiricalDistributionImpl(int binCount)
Creates a new EmpiricalDistribution with the specified bin count. |
|
| Method Summary | |
int |
getBinCount()
Returns the number of bins. |
List |
getBinStats()
Returns an ArrayList of SummaryStatistics instances 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 (a fresh copy of) the array of upper bounds for the bins. |
boolean |
isLoaded()
Property indicating whether or not the distribution has been loaded. |
void |
load(double[] in)
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public EmpiricalDistributionImpl()
public EmpiricalDistributionImpl(int binCount)
binCount - number of bins| Method Detail |
public void load(double[] in)
load in interface EmpiricalDistributionin - the input data array
public void load(URL url)
throws IOException
load in interface EmpiricalDistributionurl - url of the input file
IOException - if an IO error occurs
public void load(File file)
throws IOException
load in interface EmpiricalDistributionfile - the input file
IOException - if an IO error occurs
public double getNextValue()
throws IllegalStateException
getNextValue in interface EmpiricalDistributionIllegalStateException - if the distribution has not been loadedpublic StatisticalSummary getSampleStats()
StatisticalSummary describing this distribution.
Preconditions:
getSampleStats in interface EmpiricalDistributionIllegalStateException - if the distribution has not been loadedpublic int getBinCount()
getBinCount in interface EmpiricalDistributionpublic List getBinStats()
SummaryStatistics instances containing
statistics describing the values in each of the bins. The ArrayList is
indexed on the bin number.
getBinStats in interface EmpiricalDistributionpublic double[] getUpperBounds()
getUpperBounds in interface EmpiricalDistributionpublic boolean isLoaded()
isLoaded in interface EmpiricalDistribution
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||