Class BoundsOnRatiosInThetaSketchedSets


  • public final class BoundsOnRatiosInThetaSketchedSets
    extends Object
    This class is used to compute the bounds on the estimate of the ratio B / A, where:
    • A is a Theta Sketch of population PopA.
    • B is a Theta Sketch of population PopB that is a subset of A, obtained by an intersection of A with some other Theta Sketch C, which acts like a predicate or selection clause.
    • The estimate of the ratio PopB/PopA is BoundsOnRatiosInThetaSketchedSets.getEstimateOfBoverA(A, B).
    • The Upper Bound estimate on the ratio PopB/PopA is BoundsOnRatiosInThetaSketchedSets.getUpperBoundForBoverA(A, B).
    • The Lower Bound estimate on the ratio PopB/PopA is BoundsOnRatiosInThetaSketchedSets.getLowerBoundForBoverA(A, B).
    Note: The theta of A cannot be greater than the theta of B. If B is formed as an intersection of A and some other set C, then the theta of B is guaranteed to be less than or equal to the theta of B.
    Author:
    Kevin Lang, Lee Rhodes
    • Method Detail

      • getLowerBoundForBoverA

        public static double getLowerBoundForBoverA​(Sketch sketchA,
                                                    Sketch sketchB)
        Gets the approximate lower bound for B over A based on a 95% confidence interval
        Parameters:
        sketchA - the sketch A
        sketchB - the sketch B
        Returns:
        the approximate lower bound for B over A
      • getUpperBoundForBoverA

        public static double getUpperBoundForBoverA​(Sketch sketchA,
                                                    Sketch sketchB)
        Gets the approximate upper bound for B over A based on a 95% confidence interval
        Parameters:
        sketchA - the sketch A
        sketchB - the sketch B
        Returns:
        the approximate upper bound for B over A
      • getEstimateOfBoverA

        public static double getEstimateOfBoverA​(Sketch sketchA,
                                                 Sketch sketchB)
        Gets the estimate for B over A
        Parameters:
        sketchA - the sketch A
        sketchB - the sketch B
        Returns:
        the estimate for B over A