Class ConfidenceInterval
- java.lang.Object
-
- de.uka.ipd.sdq.statistics.estimation.ConfidenceInterval
-
public class ConfidenceInterval extends Object
Represents a confidence interval. Whether one confidence interval contains another can be checked by using thecontains(ConfidenceInterval)
method.
-
-
Constructor Summary
Constructors Constructor Description ConfidenceInterval(double mean, double halfWidth, double level)
Constructs a confidence interval around the specified mean having width (2 * mean * halfWidth).ConfidenceInterval(double mean, double lowerBound, double upperBound, double level)
Constructs a confidence interval around the specified mean, having bounds lowerBound and upperBound.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(ConfidenceInterval ci)
Checks, whether the specified confidence interval lies within the bounds of this confidence interval.double
getLevel()
double
getLowerBound()
double
getMean()
double
getUpperBound()
void
setLowerBound(double lowerBound)
void
setMean(double mean)
void
setUpperBound(double upperBound)
-
-
-
Constructor Detail
-
ConfidenceInterval
public ConfidenceInterval(double mean, double lowerBound, double upperBound, double level)
Constructs a confidence interval around the specified mean, having bounds lowerBound and upperBound.- Parameters:
mean
- the center of the confidence intervallowerBound
- the confidence interval's lower boundupperBound
- the confidence interval's upper boundlevel
- the confidence level. Use values between 0 and 1. For instance use 0.95 to estimate the 95% confidence interval.noOfObservations
- the number of observations this confidence interval is constructed from
-
ConfidenceInterval
public ConfidenceInterval(double mean, double halfWidth, double level)
Constructs a confidence interval around the specified mean having width (2 * mean * halfWidth).- Parameters:
mean
- the center of the confidence intervalhalfWidth
- the relative half-width. Use values between 0 and 1. For instance use 0.1 in order to specify a 10% half-width.
-
-
Method Detail
-
getLowerBound
public double getLowerBound()
-
setLowerBound
public void setLowerBound(double lowerBound)
-
getUpperBound
public double getUpperBound()
-
setUpperBound
public void setUpperBound(double upperBound)
-
getMean
public double getMean()
-
setMean
public void setMean(double mean)
-
getLevel
public double getLevel()
-
contains
public boolean contains(ConfidenceInterval ci)
Checks, whether the specified confidence interval lies within the bounds of this confidence interval.- Parameters:
ci
- the confidence interval- Returns:
- true if this confidence interval contains the specified one; false else.
-
-