Package org.apache.datasketches.common
Class BoundsOnRatiosInSampledSets
- java.lang.Object
-
- org.apache.datasketches.common.BoundsOnRatiosInSampledSets
-
public final class BoundsOnRatiosInSampledSets extends Object
This class is used to compute the bounds on the estimate of the ratio |B| / |A|, where:- |A| is the unknown size of a set A of unique identifiers.
- |B| is the unknown size of a subset B of A.
- a = |SA| is the observed size of a sample of A that was obtained by Bernoulli sampling with a known inclusion probability f.
- b = |SA ∩ B| is the observed size of a subset of SA.
- Author:
- Kevin Lang
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doublegetEstimateOfA(long a, double f)Return the estimate of A.static doublegetEstimateOfB(long b, double f)Return the estimate of B.static doublegetEstimateOfBoverA(long a, long b)Return the estimate of b over astatic doublegetLowerBoundForBoverA(long a, long b, double f)Return the approximate lower bound based on a 95% confidence intervalstatic doublegetUpperBoundForBoverA(long a, long b, double f)Return the approximate upper bound based on a 95% confidence interval
-
-
-
Method Detail
-
getLowerBoundForBoverA
public static double getLowerBoundForBoverA(long a, long b, double f)Return the approximate lower bound based on a 95% confidence interval- Parameters:
a- See class javadocb- See class javadocf- the inclusion probability used to produce the set with size a and should generally be less than 0.5. Above this value, the results not be reliable. When f = 1.0 this returns the estimate.- Returns:
- the approximate upper bound
-
getUpperBoundForBoverA
public static double getUpperBoundForBoverA(long a, long b, double f)Return the approximate upper bound based on a 95% confidence interval- Parameters:
a- See class javadocb- See class javadocf- the inclusion probability used to produce the set with size a.- Returns:
- the approximate lower bound
-
getEstimateOfBoverA
public static double getEstimateOfBoverA(long a, long b)Return the estimate of b over a- Parameters:
a- See class javadocb- See class javadoc- Returns:
- the estimate of b over a
-
getEstimateOfA
public static double getEstimateOfA(long a, double f)Return the estimate of A. See class javadoc.- Parameters:
a- See class javadocf- the inclusion probability used to produce the set with size a.- Returns:
- the approximate lower bound
-
getEstimateOfB
public static double getEstimateOfB(long b, double f)Return the estimate of B. See class javadoc.- Parameters:
b- See class javadocf- the inclusion probability used to produce the set with size b.- Returns:
- the approximate lower bound
-
-