public class FrequencyTable extends Object
Each entry in the table contains the frequency or count of the occurrences of values within a particular interval, and in this way, the table summarizes the distribution of values in the sample.
| Constructor and Description |
|---|
FrequencyTable(double binSize)
Construct a new FrequencyTable that has intervals that have a width of
binSize |
FrequencyTable(double binSize,
String name)
Construct a new FrequencyTable that has intervals that have a width of
binSize |
| Modifier and Type | Method and Description |
|---|---|
void |
add(double value)
Add a value to this table
|
void |
addAll(FrequencyTable frequencyTable) |
int |
getBinId(double value)
Return the id of the bin (interval) that the
value falls in. |
int[] |
getBinIds()
Returns an array that holds the ids of the bins (intervals) that contain values.
|
double |
getBinSize()
Return the bin size.
|
double |
getCenter(int binId)
Return the center value of the bin at index
binId |
int |
getFrequency(int binId)
Return the number of values that fall in the bin (interval) for the given
binId |
double |
getMax(int binId)
Return the max value of the bin at index
binId |
int |
getMaxBinId()
Return the id of the largest bin that contains a value
|
double |
getMin(int binId)
Return the min value of the bin at index
binId |
int |
getMinBinId()
Return the id of the smallest bin that contains a value
|
String |
getName()
Return the name of this FrequencyTable
|
int |
getTotal()
Return the total number of values in this table.
|
String |
toString() |
String |
toString(boolean normalise)
Returns a string representation of this FrequencyTable
|
static String |
toString(String countName,
FrequencyTable... tables)
Summarize the tables in one string
|
static String |
toStringNotNormalize(String countName,
FrequencyTable... tables)
Summarize the tables in one string without normalizing the frequencies
|
static gnu.trove.list.array.TDoubleArrayList[] |
toTable(FrequencyTable... tables)
Create an array of TDoubleArrayList that contains the frequencies from the tables
|
public FrequencyTable(double binSize)
binSizebinSize - the width of the intervalspublic FrequencyTable(double binSize,
String name)
binSizebinSize - the width of the intervalsname - the name of the tablepublic void add(double value)
value - the value to addpublic int getTotal()
public int[] getBinIds()
public int getFrequency(int binId)
binIdbinId - the bin for which the frequency is to be returnedbinIdpublic int getBinId(double value)
value falls in.value - the valevalue falls inpublic double getCenter(int binId)
binIdbinId - the index of the binbinIdpublic double getMin(int binId)
binIdbinId - the index of the binbinIdpublic double getMax(int binId)
binIdbinId - the index of the binbinIdpublic int getMinBinId()
public int getMaxBinId()
public double getBinSize()
public String toString(boolean normalise)
normalise - true if the frequencies are to be normalizedpublic String getName()
public static String toString(String countName, FrequencyTable... tables)
countName - the name of the valuestables - the tablespublic static String toStringNotNormalize(String countName, FrequencyTable... tables)
countName - the name of the valuestables - the tablespublic static gnu.trove.list.array.TDoubleArrayList[] toTable(FrequencyTable... tables)
tables - the tablespublic void addAll(FrequencyTable frequencyTable)
Copyright © 2016. All Rights Reserved.