Package jsl.utilities.statistic
Class AbstractStatistic
- java.lang.Object
-
- jsl.utilities.statistic.AbstractCollector
-
- jsl.utilities.statistic.AbstractStatistic
-
- All Implemented Interfaces:
java.lang.Comparable<AbstractStatistic>
,GetNameIfc
,IdentityIfc
,ArraySaverIfc
,CollectorIfc
,GetCSVStatisticIfc
,StatisticAccessorIfc
- Direct Known Subclasses:
AntitheticStatistic
,BatchStatistic
,CachedHistogram
,Histogram
,StandardizedTimeSeriesStatistic
,Statistic
public abstract class AbstractStatistic extends AbstractCollector implements StatisticAccessorIfc, GetCSVStatisticIfc, java.lang.Comparable<AbstractStatistic>
Serves as an abstract base class for statistical collection.
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_CONFIDENCE_LEVEL
the default confidence levelprotected double
myConfidenceLevel
Holds the confidence coefficient for the statisticprotected double
myNumMissing
Used to count the number of missing data points presented When a data point having the value of (Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY) are presented it is excluded from the summary statistics and the number of missing points is noted.-
Fields inherited from interface jsl.utilities.statistic.ArraySaverIfc
DEFAULT_DATA_ARRAY_SIZE
-
-
Constructor Summary
Constructors Constructor Description AbstractStatistic()
AbstractStatistic(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(AbstractStatistic stat)
Returns a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object.double
getConfidenceLevel()
Gets the confidence level.double
getNumberMissing()
When a data point having the value of (Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY) are presented it is excluded from the summary statistics and the number of missing points is noted.void
setConfidenceLevel(double level)
Sets the confidence level for the statistic-
Methods inherited from class jsl.utilities.statistic.AbstractCollector
clearSavedData, getId, getName, getSavedData, getSaveOption, save, save, setArraySizeIncrement, setName, setSaveOption
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsl.utilities.statistic.CollectorIfc
collect, collect, collect, collect, reset
-
Methods inherited from interface jsl.utilities.statistic.StatisticAccessorIfc
getAverage, getConfidenceInterval, getConfidenceInterval, getCount, getCSVHeader, getCSVStatistic, getCSVStatisticHeader, getCSVValues, getDeviationSumOfSquares, getHalfWidth, getHalfWidth, getKurtosis, getLag1Correlation, getLag1Covariance, getLastValue, getLeadingDigitRule, getMax, getMin, getName, getRelativeError, getRelativeWidth, getRelativeWidth, getSkewness, getStandardDeviation, getStandardError, getStatistics, getStatisticsAsMap, getSum, getVariance, getVonNeumannLag1TestStatistic, getVonNeumannLag1TestStatisticPValue, toString
-
-
-
-
Field Detail
-
DEFAULT_CONFIDENCE_LEVEL
public static final double DEFAULT_CONFIDENCE_LEVEL
the default confidence level- See Also:
- Constant Field Values
-
myConfidenceLevel
protected double myConfidenceLevel
Holds the confidence coefficient for the statistic
-
myNumMissing
protected double myNumMissing
Used to count the number of missing data points presented When a data point having the value of (Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY) are presented it is excluded from the summary statistics and the number of missing points is noted. Implementers of subclasses are responsible for properly collecting this value and resetting this value.
-
-
Method Detail
-
setConfidenceLevel
public void setConfidenceLevel(double level)
Sets the confidence level for the statistic- Parameters:
level
- must be in (0, 1)
-
getConfidenceLevel
public double getConfidenceLevel()
Description copied from interface:StatisticAccessorIfc
Gets the confidence level. The default is given by Statistic.DEFAULT_CONFIDENCE_LEVEL = 0.95, which is a 95% confidence level- Specified by:
getConfidenceLevel
in interfaceStatisticAccessorIfc
- Returns:
- A double representing the confidence level
-
getNumberMissing
public double getNumberMissing()
Description copied from interface:StatisticAccessorIfc
When a data point having the value of (Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY) are presented it is excluded from the summary statistics and the number of missing points is noted. This method reports the number of missing points that occurred during the collection- Specified by:
getNumberMissing
in interfaceStatisticAccessorIfc
- Returns:
- the number missing
-
compareTo
public int compareTo(AbstractStatistic stat)
Returns a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object. The natural ordering is based on getAverage() with equals.- Specified by:
compareTo
in interfacejava.lang.Comparable<AbstractStatistic>
- Parameters:
stat
- The statistic to compare this statistic to- Returns:
- Returns a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object.
-
-