[
https://issues.apache.org/jira/browse/STATISTICS-91?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alex Herbert resolved STATISTICS-91.
------------------------------------
Fix Version/s: 1.2
Resolution: Implemented
Added in commit:
490c8bb91e4b4bae39bb34977561812ccd2661c2
The implementation uses an enum to provide static methods to compute the
confidence interval for the target value defined by the enum instance. This is
either the MEAN or VARIANCE.
> Create confidence intervals from an independent sample from a normally
> distributed population
> ---------------------------------------------------------------------------------------------
>
> Key: STATISTICS-91
> URL: https://issues.apache.org/jira/browse/STATISTICS-91
> Project: Commons Statistics
> Issue Type: New Feature
> Components: interval
> Reporter: Alex Herbert
> Priority: Major
> Fix For: 1.2
>
>
> Confidence intervals can be generated for the mean and variance using a
> sample from a normally distributed population. See [Normal distribution
> confidence intervals
> (Wikipedia)|https://en.wikipedia.org/wiki/Normal_distribution#Confidence_intervals].
> Since there are two parameters that can be computed for the population this
> requires a different API to the enum used in the BinomialConfidenceInterval
> to compute intervals for the probability of success parameter.
> A suggested API is:
> {code:java}
> public final class NormalConfidenceInterval {
> public static NormalConfidenceInterval of(
> double mean, double variance, int n);
> public Interval getMeanInterval(double alpha);
> public Interval getVarianceInterval(double alpha);
> {code}
> Note that the returned class does not implement {{{}Interval{}}}. Thus the
> name is misleading. Alternatives:
> - NormalConfidenceIntervalFactory
> - NormalConfidenceIntervalGenerator
> An alternative using an enum as a static factory:
> {code:java}
> public enum NormalConfidenceInterval {
> MEAN,
> VARIANCE;
> public Interval fromErrorRate(
> double mean, double variance, int n, double alpha);
> }
> {code}
> The later is more inline with the current BiomialConfidenceInterval allowing:
> {code:java}
> double u = ...
> double v = ...
> int n = ...
> Interval i = NormalConfidenceInterval.MEAN.fromErrorRate(u, v, n, 0.05);
> {code}
> This works as there is one method to compute the interval. But if there are
> multiple then this will not be a flexible API. For example if using the
> approximate formulas based on the asymptotic distributions of mean and
> variance (i.e. as sample size n tends towards infinity).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)