public class StatOnLongs
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_FACTOR |
static double |
DEFAULT_PERCENT_MIN |
protected java.util.logging.Logger |
logger |
static int |
MIN_SIZE_OF_STATISTICAL_DATA |
Constructor and Description |
---|
StatOnLongs()
longStat empty constructor
|
StatOnLongs(int initialCapacity)
Constructs a LongStatistics with an empty list of long contructed with
the specified initial capacity.
|
StatOnLongs(ListOfLong listOfLong)
longStat constructor based on existing ListOfLong.
|
Modifier and Type | Method and Description |
---|---|
void |
addAll(ListOfLong lol)
adds a ListOfLong in the current one managed by this LongStatistics
|
void |
addAll(StatOnLongs ls)
adds a copy of ListOfLong managed by the supplied StatOnLongs in the
current one managed by this LongStatistics
|
void |
addLong(long value)
adds a long value in data
|
ListOfLong |
getData()
gets data as a list of long
|
long |
getLongAt(int index)
get long value at the specified position in this list (ith value, in
chronological order)
|
java.lang.Long |
getMax()
gets the max value of raw data
|
int |
getMaxStatSortIndex() |
long |
getMaxStatSortValue() |
double |
getMean()
gets average of raw data
|
java.lang.Long |
getMedian()
median calculation of raw data
|
java.lang.Long |
getMedian(int beginIndex,
int endIndex)
Returns median of data part.
|
java.lang.Long |
getMin()
gets the min value of raw data
|
int |
getMinStatSortIndex() |
long |
getMinStatSortValue() |
double |
getNumberOfValues(ListOfLong data,
int timeStartCurrent,
int timeEndCurrent)
Get the number of values in interval
|
ListOfLong |
getSortedData() |
long |
getSortedValue(int index) |
double |
getStatisticalSortFactor()
gets the factor of statistical rejection (mean +/- factor*std)
|
double |
getStatisticalSortPercentage()
gets the target percentage of kept measures after statistical rejection
|
int |
getStatSortDataNumber() |
double |
getStatSortMean()
computes the statistical mean
|
long |
getStatSortMedian()
computes the statistical median (could be more robust in case of non-bell
distribution).
|
double |
getStatSortStd()
computes the standard deviation through statistical rejection
|
double |
getStd()
gets the standard deviation of raw data
|
double |
keptRate()
keptRate the percent rate of kept values as one digit after dot
|
void |
outputData()
outputData the original data as one value per line
|
void |
outputData(int numberOfColumn)
outputData the original data as an Array of "number" columns.
|
void |
outputSortedData()
outputSortedData the sorted data as one value per line
|
void |
outputSortedData(int numberOfColumn)
outputSortedData the sorted data as an Array of "number" columns.
|
void |
removeLongAt(int index)
remove long value at the specified position in this list.
|
void |
reset()
resets the environment
|
void |
setLogger(java.util.logging.Logger log)
to specify a logger when you want to log something.
|
void |
setStatisticalSortFactor(double factor)
sets the factor of statistical sort (rejection based on mean +/-
factor*std).
|
void |
setStatisticalSortPercentage(double percentage)
sets the target percentage of kept measures after statistical rejection
in order to avoid to clear data during statistical rejection.
|
int |
size()
gets the data size
|
long |
subMax(int n,
int m)
the list of the sorted values is divided in m equal parts, the median
from the best value (minimal) till the n_th part (included) is returned
|
double |
subMean(int n,
int m)
the list of the sorted values is divided in m equal parts the mean of the
n_th part of the best values is returned
|
double |
subMean(int n1,
int n2,
int m)
the list of the sorted values is divided in m equal parts (m>0) mean of
the sets [n1..n2] (n1 till n2, 0 < n1 < n2 <= m )
|
long |
subMedian(int n,
int m)
the list of the sorted values is divided in m equal parts, the median
from the best value (minimal) till the n_th part (included) is returned
|
long |
subMin(int n,
int m)
the list of the sorted values is divided in m equal parts, the median
from the best value (minimal) till the n_th part (included) is returned
|
protected java.util.logging.Logger logger
public static final int MIN_SIZE_OF_STATISTICAL_DATA
public static final double DEFAULT_PERCENT_MIN
public static final double DEFAULT_FACTOR
public StatOnLongs()
public StatOnLongs(int initialCapacity)
initialCapacity
- public StatOnLongs(ListOfLong listOfLong)
listOfLong
- the ListOfLong as initial value.public void setLogger(java.util.logging.Logger log)
public void reset()
public ListOfLong getData()
public ListOfLong getSortedData()
public void addLong(long value)
value
- to be added to datapublic void addAll(StatOnLongs ls)
ls
- the LongStatistics to be added in the current onepublic void addAll(ListOfLong lol)
lol
- the ListOfLong to be added in the current onepublic void removeLongAt(int index)
index
- the positionpublic long getLongAt(int index)
index
- the positionpublic int size()
public double getStatisticalSortFactor()
public void setStatisticalSortFactor(double factor) throws java.lang.IllegalArgumentException
factor
- that must be greater than 0.java.lang.IllegalArgumentException
- if an input parameter is illegalpublic double getStatisticalSortPercentage()
public void setStatisticalSortPercentage(double percentage) throws java.lang.IllegalArgumentException
percentage
- (0.0 < rate <= 100.0)java.lang.IllegalArgumentException
- if an input parameter is illegalpublic void outputData()
public void outputData(int numberOfColumn)
numberOfColumn
- to format the values.public void outputSortedData()
public void outputSortedData(int numberOfColumn)
numberOfColumn
- to format the values.public java.lang.Long getMin()
public java.lang.Long getMax()
public java.lang.Long getMedian(int beginIndex, int endIndex)
beginIndex
- -
the beginning index, inclusive.endIndex
- -
the ending index, inclusive.public java.lang.Long getMedian()
public double getMean()
public double getStd()
public double subMean(int n, int m) throws java.lang.Exception
n
- n_th partm
- m equal partsjava.lang.Exception
public double subMean(int n1, int n2, int m) throws java.lang.Exception
n1
- start partn2
- end partm
- m equal partsjava.lang.Exception
public long subMin(int n, int m) throws java.lang.Exception
n
- n_th partm
- equal partsjava.lang.Exception
public long subMax(int n, int m) throws java.lang.Exception
n
- n_th partm
- equal partsjava.lang.Exception
public long subMedian(int n, int m) throws java.lang.Exception
n
- n_th partm
- equal partsjava.lang.Exception
public long getStatSortMedian()
public double getStatSortMean()
public double getStatSortStd()
public double keptRate()
public int getMinStatSortIndex()
public int getMaxStatSortIndex()
public int getStatSortDataNumber()
public long getMinStatSortValue()
public long getMaxStatSortValue()
public long getSortedValue(int index)
public double getNumberOfValues(ListOfLong data, int timeStartCurrent, int timeEndCurrent)
data
- timeStartCurrent
- timeEndCurrent
-