Package jsl.utilities.statistic
Interface StatisticAccessorIfc
-
- All Superinterfaces:
GetCSVStatisticIfc
- All Known Implementing Classes:
AbstractStatistic
,AntitheticStatistic
,BatchStatistic
,CachedHistogram
,Histogram
,IntermittentDemandStatistic
,StandardizedTimeSeriesStatistic
,Statistic
public interface StatisticAccessorIfc extends GetCSVStatisticIfc
The StatisticAccessIfc class presents a read-only view of a Statistic
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description double
getAverage()
Gets the unweighted average of the observations.default Interval
getConfidenceInterval()
A confidence interval for the mean based on the confidence leveldefault Interval
getConfidenceInterval(double level)
A confidence interval for the mean based on the confidence leveldouble
getConfidenceLevel()
Gets the confidence level.double
getCount()
Gets the count of the number of the observations.default java.util.List<java.lang.String>
getCSVHeader()
Gets the CSV header values as a list of stringsdefault java.lang.String
getCSVStatistic()
default java.lang.String
getCSVStatisticHeader()
The header string for the CVS representationdefault java.util.List<java.lang.String>
getCSVValues()
Returns the values of all the statistics as a list of strings The name is the first stringdouble
getDeviationSumOfSquares()
Gets the sum of squares of the deviations from the average This is the numerator in the classic sample variance formuladefault double
getHalfWidth()
Gets the confidence interval half-width.double
getHalfWidth(double level)
Gets the confidence interval half-width.double
getKurtosis()
Gets the kurtosis of the datadouble
getLag1Correlation()
Gets the lag-1 generate correlation of the unweighted observations.double
getLag1Covariance()
Gets the lag-1 generate covariance of the unweighted observations.double
getLastValue()
Gets the last observed data pointint
getLeadingDigitRule(double a)
Computes the right most meaningful digit according to (int)Math.floor(Math.log10(a*getStandardError())) See doi 10.1287.opre.1080.0529 by Song and Schmeiserdouble
getMax()
Gets the maximum of the observations.double
getMin()
Gets the minimum of the observations.java.lang.String
getName()
Gets the name of the Statisticdouble
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.default double
getRelativeError()
Returns the relative error: getStandardError() / getAverage()default double
getRelativeWidth()
Returns the relative width of the default confidence interval: 2.0 * getHalfWidth() / getAverage()default double
getRelativeWidth(double level)
Returns the relative width of the level of the confidence interval: 2.0 * getHalfWidth(level) / getAverage()double
getSkewness()
Gets the skewness of the datadefault double
getStandardDeviation()
Gets the sample standard deviation of the observations.double
getStandardError()
Gets the standard error of the observations.default double[]
getStatistics()
Fills up an array with the statistics defined by this interface statistics[0] = getCount() statistics[1] = getAverage() statistics[2] = getStandardDeviation() statistics[3] = getStandardError() statistics[4] = getHalfWidth() statistics[5] = getConfidenceLevel() statistics[6] = getMin() statistics[7] = getMax() statistics[8] = getSum() statistics[9] = getVariance() statistics[10] = getDeviationSumOfSquares() statistics[11] = getLastValue() statistics[12] = getKurtosis() statistics[13] = getSkewness() statistics[14] = getLag1Covariance() statistics[15] = getLag1Correlation() statistics[16] = getVonNeumannLag1TestStatistic() statistics[17] = getNumberMissing()default java.util.Map<java.lang.String,java.lang.Double>
getStatisticsAsMap()
Fills the map with the values of the statistics.double
getSum()
Gets the sum of the observations.double
getVariance()
Gets the sample variance of the observations.double
getVonNeumannLag1TestStatistic()
Gets the Von Neumann Lag 1 test statistic for checking the hypothesis that the data are uncorrelated Note: See Handbook of Simulation, Jerry Banks editor, McGraw-Hill, pg 253.double
getVonNeumannLag1TestStatisticPValue()
Returns the asymptotic p-value for the Von Nueumann Lag-1 Test Statistic:java.lang.String
toString()
Returns a String representation of the Statistic
-
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of the Statistic- Returns:
- The name as a String
-
getCount
double getCount()
Gets the count of the number of the observations.- Returns:
- A double representing the count
-
getSum
double getSum()
Gets the sum of the observations.- Returns:
- A double representing the unweighted sum
-
getAverage
double getAverage()
Gets the unweighted average of the observations.- Returns:
- A double representing the average or Double.NaN if no observations.
-
getDeviationSumOfSquares
double getDeviationSumOfSquares()
Gets the sum of squares of the deviations from the average This is the numerator in the classic sample variance formula- Returns:
- A double representing the sum of squares of the deviations from the average
-
getVariance
double getVariance()
Gets the sample variance of the observations.- Returns:
- A double representing the generate variance or Double.NaN if 1 or less observations.
-
getStandardDeviation
default double getStandardDeviation()
Gets the sample standard deviation of the observations. Simply the square root of getVariance()- Returns:
- A double representing the generate standard deviation or Double.NaN if 1 or less observations.
-
getMin
double getMin()
Gets the minimum of the observations.- Returns:
- A double representing the minimum
-
getMax
double getMax()
Gets the maximum of the observations.- Returns:
- A double representing the maximum
-
getLastValue
double getLastValue()
Gets the last observed data point- Returns:
- A double representing the last observations
-
getKurtosis
double getKurtosis()
Gets the kurtosis of the data- Returns:
- A double representing the kurtosis
-
getSkewness
double getSkewness()
Gets the skewness of the data- Returns:
- A double representing the skewness
-
getStandardError
double getStandardError()
Gets the standard error of the observations. Simply the generate standard deviation divided by the square root of the number of observations- Returns:
- A double representing the standard error or Double.NaN if < 1 observation
-
getHalfWidth
default double getHalfWidth()
Gets the confidence interval half-width. Simply the generate standard error times the confidence coefficient- Returns:
- A double representing the half-width or Double.NaN if < 1 observation
-
getHalfWidth
double getHalfWidth(double level)
Gets the confidence interval half-width. Simply the generate standard error times the confidence coefficient as determined by an appropriate sampling distribution- Parameters:
level
- the confidence level- Returns:
- A double representing the half-width or Double.NaN if < 1 observation
-
getConfidenceLevel
double getConfidenceLevel()
Gets the confidence level. The default is given by Statistic.DEFAULT_CONFIDENCE_LEVEL = 0.95, which is a 95% confidence level- Returns:
- A double representing the confidence level
-
getConfidenceInterval
default Interval getConfidenceInterval()
A confidence interval for the mean based on the confidence level- Returns:
- the interval
-
getConfidenceInterval
default Interval getConfidenceInterval(double level)
A confidence interval for the mean based on the confidence level- Parameters:
level
- the confidence level- Returns:
- the interval
-
getRelativeError
default double getRelativeError()
Returns the relative error: getStandardError() / getAverage()- Returns:
- the relative error
-
getRelativeWidth
default double getRelativeWidth()
Returns the relative width of the default confidence interval: 2.0 * getHalfWidth() / getAverage()- Returns:
- the relative width
-
getRelativeWidth
default double getRelativeWidth(double level)
Returns the relative width of the level of the confidence interval: 2.0 * getHalfWidth(level) / getAverage()- Parameters:
level
- the confidence level- Returns:
- the relative width for the level
-
getLag1Covariance
double getLag1Covariance()
Gets the lag-1 generate covariance of the unweighted observations. Note: See Box, Jenkins, Reinsel, Time Series Analysis, 3rd edition, Prentice-Hall, pg 31- Returns:
- A double representing the generate covariance or Double.NaN if <=2 observations
-
getLag1Correlation
double getLag1Correlation()
Gets the lag-1 generate correlation of the unweighted observations. Note: See Box, Jenkins, Reinsel, Time Series Analysis, 3rd edition, Prentice-Hall, pg 31- Returns:
- A double representing the generate correlation or Double.NaN if <=2 observations
-
getVonNeumannLag1TestStatistic
double getVonNeumannLag1TestStatistic()
Gets the Von Neumann Lag 1 test statistic for checking the hypothesis that the data are uncorrelated Note: See Handbook of Simulation, Jerry Banks editor, McGraw-Hill, pg 253.- Returns:
- A double representing the Von Neumann test statistic
-
getVonNeumannLag1TestStatisticPValue
double getVonNeumannLag1TestStatisticPValue()
Returns the asymptotic p-value for the Von Nueumann Lag-1 Test Statistic:Normal.stdNormalComplementaryCDF(getVonNeumannLag1TestStatistic());
- Returns:
- the p-value
-
getNumberMissing
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. This method reports the number of missing points that occurred during the collection- Returns:
- the number missing
-
getLeadingDigitRule
int getLeadingDigitRule(double a)
Computes the right most meaningful digit according to (int)Math.floor(Math.log10(a*getStandardError())) See doi 10.1287.opre.1080.0529 by Song and Schmeiser- Parameters:
a
- the std error multiplier- Returns:
- the meaningful digit
-
toString
java.lang.String toString()
Returns a String representation of the Statistic- Overrides:
toString
in classjava.lang.Object
- Returns:
- A String with basic summary statistics
-
getStatistics
default double[] getStatistics()
Fills up an array with the statistics defined by this interface statistics[0] = getCount() statistics[1] = getAverage() statistics[2] = getStandardDeviation() statistics[3] = getStandardError() statistics[4] = getHalfWidth() statistics[5] = getConfidenceLevel() statistics[6] = getMin() statistics[7] = getMax() statistics[8] = getSum() statistics[9] = getVariance() statistics[10] = getDeviationSumOfSquares() statistics[11] = getLastValue() statistics[12] = getKurtosis() statistics[13] = getSkewness() statistics[14] = getLag1Covariance() statistics[15] = getLag1Correlation() statistics[16] = getVonNeumannLag1TestStatistic() statistics[17] = getNumberMissing()- Returns:
- an array of values
-
getCSVStatisticHeader
default java.lang.String getCSVStatisticHeader()
Description copied from interface:GetCSVStatisticIfc
The header string for the CVS representation- Specified by:
getCSVStatisticHeader
in interfaceGetCSVStatisticIfc
- Returns:
- the CVS header string
-
getCSVStatistic
default java.lang.String getCSVStatistic()
- Specified by:
getCSVStatistic
in interfaceGetCSVStatisticIfc
- Returns:
- the CSV string for the values of the statistics
-
getCSVValues
default java.util.List<java.lang.String> getCSVValues()
Returns the values of all the statistics as a list of strings The name is the first string- Returns:
- the values of all the statistics as a list of strings
-
getCSVHeader
default java.util.List<java.lang.String> getCSVHeader()
Gets the CSV header values as a list of strings- Returns:
- the CSV header values as a list of strings
-
getStatisticsAsMap
default java.util.Map<java.lang.String,java.lang.Double> getStatisticsAsMap()
Fills the map with the values of the statistics. Key is statistic label and value is the value of the statistic. The keys are: "Count" "Average" "Standard Deviation" "Standard Error" "Half-width" "Confidence Level" "Minimum" "Maximum" "Sum" "Variance" "Deviation Sum of Squares" "Last value collected" "Kurtosis" "Skewness" "Lag 1 Covariance" "Lag 1 Correlation" "Von Neumann Lag 1 Test Statistic" "Number of missing observations"
-
-