public class Bin
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Constructor and Description |
---|
Bin(double lowerBound,
double upperBound,
boolean lowerInclusive)
Creates a histogram bin with the most amount of flexibility in the arguments.
|
Bin(double lowerBound,
double upperBound,
boolean lowerInclusive,
boolean upperInclusive)
This constructor is mainly used when the bin is used for something other than a histogram.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object obj)
Evaluates the equality of of two bins.
|
double |
getBinMean()
Gets the mean of the bin.
|
double |
getBinWidth()
Gets the bin width.
|
double |
getFrequency()
Gets the frequency of observations in the bin.
|
double |
getLowerBound()
Gets the lower bound of the bin.
|
double |
getMidPoint()
Get the bin midpiont.
|
double |
getUpperBound()
Gets the upper bound of the bin.
|
boolean |
inBin(double value)
Tests whether a value belongs to this bin.
|
void |
increment(double value)
Incrementally count a value as belonging to this bin if it fits within the bounds.
|
void |
increment(double value,
double frequency)
Incrementally count a value as belonging to this bin if it fits within the bounds.
|
boolean |
lowerInclusive()
Gets a boolean indicating whether the bin is lower inclusive or not.
|
public Bin(double lowerBound, double upperBound, boolean lowerInclusive)
lowerBound
- lower bound of the bin.upperBound
- upper bound of the bin.lowerInclusive
- a value equal to the lower bound is counted in this bin if true. Otherwise, it is not
counted in this bin.public Bin(double lowerBound, double upperBound, boolean lowerInclusive, boolean upperInclusive)
Deciles
.lowerBound
- lower bound of the bin.upperBound
- upper bound of the bin.lowerInclusive
- a value equal to the lower bound is counted in this bin if true. Otherwise, it is not
counted in this bin.upperInclusive
- a value equal to the upper bound is counted in this bin if true. Otherwise, it is not
counted in this bin.public void increment(double value)
value
- a value to be counted.public void increment(double value, double frequency)
value
- a value to be counted.frequency
- a frequency weight for the observation.public boolean inBin(double value)
value
- a value to be tested.public double getMidPoint()
public double getBinMean()
public double getFrequency()
public double getLowerBound()
public double getUpperBound()
public boolean lowerInclusive()
public double getBinWidth()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException