Enum NormalConfidenceInterval

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      MEAN
      Create a confidence interval for the true mean of an unknown normally distributed population.
      VARIANCE
      Create a confidence interval for the true variance of an unknown normally distributed population.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) abstract Interval create​(double mean, double variance, long n, double alpha)
      Create a confidence interval from an independent sample from an unknown normally distributed population with the given error rate.
      Interval fromErrorRate​(double mean, double variance, long n, double alpha)
      Create a confidence interval from an independent sample from an unknown normally distributed population with the given error rate.
      static NormalConfidenceInterval valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static NormalConfidenceInterval[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • MEAN

        public static final NormalConfidenceInterval MEAN
        Create a confidence interval for the true mean of an unknown normally distributed population.
      • VARIANCE

        public static final NormalConfidenceInterval VARIANCE
        Create a confidence interval for the true variance of an unknown normally distributed population.
    • Constructor Detail

      • NormalConfidenceInterval

        private NormalConfidenceInterval()
    • Method Detail

      • values

        public static NormalConfidenceInterval[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (NormalConfidenceInterval c : NormalConfidenceInterval.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static NormalConfidenceInterval valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • fromErrorRate

        public Interval fromErrorRate​(double mean,
                                      double variance,
                                      long n,
                                      double alpha)
        Create a confidence interval from an independent sample from an unknown normally distributed population with the given error rate.

        The error rate alpha is related to the confidence level that the interval contains the true probability of success as alpha = 1 - confidence, where confidence is the confidence level in [0, 1]. For example a 95% confidence level is an alpha of 0.05.

        The unbiased variance is the sum of the squared deviations from the mean divided by n - 1.

        Parameters:
        mean - Sample mean.
        variance - Unbiased sample variance.
        n - Sample size.
        alpha - Desired error rate that the true probability of success falls outside the returned interval.
        Returns:
        Confidence interval containing the target with error rate alpha
        Throws:
        java.lang.IllegalArgumentException - if n <= 1, or if alpha is not in the open interval (0, 1).
      • create

        abstract Interval create​(double mean,
                                 double variance,
                                 long n,
                                 double alpha)
        Create a confidence interval from an independent sample from an unknown normally distributed population with the given error rate.
        Parameters:
        mean - Sample mean.
        variance - Unbiased sample variance.
        n - Sample size.
        alpha - Desired error rate.
        Returns:
        Confidence interval