Class ConfidenceInterval


  • public class ConfidenceInterval
    extends Object
    Represents a confidence interval. Whether one confidence interval contains another can be checked by using the contains(ConfidenceInterval) method.
    • 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 interval
        lowerBound - the confidence interval's lower bound
        upperBound - the confidence interval's upper bound
        level - 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 interval
        halfWidth - 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.