[ 
https://issues.apache.org/jira/browse/STATISTICS-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17959725#comment-17959725
 ] 

Alex Herbert commented on STATISTICS-6:
---------------------------------------

{quote}Shouldn't this be named {{BinomialConfidenceInterval}} ?
{quote}
Yes.
{quote}But then the {{ConfidenceInterval}} interface becomes a (trivial) 
"interval", or actually just a "pair of numbers".
{quote}
True. We could return a pair as a {{{}double[]{}}}. Use of an interface is more 
self documenting. But without the confidence level it could be named 
{{{}Interval{}}}. I think this is fine to have in an {{interval}} package.

I do not think we require the bloat of having two methods to create the 
interval. The current Math API uses confidence level as a fraction. Online 
literature uses it as a percentage. Either way, if we keep this method the API 
would be:
{code:java}
public interface Interval {
    double getLowerBound();
    double getUpperBound();
}

public enum BinomialConfidenceLevel {
    AGRESTI_COULL,
    CLOPPER_PEARSON,
    NORMAL_APPROXIMATION,
    WILSON_SCORE;

    public Interval fromErrorRate(
        int numberOfTrials, int numberOfSuccesses, double alpha);

    public Interval fromConfidenceLevel(
        int numberOfTrials, int numberOfSuccesses, double confidenceLevel);
}
{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)

Reply via email to