public class BernoulliConfidence extends AbstractCloneableSerializable implements ConfidenceIntervalEvaluator<java.util.Collection<java.lang.Boolean>>
Modifier and Type | Field and Description |
---|---|
static BernoulliConfidence |
INSTANCE
This class has no members, so here's a static instance.
|
Constructor and Description |
---|
BernoulliConfidence()
Creates a new instance of BernoulliConfidence
|
Modifier and Type | Method and Description |
---|---|
ConfidenceInterval |
computeConfidenceInterval(java.util.Collection<java.lang.Boolean> data,
double confidence)
Computes the ConfidenceInterval for the Bernoulli parameter based on
the given data and the desired level of confidence.
|
ConfidenceInterval |
computeConfidenceInterval(double mean,
double variance,
int numSamples,
double confidence)
Computes the confidence interval given the mean and variance of
the samples, number of samples, and corresponding confidence interval
|
static ConfidenceInterval |
computeConfidenceInterval(double bernoulliParameter,
int numSamples,
double confidence)
Computes the ConfidenceInterval for the Bernoulli parameter based on
the given data and the desired level of confidence.
|
static int |
computeSampleSize(double accuracy,
double confidence)
Computes the number of samples needed to estimate the Bernoulli parameter
"p" (mean) within "accuracy" with probability at least "confidence".
|
clone
public static final BernoulliConfidence INSTANCE
public BernoulliConfidence()
public ConfidenceInterval computeConfidenceInterval(java.util.Collection<java.lang.Boolean> data, double confidence)
computeConfidenceInterval
in interface ConfidenceIntervalEvaluator<java.util.Collection<java.lang.Boolean>>
data
- Correct/Wrong dataconfidence
- Confidence level to place on the confidence interval, must be (0,1]@PublicationReference(author="Wikipedia", title="", type=WebPage, year=2009, url="http://en.wikipedia.org/wiki/Margin_of_error") public static ConfidenceInterval computeConfidenceInterval(double bernoulliParameter, int numSamples, double confidence)
bernoulliParameter
- Estimated Bernoulli parameter, classifier success rate, must be [0,1]numSamples
- Number of samples used in the determinationconfidence
- Confidence level to place on the confidence interval, must be (0,1]public ConfidenceInterval computeConfidenceInterval(double mean, double variance, int numSamples, double confidence)
ConfidenceIntervalEvaluator
computeConfidenceInterval
in interface ConfidenceIntervalEvaluator<java.util.Collection<java.lang.Boolean>>
mean
- Mean of the distribution.variance
- Variance of the distribution.numSamples
- Number of samples in the underlying dataconfidence
- Confidence value to assume for the ConfidenceInterval@PublicationReference(author="Wikipedia", title="", type=WebPage, year=2009, url="http://en.wikipedia.org/wiki/Margin_of_error") public static int computeSampleSize(double accuracy, double confidence)
accuracy
- Desired accuracy to estimate, on the interval (0,1]confidence
- Desired confidence, on the interval (0,1]