Histogram.Normalization| Modifier and Type | Field and Description |
|---|---|
protected double[] |
breaks |
protected double |
cumulFrequencies |
protected double[] |
mids |
| Constructor and Description |
|---|
HistogramImpl() |
HistogramImpl(double binWidth,
double min,
double max)
Remark:
|
HistogramImpl(int binNumber,
double binWidth,
double min) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addBins(double[] bins)
Add
|
boolean |
addData(double value)
Add one occurrence of value
|
void |
addData(double[] values)
Add one occurrence of each value
|
void |
addData(double[] values,
double[] weights) |
boolean |
addData(double value,
double weight)
Add value contributing with weight
|
boolean |
addData(double value,
double weight,
com.google.common.base.Predicate<Double> predicate)
Add the data into this histogram if the given predicate is true
|
boolean |
addDataAtBin(double weight,
int index)
Add data at given bin
|
void |
clear()
Empty data
|
HistogramImpl |
copy()
Creates and returns a copy of this object.
|
boolean |
equals(Object o) |
double |
getAbsoluteBinFreq(int index)
Get the absolute frequency at given bin
|
double[] |
getAbsoluteBinFreqs(double[] dest) |
int |
getBinIndex(double value)
Get the bin index containing the given value (else must return -1)
|
double |
getBinWidth()
Get the bin width
|
double[] |
getBreaks(double[] dest)
Get the n+1 cells boundaries
|
double |
getCumulFreqs()
Get the counts of the cumulative number of observations in all bins
|
double |
getCumulFreqs(int fromIncluded,
int toExcluded)
Get the counts of the cumulative number of weighed observations in all of the bins in the specifed range
|
double[] |
getMids(double[] dest)
Get the n cell midpoints
|
int |
getMostIntenseBinIndex()
Get the most intense bin index
|
String |
getName()
Get its name
|
Set<Integer> |
getNonEmptyBinIndices()
Get the set of non-empty bins
|
com.google.common.collect.Range<Double> |
getRange()
Get the range of defined values (first to last bin)
|
double |
getRelativeBinFreq(int index)
Get the relative (normalized by the cumulative weights) weighted frequencies at given bin
|
double |
getRelativeBinFreq(int fromIncluded,
int toExcluded)
Get the relative (normalized by the cumulative weights) weighted frequencies between bins
|
int |
hashCode() |
protected void |
initBins(int binNumber) |
boolean |
isEmpty()
Return true if no data
|
Histogram |
normalize(Histogram.Normalization normalization)
Normalize histogram (weighted) frequencies
|
void |
setName(String name) |
HistogramImpl |
shallowCopy()
Copy the bin structure only
|
int |
size()
Get the number of bins (n)
|
String |
toString() |
static HistogramImpl |
valueOfBinNumWidthMin(int binNumber,
double binWidth,
double min) |
static HistogramImpl |
valueOfBinWidthMinMax(double binWidth,
double min,
double max) |
protected double cumulFrequencies
protected double[] mids
protected double[] breaks
public HistogramImpl()
public HistogramImpl(double binWidth,
double min,
double max)
binWidth - the width of bins.min - first bin lower bound (included).max - last bin upper bound (excluded)public HistogramImpl(int binNumber,
double binWidth,
double min)
public static HistogramImpl valueOfBinNumWidthMin(int binNumber, double binWidth, double min)
public static HistogramImpl valueOfBinWidthMinMax(double binWidth, double min, double max)
protected void initBins(int binNumber)
public HistogramImpl shallowCopy()
HistogramshallowCopy in interface Histogrampublic HistogramImpl copy()
Copyablex, the expression:
will be true, and that the expression:x.copy() != x
will bex.copy().getClass() == x.getClass()
true, but these are not absolute requirements.
While it is typically the case that:
will bex.copy().equals(x)
true, this is not an absolute requirement.
public void clear()
Histogrampublic boolean addBins(double[] bins)
bins - public boolean addDataAtBin(double weight,
int index)
HistogramaddDataAtBin in interface Histogrampublic double getAbsoluteBinFreq(int index)
HistogramgetAbsoluteBinFreq in interface Histogrampublic double[] getAbsoluteBinFreqs(double[] dest)
getAbsoluteBinFreqs in interface Histogrampublic int getMostIntenseBinIndex()
HistogramgetMostIntenseBinIndex in interface Histogrampublic Histogram normalize(Histogram.Normalization normalization)
Histogrampublic void setName(String name)
public boolean isEmpty()
Histogrampublic boolean addData(double value)
Histogrampublic boolean addData(double value,
double weight)
Histogrampublic void addData(double[] values)
Histogrampublic void addData(double[] values,
double[] weights)
public boolean addData(double value,
double weight,
com.google.common.base.Predicate<Double> predicate)
Histogrampublic com.google.common.collect.Range<Double> getRange()
Histogrampublic int size()
Histogrampublic Set<Integer> getNonEmptyBinIndices()
HistogramgetNonEmptyBinIndices in interface Histogrampublic double getBinWidth()
HistogramgetBinWidth in interface Histogrampublic double getRelativeBinFreq(int index)
HistogramgetRelativeBinFreq in interface Histogrampublic double getRelativeBinFreq(int fromIncluded,
int toExcluded)
HistogramgetRelativeBinFreq in interface Histogrampublic double getCumulFreqs()
HistogramgetCumulFreqs in interface Histogrampublic double getCumulFreqs(int fromIncluded,
int toExcluded)
HistogramgetCumulFreqs in interface Histogrampublic int getBinIndex(double value)
HistogramgetBinIndex in interface Histogrampublic double[] getBreaks(double[] dest)
Histogrampublic double[] getMids(double[] dest)
HistogramCopyright © 2016. All Rights Reserved.