Package org.apache.spark.util.random
Class BinomialBounds
Object
org.apache.spark.util.random.BinomialBounds
Utility functions that help us determine bounds on adjusted sampling rate to guarantee exact
sample size with high confidence when sampling without replacement.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
getLowerBound
(double delta, long n, double fraction) Returns a thresholdp
such that if we conduct n Bernoulli trials with success rate =p
, it is very unlikely to have more thanfraction * n
successes.static double
getUpperBound
(double delta, long n, double fraction) Returns a thresholdp
such that if we conduct n Bernoulli trials with success rate =p
, it is very unlikely to have less thanfraction * n
successes.static double
-
Constructor Details
-
BinomialBounds
public BinomialBounds()
-
-
Method Details
-
minSamplingRate
public static double minSamplingRate() -
getLowerBound
public static double getLowerBound(double delta, long n, double fraction) Returns a thresholdp
such that if we conduct n Bernoulli trials with success rate =p
, it is very unlikely to have more thanfraction * n
successes.- Parameters:
delta
- (undocumented)n
- (undocumented)fraction
- (undocumented)- Returns:
- (undocumented)
-
getUpperBound
public static double getUpperBound(double delta, long n, double fraction) Returns a thresholdp
such that if we conduct n Bernoulli trials with success rate =p
, it is very unlikely to have less thanfraction * n
successes.- Parameters:
delta
- (undocumented)n
- (undocumented)fraction
- (undocumented)- Returns:
- (undocumented)
-