public class Histogram
extends java.lang.Object
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected StatisticalMoments |
moments() |
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.
|
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 binspublic 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
- doublepublic long count()
public double errorOnAverage()
public double binHeight(double x)
x
- the random valuepublic double[] getBinParameters(double x)
public double getBinWidth()
public double getCountsBetween(double x, double y)
x
- doubley
- doublepublic double getCountsUpTo(double x)
x
- doublepublic double getDimension()
public int getNumBins()
public double getMaximum()
public double getMinimum()
public double[] getRange()
public double kurtosis()
protected StatisticalMoments moments()
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.