Class AbstractTDigest

    • Field Detail

      • gen

        protected java.util.Random gen
      • recordAllData

        protected boolean recordAllData
    • Constructor Detail

      • AbstractTDigest

        public AbstractTDigest()
    • Method Detail

      • interpolate

        public static double interpolate​(double x,
                                         double x0,
                                         double x1)
      • encode

        public static void encode​(java.nio.ByteBuffer buf,
                                  int n)
      • decode

        public static int decode​(java.nio.ByteBuffer buf)
      • add

        abstract void add​(double x,
                          int w,
                          Centroid base)
      • merge

        protected static TDigest merge​(java.lang.Iterable<TDigest> subData,
                                       java.util.Random gen,
                                       TDigest r)
      • compress

        public abstract void compress​(GroupTree other)
      • quantile

        static double quantile​(double previousIndex,
                               double index,
                               double nextIndex,
                               double previousMean,
                               double nextMean)
      • recordAllData

        public TDigest recordAllData()
        Sets up so that all centroids will record all data assigned to them. For testing only, really.
        Specified by:
        recordAllData in class TDigest
        Returns:
        This TDigest so that configurations can be done in fluent style.
      • add

        public void add​(double x)
        Adds a sample to a histogram.
        Specified by:
        add in class TDigest
        Parameters:
        x - The value to add.
      • add

        public void add​(TDigest other)
        Description copied from class: TDigest
        Add all of the centroids of another TDigest to this one.
        Specified by:
        add in class TDigest
        Parameters:
        other - The other TDigest
      • createCentroid

        protected Centroid createCentroid​(double mean,
                                          int id)