Class DiscreteProbabilityBuffer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int RECORD_LEN  
    • Method Summary

      Modifier and Type Method Description
      DiscreteProbabilityBuffer add​(int i, double probability)  
      double getCumulativeProbability()  
      java.util.Iterator<DiscreteProbabilityBuffer.Entry> iterator()  
      void normalize()  
      void normalize​(double phi)
      Normalize the dataset, but only if the cumulative probability is not close to the unit probability of 1.0D, within some phi threshold.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • RECORD_LEN

        public static int RECORD_LEN
    • Constructor Detail

      • DiscreteProbabilityBuffer

        public DiscreteProbabilityBuffer​(int entries)
    • Method Detail

      • normalize

        public void normalize​(double phi)
        Normalize the dataset, but only if the cumulative probability is not close to the unit probability of 1.0D, within some phi threshold. In either case, mark the dataset as normalized.
        Parameters:
        phi - A double value, preferably very small, like 0.000000001D
      • normalize

        public void normalize()
      • getCumulativeProbability

        public double getCumulativeProbability()