[
https://issues.apache.org/jira/browse/STATISTICS-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17959541#comment-17959541
]
Alex Herbert commented on STATISTICS-6:
---------------------------------------
After reviewing the Commons Math interval package I believe this is required in
a port to statistics:
{code:java}
public interface ConfidenceInterval {
double getLowerBound();
double getUpperBound();
double getConfidenceLevel();
}
public enum BinomialConfidenceLevel {
AGRESTI_COULL,
CLOPPER_PEARSON,
NORMAL_APPROXIMATION,
WILSON_SCORE;
public ConfidenceInterval create(
int numberOfTrials, int numberOfSuccesses, double confidenceLevel);
}
{code}
Allowing a 95% confidence level to be created using:
{code:java}
int n = 400;
int x = 20;
double confidence = 0.95;
ConfidenceInterval c = BinomialConfidenceLevel.CLOPPER_PEARSON.create(n, k,
confidence);
{code}
Possible changes:
- Remove the confidence level from the interface. This object does not contain
the estimated value, only the lower and upper bound. I believe the level is
also not required as it is an input to methods that create the interval so the
caller will know this already.
- Change from using confidence level to target error rate alpha: alpha = 1 -
confidence level. The online literature that I read on the topic use alpha in
the definition of the interval.
These changes would create:
{code:java}
public interface ConfidenceInterval {
double getLowerBound();
double getUpperBound();
}
public enum BinomialConfidenceLevel {
AGRESTI_COULL,
CLOPPER_PEARSON,
NORMAL_APPROXIMATION,
WILSON_SCORE;
public ConfidenceInterval create(
int numberOfTrials, int numberOfSuccesses, double alpha);
}
{code}
> Package "o.a.c.math4.stat.interval"
> -----------------------------------
>
> Key: STATISTICS-6
> URL: https://issues.apache.org/jira/browse/STATISTICS-6
> Project: Commons Statistics
> Issue Type: Sub-task
> Reporter: Gimo
> Priority: Minor
> Labels: design, documentation, port
>
> Porting "confidence interval" functionality from "Commons Math".
--
This message was sent by Atlassian Jira
(v8.20.10#820010)