Package jsl.utilities.statistic
Class AntitheticStatistic
- java.lang.Object
-
- jsl.utilities.statistic.AbstractCollector
-
- jsl.utilities.statistic.AbstractStatistic
-
- jsl.utilities.statistic.AntitheticStatistic
-
- All Implemented Interfaces:
java.lang.Comparable<AbstractStatistic>
,GetNameIfc
,IdentityIfc
,ArraySaverIfc
,CollectorIfc
,GetCSVStatisticIfc
,StatisticAccessorIfc
public class AntitheticStatistic extends AbstractStatistic
In progress...
-
-
Field Summary
-
Fields inherited from class jsl.utilities.statistic.AbstractStatistic
DEFAULT_CONFIDENCE_LEVEL, myConfidenceLevel, myNumMissing
-
Fields inherited from interface jsl.utilities.statistic.ArraySaverIfc
DEFAULT_DATA_ARRAY_SIZE
-
-
Constructor Summary
Constructors Constructor Description AntitheticStatistic()
AntitheticStatistic(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
asString()
boolean
checkMean(double mean)
void
collect(double x)
Collect on the supplied valuelong
estimateSampleSize(double desiredHW)
double
getAverage()
Gets the unweighted average of the observations.double
getCount()
Gets the count of the number of the observations.double
getDeviationSumOfSquares()
Gets the sum of squares of the deviations from the average This is the numerator in the classic sample variance formuladouble
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.double
getObsWeightedSum()
double
getSkewness()
Gets the skewness of the datadouble
getStandardDeviation()
Gets the sample standard deviation of the observations.double
getStandardError()
Gets the standard error of the observations.double
getSum()
Gets the sum of the observations.java.lang.String
getSummaryStatistics()
java.lang.String
getSummaryStatisticsHeader()
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:void
reset()
Resets the collector as if no observations had been collected.-
Methods inherited from class jsl.utilities.statistic.AbstractStatistic
compareTo, getConfidenceLevel, getNumberMissing, setConfidenceLevel
-
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
-
Methods inherited from interface jsl.utilities.statistic.StatisticAccessorIfc
getConfidenceInterval, getConfidenceInterval, getCSVHeader, getCSVStatistic, getCSVStatisticHeader, getCSVValues, getName, getRelativeError, getRelativeWidth, getRelativeWidth, getStatistics, getStatisticsAsMap, toString
-
-
-
-
Method Detail
-
collect
public void collect(double x)
Description copied from interface:CollectorIfc
Collect on the supplied value- Parameters:
x
- a double representing the observation
-
reset
public void reset()
Description copied from interface:CollectorIfc
Resets the collector as if no observations had been collected.
-
getCount
public double getCount()
Description copied from interface:StatisticAccessorIfc
Gets the count of the number of the observations.- Returns:
- A double representing the count
-
getSum
public double getSum()
Description copied from interface:StatisticAccessorIfc
Gets the sum of the observations.- Returns:
- A double representing the unweighted sum
-
getAverage
public double getAverage()
Description copied from interface:StatisticAccessorIfc
Gets the unweighted average of the observations.- Returns:
- A double representing the average or Double.NaN if no observations.
-
getDeviationSumOfSquares
public double getDeviationSumOfSquares()
Description copied from interface:StatisticAccessorIfc
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
public double getVariance()
Description copied from interface:StatisticAccessorIfc
Gets the sample variance of the observations.- Returns:
- A double representing the generate variance or Double.NaN if 1 or less observations.
-
getStandardDeviation
public double getStandardDeviation()
Description copied from interface:StatisticAccessorIfc
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
public double getMin()
Description copied from interface:StatisticAccessorIfc
Gets the minimum of the observations.- Returns:
- A double representing the minimum
-
getMax
public double getMax()
Description copied from interface:StatisticAccessorIfc
Gets the maximum of the observations.- Returns:
- A double representing the maximum
-
getLastValue
public double getLastValue()
Description copied from interface:StatisticAccessorIfc
Gets the last observed data point- Returns:
- A double representing the last observations
-
getKurtosis
public double getKurtosis()
Description copied from interface:StatisticAccessorIfc
Gets the kurtosis of the data- Returns:
- A double representing the kurtosis
-
getSkewness
public double getSkewness()
Description copied from interface:StatisticAccessorIfc
Gets the skewness of the data- Returns:
- A double representing the skewness
-
getStandardError
public double getStandardError()
Description copied from interface:StatisticAccessorIfc
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
-
getLag1Covariance
public double getLag1Covariance()
Description copied from interface:StatisticAccessorIfc
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
public double getLag1Correlation()
Description copied from interface:StatisticAccessorIfc
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
public double getVonNeumannLag1TestStatistic()
Description copied from interface:StatisticAccessorIfc
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
public double getVonNeumannLag1TestStatisticPValue()
Description copied from interface:StatisticAccessorIfc
Returns the asymptotic p-value for the Von Nueumann Lag-1 Test Statistic:Normal.stdNormalComplementaryCDF(getVonNeumannLag1TestStatistic());
- Returns:
- the p-value
-
getLeadingDigitRule
public int getLeadingDigitRule(double a)
Description copied from interface:StatisticAccessorIfc
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
-
getHalfWidth
public double getHalfWidth()
Description copied from interface:StatisticAccessorIfc
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
public double getHalfWidth(double level)
Description copied from interface:StatisticAccessorIfc
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
-
checkMean
public boolean checkMean(double mean)
-
getObsWeightedSum
public double getObsWeightedSum()
-
asString
public java.lang.String asString()
-
getSummaryStatistics
public java.lang.String getSummaryStatistics()
-
getSummaryStatisticsHeader
public java.lang.String getSummaryStatisticsHeader()
-
estimateSampleSize
public long estimateSampleSize(double desiredHW)
-
-