Class IntermittentDemandStatistic

    • Field Detail

      • myId

        protected int myId
      • myName

        protected java.lang.String myName
    • Constructor Detail

      • IntermittentDemandStatistic

        public IntermittentDemandStatistic()
      • IntermittentDemandStatistic

        public IntermittentDemandStatistic​(java.lang.String name)
    • Method Detail

      • reset

        public void reset()
      • setSaveDataOption

        public void setSaveDataOption​(boolean flag)
      • setId

        protected void setId()
      • setName

        public final void setName​(java.lang.String str)
      • getId

        public int getId()
        Specified by:
        getId in interface IdentityIfc
        Returns:
        an int representing the id of the object
      • update

        public void update​(java.lang.Object o,
                           java.lang.Object arg)
        Description copied from interface: ObserverIfc
        This method is called when the observable needs observing
        Specified by:
        update in interface ObserverIfc
        Parameters:
        o -
        arg -
      • collect

        public void collect​(double[] data)
      • collect

        public void collect​(double data)
      • getNonZeroDemandsData

        public double[] getNonZeroDemandsData()
      • getDemandsData

        public double[] getDemandsData()
      • getIntervalBetweenNonZeroDemandsData

        public double[] getIntervalBetweenNonZeroDemandsData()
      • getIntervalBetweenZeroDemandsData

        public double[] getIntervalBetweenZeroDemandsData()
      • getNumTransactions

        public int getNumTransactions()
      • getIntervalBetweenNonZeroDemandStat

        public Statistic getIntervalBetweenNonZeroDemandStat()
      • getIntervalBetweenZeroDemandsStat

        public Statistic getIntervalBetweenZeroDemandsStat()
      • getNonZeroDemandStat

        public Statistic getNonZeroDemandStat()
      • getDemandStat

        public Statistic getDemandStat()
      • getProbSuccessAfterSuccess

        public double getProbSuccessAfterSuccess()
      • getProbSuccessAfterFailure

        public double getProbSuccessAfterFailure()
      • getProbSuccess

        public double getProbSuccess()
      • getProbFailure

        public double getProbFailure()
      • getAverage

        public double getAverage()
        Description copied from interface: StatisticAccessorIfc
        Gets the unweighted average of the observations.
        Specified by:
        getAverage in interface StatisticAccessorIfc
        Returns:
        A double representing the average or Double.NaN if no observations.
      • 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 interface StatisticAccessorIfc
        Returns:
        A double representing the confidence level
      • getCount

        public double getCount()
        Description copied from interface: StatisticAccessorIfc
        Gets the count of the number of the observations.
        Specified by:
        getCount in interface StatisticAccessorIfc
        Returns:
        A double representing the count
      • 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
        Specified by:
        getDeviationSumOfSquares in interface StatisticAccessorIfc
        Returns:
        A double representing the sum of squares of the deviations from the average
      • getHalfWidth

        public double getHalfWidth​(double alpha)
        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
        Specified by:
        getHalfWidth in interface StatisticAccessorIfc
        Parameters:
        alpha - the confidence level
        Returns:
        A double representing the half-width or Double.NaN if < 1 observation
      • getHalfWidth

        public double getHalfWidth()
        Description copied from interface: StatisticAccessorIfc
        Gets the confidence interval half-width. Simply the generate standard error times the confidence coefficient
        Specified by:
        getHalfWidth in interface StatisticAccessorIfc
        Returns:
        A double representing the half-width or Double.NaN if < 1 observation
      • 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
        Specified by:
        getLag1Correlation in interface StatisticAccessorIfc
        Returns:
        A double representing the generate correlation or Double.NaN if <=2 observations
      • 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
        Specified by:
        getLag1Covariance in interface StatisticAccessorIfc
        Returns:
        A double representing the generate covariance or Double.NaN if <=2 observations
      • getRelativeWidth

        public double getRelativeWidth()
        Description copied from interface: StatisticAccessorIfc
        Returns the relative width of the default confidence interval: 2.0 * getHalfWidth() / getAverage()
        Specified by:
        getRelativeWidth in interface StatisticAccessorIfc
        Returns:
        the relative width
      • getRelativeWidth

        public double getRelativeWidth​(double level)
        Description copied from interface: StatisticAccessorIfc
        Returns the relative width of the level of the confidence interval: 2.0 * getHalfWidth(level) / getAverage()
        Specified by:
        getRelativeWidth in interface StatisticAccessorIfc
        Parameters:
        level - the confidence level
        Returns:
        the relative width for the 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 interface StatisticAccessorIfc
        Returns:
        the number missing
      • getStandardDeviation

        public double getStandardDeviation()
        Description copied from interface: StatisticAccessorIfc
        Gets the sample standard deviation of the observations. Simply the square root of getVariance()
        Specified by:
        getStandardDeviation in interface StatisticAccessorIfc
        Returns:
        A double representing the generate standard deviation or Double.NaN if 1 or less observations.
      • 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
        Specified by:
        getStandardError in interface StatisticAccessorIfc
        Returns:
        A double representing the standard error or Double.NaN if < 1 observation
      • getLeadingDigitRule

        public final 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
        Specified by:
        getLeadingDigitRule in interface StatisticAccessorIfc
        Parameters:
        a - the std error multiplier
        Returns:
        the meaningful digit
      • getStatistics

        public double[] getStatistics()
        Description copied from interface: StatisticAccessorIfc
        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()
        Specified by:
        getStatistics in interface StatisticAccessorIfc
        Returns:
        an array of values
      • getSum

        public double getSum()
        Description copied from interface: StatisticAccessorIfc
        Gets the sum of the observations.
        Specified by:
        getSum in interface StatisticAccessorIfc
        Returns:
        A double representing the unweighted sum
      • getVariance

        public double getVariance()
        Description copied from interface: StatisticAccessorIfc
        Gets the sample variance of the observations.
        Specified by:
        getVariance in interface StatisticAccessorIfc
        Returns:
        A double representing the generate variance or Double.NaN if 1 or less 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.
        Specified by:
        getVonNeumannLag1TestStatistic in interface StatisticAccessorIfc
        Returns:
        A double representing the Von Neumann test statistic
      • getVonNeumannLag1TestStatisticPValue

        public final double getVonNeumannLag1TestStatisticPValue()
        Description copied from interface: StatisticAccessorIfc
        Returns the asymptotic p-value for the Von Nueumann Lag-1 Test Statistic:

        Normal.stdNormalComplementaryCDF(getVonNeumannLag1TestStatistic());

        Specified by:
        getVonNeumannLag1TestStatisticPValue in interface StatisticAccessorIfc
        Returns:
        the p-value