Interface ConcurrentQuantileEstimator

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void add​(double x)
      Add an unweighted sample to this estimator.
      void add​(double x, int w)
      Add a weighted sample.
      double cdf​(double x)
      Get an estimate for the cdf of the distribution at x.
      List<Double> cdf​(List<Double> coordinates)
      Get an estimate for the cdf of the distribution at every coordinate of input list.
      double quantile​(double q)
      Get an estimate of the quantile at q.
      List<Double> quantile​(List<Double> quantileList)
      Get an estimated quantile for every value in the input list.
      long size()
      Returns the number of samples added to the current Estimator.
      default boolean tryAdd​(double x)
      Attempts to add an unweighted sample to this estimator.
      boolean tryAdd​(double x, int w)
      Attempts to add a weighted sample to this estimator.
    • Method Detail

      • size

        long size()
        Returns the number of samples added to the current Estimator.
        Returns:
        the number of samples currently added
      • cdf

        double cdf​(double x)
        Get an estimate for the cdf of the distribution at x. This function could be expensive depending on implementation. Consider using cdf(List) when querying more than one cdf value.
        Parameters:
        x - the value to get cdf at
        Returns:
        the estimated cumulative distribution function value at x, always between 0 and 1
      • cdf

        List<Double> cdf​(List<Double> coordinates)
        Get an estimate for the cdf of the distribution at every coordinate of input list.
        Parameters:
        coordinates - the list of coordinates to compute the cdf at
        Returns:
        the estimated cumulative distribution function value for every element in coordinates, in order, results are always between 0 and 1
      • quantile

        double quantile​(double q)
        Get an estimate of the quantile at q. This function could be expensive depending on implementation. Consider using quantile(List) when querying more than one quantile value.
        Parameters:
        q - quantile to query, must be between 0 and 1
        Returns:
        the estimated quantile value at q
      • quantile

        List<Double> quantile​(List<Double> quantileList)
        Get an estimated quantile for every value in the input list.
        Parameters:
        quantileList - list of quantiles to query, must all be between 0 and 1
        Returns:
        the estimated quantile value for every element in quantileList, in order
      • tryAdd

        boolean tryAdd​(double x,
                       int w)
        Attempts to add a weighted sample to this estimator. Returns false if a lock is held by another thread.
        Parameters:
        x - data to add
        w - weight
        Returns:
        false if this object's lock is held by another thread, true otherwise
      • tryAdd

        default boolean tryAdd​(double x)
        Attempts to add an unweighted sample to this estimator. Returns false if a lock is held by another thread.
        Parameters:
        x - data to add
        Returns:
        false if this objects lock is held by another thread, true otherwise
      • add

        void add​(double x,
                 int w)
        Add a weighted sample. This function could block to ensure the data is added to the estimator, for non-blocking adds see tryAdd(double, int).
        Parameters:
        x - data to add
        w - weight
      • add

        default void add​(double x)
        Add an unweighted sample to this estimator. This function could block to ensure the data is added to the estimator, for non-blocking adds see tryAdd(double).
        Parameters:
        x - data to add