Class ConfidenceInterval
java.lang.Object
org.apache.commons.math3.stat.interval.ConfidenceInterval
Represents an interval estimate of a population parameter.
- Since:
- 3.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleThe asserted probability that the interval contains the population parameterprivate doubleLower endpoint of the intervalprivate doubleUpper endpoint of the interval -
Constructor Summary
ConstructorsConstructorDescriptionConfidenceInterval(double lowerBound, double upperBound, double confidenceLevel) Create a confidence interval with the given bounds and confidence level. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckParameters(double lower, double upper, double confidence) Verifies that (lower, upper) is a valid non-empty interval and confidence is strictly between 0 and 1.doubledoubledoubletoString()
-
Field Details
-
lowerBound
private double lowerBoundLower endpoint of the interval -
upperBound
private double upperBoundUpper endpoint of the interval -
confidenceLevel
private double confidenceLevelThe asserted probability that the interval contains the population parameter
-
-
Constructor Details
-
ConfidenceInterval
public ConfidenceInterval(double lowerBound, double upperBound, double confidenceLevel) Create a confidence interval with the given bounds and confidence level.Preconditions:
lowermust be strictly less thanupperconfidenceLevelmust be strictly between 0 and 1 (exclusive)
- Parameters:
lowerBound- lower endpoint of the intervalupperBound- upper endpoint of the intervalconfidenceLevel- coverage probability- Throws:
MathIllegalArgumentException- if the preconditions are not met
-
-
Method Details
-
getLowerBound
public double getLowerBound()- Returns:
- the lower endpoint of the interval
-
getUpperBound
public double getUpperBound()- Returns:
- the upper endpoint of the interval
-
getConfidenceLevel
public double getConfidenceLevel()- Returns:
- the asserted probability that the interval contains the population parameter
-
toString
-
checkParameters
private void checkParameters(double lower, double upper, double confidence) Verifies that (lower, upper) is a valid non-empty interval and confidence is strictly between 0 and 1.- Parameters:
lower- lower endpointupper- upper endpointconfidence- confidence level
-