|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.uci.ics.jung.statistics.Histogram
General-purpose class for representing experimental distributions via a histogram.
A histogram is primarily characterized by three things:
1) the minimum value in the data, minX
2) the bin width, w
3) the number of bins, n
*
The ith bin represents the interval [minX + (i-1)w, minX + i*w]. Each bin contains the
number of times a value in the original data set falls within its corresponding interval
| Constructor Summary | |
Histogram()
Constructor method with unknown limits and a desired number of 50 bins. |
|
Histogram(double from,
double to)
Constructor method for approximate range for a desired number of 50 bins. |
|
Histogram(double from,
double to,
int bins)
Constructor method for approximate range and desired number of bins. |
|
Histogram(int n)
Constructor method with unknown limits and a desired number of 50 bins. |
|
Histogram(int n,
double min,
double width)
General constructor method. |
|
Histogram(int n,
int m)
Constructor method with unknown limits. |
|
| Method Summary | |
double |
average()
Returns the average of the values accumulated in the histogram bins. |
double |
binHeight(double x)
retrieves the bin given a random value and returns the corresponding height of the bin |
int |
binIndex(double x)
|
long |
count()
Returns the number of accumulated counts. |
double |
errorOnAverage()
Returns the error on average. |
void |
fill(double x)
Fills with a random variable. |
void |
fill(cern.colt.list.DoubleArrayList list)
Fills the histogram with the list of random values |
double[] |
getBinParameters(double x)
Returns the low and high limits and the content of the bin containing the specified number or nul if the specified number lies outside of the histogram limits. |
double |
getBinWidth()
Returns the bin width. |
double |
getCountsBetween(double x,
double y)
|
double |
getCountsUpTo(double x)
|
double |
getDimension()
Deprecated. use getNumBins |
double |
getMaximum()
|
double |
getMinimum()
Returns the lower bin limit of the first bin. |
int |
getNumBins()
|
double[] |
getRange()
Returns the range of values to be plotted. |
double |
kurtosis()
Returns the kurtosis of the values accumulated in the histogram bins. |
long |
overflow()
Returns the number of counts accumulated below the lowest bin. |
void |
reset()
Reset histogram. |
void |
setGrowthAllowed()
Allows histogram contents to grow in order to contain all accumulated values. |
void |
setIntegerBinWidth()
Forces the bin width of the histogram to be integer. |
int |
size()
Returns the number of points in the series. |
double |
skewness()
Returns the skewness of the values accumulated in the histogram bins. |
double |
standardDeviation()
Returns the standard deviation of the values accumulated in the histogram bins. |
long |
totalCount()
|
long |
underflow()
Returns the number of counts accumulated below the lowest bin. |
double |
variance()
Returns the variance of the values accumulated in the histogram bins. |
double |
xValueAt(int index)
Returns the end of the bin at the specified index. |
double |
yValueAt(int index)
Returns the content of the bin at the given index. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Histogram()
public Histogram(double from,
double to)
from - approximate lower limit of first histogram bin.to - approximate upper limit of last histogram bin.
public Histogram(double from,
double to,
int bins)
from - approximate lower limit of first histogram bin.to - approximate upper limit of last histogram bin.bins - desired number of bins.public Histogram(int n)
n - size of cache.
public Histogram(int n,
double min,
double width)
throws java.lang.IllegalArgumentException
n - number of bins.min - lower limit of first histogram bin.width - bin width (must be positive).
java.lang.IllegalArgumentException - if the number of bins is non-positive,
if the limits are inversed.
public Histogram(int n,
int m)
n - size of cache.m - desired number of bins| Method Detail |
public void fill(cern.colt.list.DoubleArrayList list)
list - a list of double valuespublic void fill(double x)
x - value of the random variable.public double average()
public int binIndex(double x)
x - double
public long count()
public double errorOnAverage()
public double binHeight(double x)
x - the random value
public double[] getBinParameters(double x)
public double getBinWidth()
public double getCountsBetween(double x,
double y)
x - doubley - double
public double getCountsUpTo(double x)
x - double
public double getDimension()
public int getNumBins()
public double getMaximum()
public double getMinimum()
public double[] getRange()
public double kurtosis()
public long overflow()
public void reset()
public void setGrowthAllowed()
throws java.lang.RuntimeException
java.lang.RuntimeException - if the histogram has some contents.
public void setIntegerBinWidth()
throws java.lang.RuntimeException
java.lang.RuntimeException - if the histogram has some contents.public int size()
public double skewness()
public double standardDeviation()
public long totalCount()
public long underflow()
public double variance()
public double xValueAt(int index)
index - the index of the bin.
public double yValueAt(int index)
index - the index of the bin.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||