Top Description Fields Constructors Methods
org.apache.commons.math3.stat.interval

public Class ConfidenceInterval

extends Object
Class Inheritance
Imports
org.apache.commons.math3.exception.MathIllegalArgumentException, org.apache.commons.math3.exception.util.LocalizedFormats

Represents an interval estimate of a population parameter.
Since
3.3

Field Summary

Modifier and TypeField and Description
private double
confidenceLevel

The asserted probability that the interval contains the population parameter

private double
lowerBound

Lower endpoint of the interval

private double
upperBound

Upper endpoint of the interval

Constructor Summary

AccessConstructor and Description
public
ConfidenceInterval(double
lower endpoint of the interval
lowerBound
,
double
upper endpoint of the interval
upperBound
,
double
coverage probability
confidenceLevel
)

Create a confidence interval with the given bounds and confidence level.

Method Summary

Modifier and TypeMethod and Description
private void
checkParameters(double
lower endpoint
lower
,
double
upper endpoint
upper
,
double
confidence level
confidence
)

Verifies that (lower, upper) is a valid non-empty interval and confidence is strictly between 0 and 1.

public double

Returns:

the asserted probability that the interval contains the population parameter
getConfidenceLevel
()

public double

Returns:

the lower endpoint of the interval
getLowerBound
()

public double

Returns:

the upper endpoint of the interval
getUpperBound
()

public String

Returns:

String representation of the confidence interval
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

confidenceLevelback to summary
private double confidenceLevel

The asserted probability that the interval contains the population parameter

lowerBoundback to summary
private double lowerBound

Lower endpoint of the interval

upperBoundback to summary
private double upperBound

Upper endpoint of the interval

Constructor Detail

ConfidenceIntervalback to summary
public ConfidenceInterval(double lowerBound, double upperBound, double confidenceLevel)

Create a confidence interval with the given bounds and confidence level.

Preconditions:

  • lower must be strictly less than upper
  • confidenceLevel must be strictly between 0 and 1 (exclusive)

Parameters
lowerBound:double

lower endpoint of the interval

upperBound:double

upper endpoint of the interval

confidenceLevel:double

coverage probability

Exceptions
MathIllegalArgumentException:
if the preconditions are not met

Method Detail

checkParametersback to summary
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:double

lower endpoint

upper:double

upper endpoint

confidence:double

confidence level

getConfidenceLevelback to summary
public double getConfidenceLevel()
Returns:double

the asserted probability that the interval contains the population parameter

getLowerBoundback to summary
public double getLowerBound()
Returns:double

the lower endpoint of the interval

getUpperBoundback to summary
public double getUpperBound()
Returns:double

the upper endpoint of the interval

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

String representation of the confidence interval

Annotations
@Override