Return-Path: Delivered-To: apmail-commons-commits-archive@locus.apache.org Received: (qmail 75801 invoked from network); 3 Feb 2008 05:54:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Feb 2008 05:54:56 -0000 Received: (qmail 99683 invoked by uid 500); 3 Feb 2008 05:54:45 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 99601 invoked by uid 500); 3 Feb 2008 05:54:45 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 99592 invoked by uid 99); 3 Feb 2008 05:54:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Feb 2008 21:54:44 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Feb 2008 05:54:22 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3A0C81A983A; Sat, 2 Feb 2008 21:54:12 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r617953 [2/3] - in /commons/proper/math/trunk/src/java/org/apache/commons/math: distribution/ fraction/ linear/ stat/ stat/descriptive/ stat/descriptive/moment/ stat/descriptive/rank/ stat/descriptive/summary/ stat/inference/ stat/regressio... Date: Sun, 03 Feb 2008 05:54:06 -0000 To: commits@commons.apache.org From: psteitz@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080203055412.3A0C81A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/ThirdMoment.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/ThirdMoment.java?rev=617953&r1=617952&r2=617953&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/ThirdMoment.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/ThirdMoment.java Sat Feb 2 21:54:00 2008 @@ -22,24 +22,24 @@ * Computes a statistic related to the Third Central Moment. Specifically, * what is computed is the sum of cubed deviations from the sample mean. *

- * The following recursive updating formula is used: + * The following recursive updating formula is used:

*

* Let

    *
  • dev = (current obs - previous mean)
  • *
  • m2 = previous value of {@link SecondMoment}
  • *
  • n = number of observations (including current obs)
  • *
- * Then + * Then

*

- * new value = old value - 3 * (dev/n) * m2 + (n-1) * (n -2) * (dev^3/n^2) + * new value = old value - 3 * (dev/n) * m2 + (n-1) * (n -2) * (dev^3/n^2)

*

* Returns Double.NaN if no data values have been added and - * returns 0 if there is just one value in the data set. + * returns 0 if there is just one value in the data set.

*

* Note that this implementation is not synchronized. If * multiple threads access an instance of this class concurrently, and at least * one of the threads invokes the increment() or - * clear() method, it must be synchronized externally. + * clear() method, it must be synchronized externally.

* * @version $Revision$ $Date$ */ Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/Variance.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/Variance.java?rev=617953&r1=617952&r2=617953&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/Variance.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/Variance.java Sat Feb 2 21:54:00 2008 @@ -24,10 +24,10 @@ * Computes the variance of the available values. By default, the unbiased * "sample variance" definitional formula is used: *

- * variance = sum((x_i - mean)^2) / (n - 1) + * variance = sum((x_i - mean)^2) / (n - 1)

*

* where mean is the {@link Mean} and n is the number - * of sample observations. + * of sample observations.

*

* The definitional formula does not have good numerical properties, so * this implementation does not compute the statistic using the definitional @@ -46,13 +46,14 @@ * incrementAll and then executing getResult will * sometimes give a different, less accurate, result than executing * evaluate with the full array of values. The former approach - * should only be used when the full array of values is not available. + * should only be used when the full array of values is not available.

*

* The "population variance" ( sum((x_i - mean)^2) / n ) can also * be computed using this statistic. The isBiasCorrected * property determines whether the "population" or "sample" value is * returned by the evaluate and getResult methods. * To compute population variances, set this property to false. + *

*

* Note that this implementation is not synchronized. If * multiple threads access an instance of this class concurrently, and at least @@ -182,13 +183,13 @@ * Returns the variance of the entries in the input array, or * Double.NaN if the array is empty. *

- * See {@link Variance} for details on the computing algorithm. + * See {@link Variance} for details on the computing algorithm.

*

- * Returns 0 for a single-value (i.e. length = 1) sample. + * Returns 0 for a single-value (i.e. length = 1) sample.

*

- * Throws IllegalArgumentException if the array is null. + * Throws IllegalArgumentException if the array is null.

*

- * Does not change the internal state of the statistic. + * Does not change the internal state of the statistic.

* * @param values the input array * @return the variance of the values or Double.NaN if length = 0 @@ -206,13 +207,13 @@ * the input array, or Double.NaN if the designated subarray * is empty. *

- * See {@link Variance} for details on the computing algorithm. + * See {@link Variance} for details on the computing algorithm.

*

- * Returns 0 for a single-value (i.e. length = 1) sample. + * Returns 0 for a single-value (i.e. length = 1) sample.

*

- * Does not change the internal state of the statistic. + * Does not change the internal state of the statistic.

*

- * Throws IllegalArgumentException if the array is null. + * Throws IllegalArgumentException if the array is null.

* * @param values the input array * @param begin index of the first array element to include @@ -243,18 +244,18 @@ * the input array, using the precomputed mean value. Returns * Double.NaN if the designated subarray is empty. *

- * See {@link Variance} for details on the computing algorithm. + * See {@link Variance} for details on the computing algorithm.

*

* The formula used assumes that the supplied mean value is the arithmetic * mean of the sample data, not a known population parameter. This method * is supplied only to save computation when the mean has already been - * computed. + * computed.

*

- * Returns 0 for a single-value (i.e. length = 1) sample. + * Returns 0 for a single-value (i.e. length = 1) sample.

*

- * Throws IllegalArgumentException if the array is null. + * Throws IllegalArgumentException if the array is null.

*

- * Does not change the internal state of the statistic. + * Does not change the internal state of the statistic.

* * @param values the input array * @param mean the precomputed mean value @@ -297,20 +298,20 @@ * precomputed mean value. Returns Double.NaN if the array * is empty. *

- * See {@link Variance} for details on the computing algorithm. + * See {@link Variance} for details on the computing algorithm.

*

* If isBiasCorrected is true the formula used * assumes that the supplied mean value is the arithmetic mean of the * sample data, not a known population parameter. If the mean is a known * population parameter, or if the "population" version of the variance is * desired, set isBiasCorrected to false before - * invoking this method. + * invoking this method.

*

- * Returns 0 for a single-value (i.e. length = 1) sample. + * Returns 0 for a single-value (i.e. length = 1) sample.

*

- * Throws IllegalArgumentException if the array is null. + * Throws IllegalArgumentException if the array is null.

*

- * Does not change the internal state of the statistic. + * Does not change the internal state of the statistic.

* * @param values the input array * @param mean the precomputed mean value Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Max.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Max.java?rev=617953&r1=617952&r2=617953&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Max.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Max.java Sat Feb 2 21:54:00 2008 @@ -26,12 +26,12 @@ * (i.e. NaN values have no impact on the value of the statistic). *
  • If any of the values equals Double.POSITIVE_INFINITY, * the result is Double.POSITIVE_INFINITY.
  • - * + *

    *

    * Note that this implementation is not synchronized. If * multiple threads access an instance of this class concurrently, and at least * one of the threads invokes the increment() or - * clear() method, it must be synchronized externally. + * clear() method, it must be synchronized externally.

    * * @version $Revision$ $Date$ */ @@ -65,8 +65,8 @@ } /** - * @see org.apache.commons.math.stat.descriptive.StorelessUnivariateStatistic#clear() - */ + * @see org.apache.commons.math.stat.descriptive.StorelessUnivariateStatistic#clear() + */ public void clear() { value = Double.NaN; n = 0; @@ -92,14 +92,14 @@ * is empty. *

    * Throws IllegalArgumentException if the array is null or - * the array index parameters are not valid. + * the array index parameters are not valid.

    *

    *

      *
    • The result is NaN iff all values are NaN * (i.e. NaN values have no impact on the value of the statistic).
    • *
    • If any of the values equals Double.POSITIVE_INFINITY, * the result is Double.POSITIVE_INFINITY.
    • - *
    + *

    * * @param values the input array * @param begin index of the first array element to include Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Median.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Median.java?rev=617953&r1=617952&r2=617953&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Median.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Median.java Sat Feb 2 21:54:00 2008 @@ -26,7 +26,7 @@ * Note that this implementation is not synchronized. If * multiple threads access an instance of this class concurrently, and at least * one of the threads invokes the increment() or - * clear() method, it must be synchronized externally. + * clear() method, it must be synchronized externally.

    * * @version $Revision$ $Date$ */ Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Min.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Min.java?rev=617953&r1=617952&r2=617953&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Min.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Min.java Sat Feb 2 21:54:00 2008 @@ -28,12 +28,12 @@ * (i.e. NaN values have no impact on the value of the statistic). *
  • If any of the values equals Double.NEGATIVE_INFINITY, * the result is Double.NEGATIVE_INFINITY.
  • - * + *

    *

    * Note that this implementation is not synchronized. If * multiple threads access an instance of this class concurrently, and at least * one of the threads invokes the increment() or - * clear() method, it must be synchronized externally. + * clear() method, it must be synchronized externally.

    * * @version $Revision$ $Date$ */ @@ -94,14 +94,14 @@ * is empty. *

    * Throws IllegalArgumentException if the array is null or - * the array index parameters are not valid. + * the array index parameters are not valid.

    *

    *

      *
    • The result is NaN iff all values are NaN * (i.e. NaN values have no impact on the value of the statistic).
    • *
    • If any of the values equals Double.NEGATIVE_INFINITY, * the result is Double.NEGATIVE_INFINITY.
    • - *
    + *

    * * @param values the input array * @param begin index of the first array element to include Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Percentile.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Percentile.java?rev=617953&r1=617952&r2=617953&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Percentile.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/rank/Percentile.java Sat Feb 2 21:54:00 2008 @@ -41,7 +41,7 @@ * floor(pos) in the array and let upper be the * next element in the array. Return lower + d * (upper - lower) * - * + *

    *

    * To compute percentiles, the data must be (totally) ordered. Input arrays * are copied and then sorted using {@link java.util.Arrays#sort(double[])}. @@ -50,16 +50,16 @@ * Double.NaN larger than any other value (including * Double.POSITIVE_INFINITY). Therefore, for example, the median * (50th percentile) of - * {0, 1, 2, 3, 4, Double.NaN} evaluates to 2.5. + * {0, 1, 2, 3, 4, Double.NaN} evaluates to 2.5.

    *

    * Since percentile estimation usually involves interpolation between array * elements, arrays containing NaN or infinite values will often - * result in NaN or infinite values returned. + * result in NaN or infinite values returned.

    *

    * Note that this implementation is not synchronized. If * multiple threads access an instance of this class concurrently, and at least * one of the threads invokes the increment() or - * clear() method, it must be synchronized externally. + * clear() method, it must be synchronized externally.

    * * @version $Revision$ $Date$ */ @@ -95,7 +95,7 @@ * in the values array. *

    * Calls to this method do not modify the internal quantile - * state of this statistic. + * state of this statistic.

    *

    *

      *
    • Returns Double.NaN if values has length @@ -105,10 +105,10 @@ *
    • Throws IllegalArgumentException if values * is null or p is not a valid quantile value (p must be greater than 0 * and less than or equal to 100)
    • - *
    + *

    *

    * See {@link Percentile} for a description of the percentile estimation - * algorithm used. + * algorithm used.

    * * @param values input array of values * @param p the percentile value to compute @@ -133,10 +133,10 @@ *
  • Throws IllegalArgumentException if values * is null, or start or length * is invalid
  • - * + *

    *

    * See {@link Percentile} for a description of the percentile estimation - * algorithm used. + * algorithm used.

    * * @param values the input array * @param start index of the first array element to include @@ -156,7 +156,7 @@ * values. *

    * Calls to this method do not modify the internal quantile - * state of this statistic. + * state of this statistic.

    *

    *

      *
    • Returns Double.NaN if length = 0
    • @@ -166,10 +166,10 @@ * is null , begin or length is invalid, or * p is not a valid quantile value (p must be greater than 0 * and less than or equal to 100) - *
    + *

    *

    - * See {@link Percentile} for a description of the percentile estimation - * algorithm used. + * See {@link Percentile} for a description of the percentile estimation + * algorithm used.

    * * @param values array of input values * @param p the percentile to compute Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/Product.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/Product.java?rev=617953&r1=617952&r2=617953&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/Product.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/Product.java Sat Feb 2 21:54:00 2008 @@ -24,12 +24,12 @@ * Returns the product of the available values. *

    * If there are no values in the dataset, or any of the values are - * NaN, then NaN is returned. -*

    + * NaN, then NaN is returned.

    + *

    * Note that this implementation is not synchronized. If * multiple threads access an instance of this class concurrently, and at least * one of the threads invokes the increment() or - * clear() method, it must be synchronized externally. + * clear() method, it must be synchronized externally.

    * * @version $Revision$ $Date$ */ @@ -93,7 +93,7 @@ * the input array, or Double.NaN if the designated subarray * is empty. *

    - * Throws IllegalArgumentException if the array is null. + * Throws IllegalArgumentException if the array is null.

    * * @param values the input array * @param begin index of the first array element to include Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/Sum.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/Sum.java?rev=617953&r1=617952&r2=617953&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/Sum.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/Sum.java Sat Feb 2 21:54:00 2008 @@ -24,12 +24,12 @@ * Returns the sum of the available values. *

    * If there are no values in the dataset, or any of the values are - * NaN, then NaN is returned. + * NaN, then NaN is returned.

    *

    * Note that this implementation is not synchronized. If * multiple threads access an instance of this class concurrently, and at least * one of the threads invokes the increment() or - * clear() method, it must be synchronized externally. + * clear() method, it must be synchronized externally.

    * * @version $Revision$ $Date$ */ @@ -93,7 +93,7 @@ * the input array, or Double.NaN if the designated subarray * is empty. *

    - * Throws IllegalArgumentException if the array is null. + * Throws IllegalArgumentException if the array is null.

    * * @param values the input array * @param begin index of the first array element to include Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/SumOfLogs.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/SumOfLogs.java?rev=617953&r1=617952&r2=617953&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/SumOfLogs.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/SumOfLogs.java Sat Feb 2 21:54:00 2008 @@ -32,12 +32,12 @@ *
  • If both Double.POSITIVE_INFINITY and * Double.NEGATIVE_INFINITY are among the values, the result is * NaN.
  • - * + *

    *

    * Note that this implementation is not synchronized. If * multiple threads access an instance of this class concurrently, and at least * one of the threads invokes the increment() or - * clear() method, it must be synchronized externally. + * clear() method, it must be synchronized externally.

    * * @version $Revision$ $Date$ */ @@ -101,9 +101,9 @@ * the input array, or Double.NaN if the designated subarray * is empty. *

    - * Throws IllegalArgumentException if the array is null. + * Throws IllegalArgumentException if the array is null.

    *

    - * See {@link SumOfLogs}. + * See {@link SumOfLogs}.

    * * @param values the input array * @param begin index of the first array element to include Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/SumOfSquares.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/SumOfSquares.java?rev=617953&r1=617952&r2=617953&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/SumOfSquares.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/summary/SumOfSquares.java Sat Feb 2 21:54:00 2008 @@ -24,12 +24,12 @@ * Returns the sum of the squares of the available values. *

    * If there are no values in the dataset, or any of the values are - * NaN, then NaN is returned. + * NaN, then NaN is returned.

    *

    * Note that this implementation is not synchronized. If * multiple threads access an instance of this class concurrently, and at least * one of the threads invokes the increment() or - * clear() method, it must be synchronized externally. + * clear() method, it must be synchronized externally.

    * * @version $Revision$ $Date$ */ @@ -93,7 +93,7 @@ * the input array, or Double.NaN if the designated subarray * is empty. *

    - * Throws IllegalArgumentException if the array is null. + * Throws IllegalArgumentException if the array is null.

    * * @param values the input array * @param begin index of the first array element to include Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/ChiSquareTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/ChiSquareTest.java?rev=617953&r1=617952&r2=617953&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/ChiSquareTest.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/ChiSquareTest.java Sat Feb 2 21:54:00 2008 @@ -33,7 +33,7 @@ * frequency counts. *

    * This statistic can be used to perform a Chi-Square test evaluating the null hypothesis that - * the observed counts follow the expected distribution. + * the observed counts follow the expected distribution.

    *

    * Preconditions:

      *
    • Expected counts must all be positive. @@ -42,9 +42,9 @@ *
    • *
    • The observed and expected arrays must have the same length and * their common length must be at least 2. - *

    + *

    * If any of the preconditions are not met, an - * IllegalArgumentException is thrown. + * IllegalArgumentException is thrown.

    * * @param observed array of observed frequency counts * @param expected array of expected frequency counts @@ -64,7 +64,7 @@ *

    * The number returned is the smallest significance level at which one can reject * the null hypothesis that the observed counts conform to the frequency distribution - * described by the expected counts. + * described by the expected counts.

    *

    * Preconditions:

      *
    • Expected counts must all be positive. @@ -73,9 +73,9 @@ *
    • *
    • The observed and expected arrays must have the same length and * their common length must be at least 2. - *

    + *

    * If any of the preconditions are not met, an - * IllegalArgumentException is thrown. + * IllegalArgumentException is thrown.

    * * @param observed array of observed frequency counts * @param expected array of expected frequency counts @@ -95,8 +95,8 @@ *

    * Example:
    * To test the hypothesis that observed follows - * expected at the 99% level, use

    - * chiSquareTest(expected, observed, 0.01) + * expected at the 99% level, use

    + * chiSquareTest(expected, observed, 0.01)

    *

    * Preconditions:

      *
    • Expected counts must all be positive. @@ -106,9 +106,9 @@ *
    • The observed and expected arrays must have the same length and * their common length must be at least 2. *
    • 0 < alpha < 0.5 - *

    + *

    * If any of the preconditions are not met, an - * IllegalArgumentException is thrown. + * IllegalArgumentException is thrown.

    * * @param observed array of observed frequency counts * @param expected array of expected frequency counts @@ -127,19 +127,21 @@ * chi-square test of independence based on the input counts * array, viewed as a two-way table. *

    - * The rows of the 2-way table are count[0], ... , count[count.length - 1] + * The rows of the 2-way table are + * count[0], ... , count[count.length - 1]

    *

    * Preconditions:

      *
    • All counts must be >= 0. *
    • - *
    • The count array must be rectangular (i.e. all count[i] subarrays must have the same length). + *
    • The count array must be rectangular (i.e. all count[i] subarrays + * must have the same length). *
    • - *
    • The 2-way table represented by counts must have at least 2 columns and - * at least 2 rows. + *
    • The 2-way table represented by counts must have at + * least 2 columns and at least 2 rows. *
    • - *

    + *

    * If any of the preconditions are not met, an - * IllegalArgumentException is thrown. + * IllegalArgumentException is thrown.

    * * @param counts array representation of 2-way table * @return chiSquare statistic @@ -156,7 +158,8 @@ * chi-square test of independence based on the input counts * array, viewed as a two-way table. *

    - * The rows of the 2-way table are count[0], ... , count[count.length - 1] + * The rows of the 2-way table are + * count[0], ... , count[count.length - 1]

    *

    * Preconditions:

      *
    • All counts must be >= 0. @@ -166,9 +169,9 @@ *
    • The 2-way table represented by counts must have at least 2 columns and * at least 2 rows. *
    • - *

    + *

    * If any of the preconditions are not met, an - * IllegalArgumentException is thrown. + * IllegalArgumentException is thrown.

    * * @param counts array representation of 2-way table * @return p-value @@ -185,12 +188,14 @@ * with significance level alpha. Returns true iff the null hypothesis can be rejected * with 100 * (1 - alpha) percent confidence. *

    - * The rows of the 2-way table are count[0], ... , count[count.length - 1] + * The rows of the 2-way table are + * count[0], ... , count[count.length - 1]

    *

    * Example:
    - * To test the null hypothesis that the counts in count[0], ... , count[count.length - 1] - * all correspond to the same underlying probability distribution at the 99% level, use

    - * chiSquareTest(counts, 0.01) + * To test the null hypothesis that the counts in + * count[0], ... , count[count.length - 1] + * all correspond to the same underlying probability distribution at the 99% level, use

    + * chiSquareTest(counts, 0.01)

    *

    * Preconditions:

      *
    • All counts must be >= 0. @@ -200,9 +205,9 @@ *
    • The 2-way table represented by counts must have at least 2 columns and * at least 2 rows. *
    • - *

    + *

    * If any of the preconditions are not met, an - * IllegalArgumentException is thrown. + * IllegalArgumentException is thrown.

    * * @param counts array representation of 2-way table * @param alpha significance level of the test Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/TTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/TTest.java?rev=617953&r1=617952&r2=617953&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/TTest.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/TTest.java Sat Feb 2 21:54:00 2008 @@ -29,17 +29,17 @@ *
  • Homoscedastic (equal variance assumption) or heteroscedastic * (for two sample tests)
  • *
  • Fixed significance level (boolean-valued) or returning p-values. - *
  • + *

    *

    * Test statistics are available for all tests. Methods including "Test" in * in their names perform tests, all other methods return t-statistics. Among * the "Test" methods, double-valued methods return p-values; * boolean-valued methods perform fixed significance level tests. * Significance levels are always specified as numbers between 0 and 0.5 - * (e.g. tests at the 95% level use alpha=0.05). + * (e.g. tests at the 95% level use alpha=0.05).

    *

    * Input to tests can be either double[] arrays or - * {@link StatisticalSummary} instances. + * {@link StatisticalSummary} instances.

    * * * @version $Revision$ $Date$ @@ -56,7 +56,7 @@ * Preconditions:
      *
    • The input arrays must have the same length and their common length * must be at least 2. - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -76,23 +76,23 @@ * at which one can reject the null hypothesis that the mean of the paired * differences is 0 in favor of the two-sided alternative that the mean paired * difference is not equal to 0. For a one-sided test, divide the returned - * value by 2. + * value by 2.

    *

    * This test is equivalent to a one-sample t-test computed using * {@link #tTest(double, double[])} with mu = 0 and the sample * array consisting of the signed differences between corresponding elements of - * sample1 and sample2. + * sample1 and sample2.

    *

    * Usage Note:
    * The validity of the p-value depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The input array lengths must be the same and their common length must * be at least 2. - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -111,20 +111,20 @@ *

    * Returns true iff the null hypothesis can be rejected with * confidence 1 - alpha. To perform a 1-sided test, use - * alpha * 2 + * alpha * 2

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The input array lengths must be the same and their common length * must be at least 2. *
    • *
    • 0 < alpha < 0.5 - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -144,10 +144,10 @@ * t statistic given observed values and a comparison constant. *

    * This statistic can be used to perform a one sample t-test for the mean. - *

    + *

    * Preconditions:

      *
    • The observed array length must be at least 2. - *
    + *

    * * @param mu comparison constant * @param observed array of values @@ -162,10 +162,10 @@ * sampleStats to mu. *

    * This statistic can be used to perform a one sample t-test for the mean. - *

    + *

    * Preconditions:

      *
    • observed.getN() > = 2. - *
    + *

    * * @param mu comparison constant * @param sampleStats DescriptiveStatistics holding sample summary statitstics @@ -180,27 +180,27 @@ * equal variances hypothesis, use {@link #t(double[], double[])}. *

    * This statistic can be used to perform a (homoscedastic) two-sample - * t-test to compare sample means. + * t-test to compare sample means.

    *

    - * The t-statisitc is + * The t-statisitc is

    *

    *    t = (m1 - m2) / (sqrt(1/n1 +1/n2) sqrt(var)) - *

    + *

    * where n1 is the size of first sample; * n2 is the size of second sample; * m1 is the mean of first sample; * m2 is the mean of second sample * * and var is the pooled variance estimate: - *

    + *

    * var = sqrt(((n1 - 1)var1 + (n2 - 1)var2) / ((n1-1) + (n2-1))) - *

    + *

    * with var1 the variance of the first sample and * var2 the variance of the second sample. - *

    + *

    * Preconditions:

      *
    • The observed array lengths must both be at least 2. - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -215,22 +215,22 @@ * variances, use {@link #homoscedasticT(double[], double[])}. *

    * This statistic can be used to perform a two-sample t-test to compare - * sample means. + * sample means.

    *

    - * The t-statisitc is + * The t-statisitc is

    *

    *    t = (m1 - m2) / sqrt(var1/n1 + var2/n2) - *

    + *

    * where n1 is the size of the first sample * n2 is the size of the second sample; * m1 is the mean of the first sample; * m2 is the mean of the second sample; * var1 is the variance of the first sample; * var2 is the variance of the second sample; - *

    + *

    * Preconditions:

      *
    • The observed array lengths must both be at least 2. - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -247,23 +247,23 @@ * compute a t-statistic under the equal variances assumption. *

    * This statistic can be used to perform a two-sample t-test to compare - * sample means. + * sample means.

    *

    - * The returned t-statisitc is + * The returned t-statisitc is

    *

    *    t = (m1 - m2) / sqrt(var1/n1 + var2/n2) - *

    + *

    * where n1 is the size of the first sample; * n2 is the size of the second sample; * m1 is the mean of the first sample; * m2 is the mean of the second sample * var1 is the variance of the first sample; * var2 is the variance of the second sample - *

    + *

    * Preconditions:

      *
    • The datasets described by the two Univariates must each contain * at least 2 observations. - *
    + *

    * * @param sampleStats1 StatisticalSummary describing data from the first sample * @param sampleStats2 StatisticalSummary describing data from the second sample @@ -282,27 +282,27 @@ * {@link #t(StatisticalSummary, StatisticalSummary)}. *

    * This statistic can be used to perform a (homoscedastic) two-sample - * t-test to compare sample means. + * t-test to compare sample means.

    *

    - * The t-statisitc returned is + * The t-statisitc returned is

    *

    *    t = (m1 - m2) / (sqrt(1/n1 +1/n2) sqrt(var)) - *

    + *

    * where n1 is the size of first sample; * n2 is the size of second sample; * m1 is the mean of first sample; * m2 is the mean of second sample * and var is the pooled variance estimate: - *

    + *

    * var = sqrt(((n1 - 1)var1 + (n2 - 1)var2) / ((n1-1) + (n2-1))) - *

    + *

    * with var1 the variance of the first sample and * var2 the variance of the second sample. - *

    + *

    * Preconditions:

      *
    • The datasets described by the two Univariates must each contain * at least 2 observations. - *
    + *

    * * @param sampleStats1 StatisticalSummary describing data from the first sample * @param sampleStats2 StatisticalSummary describing data from the second sample @@ -322,16 +322,16 @@ * at which one can reject the null hypothesis that the mean equals * mu in favor of the two-sided alternative that the mean * is different from mu. For a one-sided test, divide the - * returned value by 2. + * returned value by 2.

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the parametric * t-test procedure, as discussed * here - *

    + *

    * Preconditions:

      *
    • The observed array length must be at least 2. - *
    + *

    * * @param mu constant value to compare sample mean against * @param sample array of sample data values @@ -348,7 +348,7 @@ *

    * Returns true iff the null hypothesis can be * rejected with confidence 1 - alpha. To - * perform a 1-sided test, use alpha * 2 + * perform a 1-sided test, use alpha * 2

    *

    * Examples:

      *
    1. To test the (2-sided) hypothesis sample mean = mu at @@ -358,16 +358,16 @@ * at the 99% level, first verify that the measured sample mean is less * than mu and then use *
      tTest(mu, sample, 0.02) - *
    + *

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the one-sample * parametric t-test procedure, as discussed * here - *

    + *

    * Preconditions:

      *
    • The observed array length must be at least 2. - *
    + *

    * * @param mu constant value to compare sample mean against * @param sample array of sample data values @@ -388,17 +388,17 @@ * at which one can reject the null hypothesis that the mean equals * mu in favor of the two-sided alternative that the mean * is different from mu. For a one-sided test, divide the - * returned value by 2. + * returned value by 2.

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The sample must contain at least 2 observations. - *
    + *

    * * @param mu constant value to compare sample mean against * @param sampleStats StatisticalSummary describing sample data @@ -416,7 +416,7 @@ *

    * Returns true iff the null hypothesis can be rejected with * confidence 1 - alpha. To perform a 1-sided test, use - * alpha * 2. + * alpha * 2.

    *

    * Examples:

      *
    1. To test the (2-sided) hypothesis sample mean = mu at @@ -426,16 +426,16 @@ * at the 99% level, first verify that the measured sample mean is less * than mu and then use *
      tTest(mu, sampleStats, 0.02) - *
    + *

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the one-sample * parametric t-test procedure, as discussed * here - *

    + *

    * Preconditions:

      *
    • The sample must include at least 2 observations. - *
    + *

    * * @param mu constant value to compare sample mean against * @param sampleStats StatisticalSummary describing sample data values @@ -457,7 +457,7 @@ * The number returned is the smallest significance level * at which one can reject the null hypothesis that the two means are * equal in favor of the two-sided alternative that they are different. - * For a one-sided test, divide the returned value by 2. + * For a one-sided test, divide the returned value by 2.

    *

    * The test does not assume that the underlying popuation variances are * equal and it uses approximated degrees of freedom computed from the @@ -467,17 +467,17 @@ * as described * * here. To perform the test under the assumption of equal subpopulation - * variances, use {@link #homoscedasticTTest(double[], double[])}. + * variances, use {@link #homoscedasticTTest(double[], double[])}.

    *

    * Usage Note:
    * The validity of the p-value depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The observed array lengths must both be at least 2. - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -493,26 +493,26 @@ * comparing the means of the input arrays, under the assumption that * the two samples are drawn from subpopulations with equal variances. * To perform the test without the equal variances assumption, use - * {@link #tTest(double[], double[])}. + * {@link #tTest(double[], double[])}.

    *

    * The number returned is the smallest significance level * at which one can reject the null hypothesis that the two means are * equal in favor of the two-sided alternative that they are different. - * For a one-sided test, divide the returned value by 2. + * For a one-sided test, divide the returned value by 2.

    *

    * A pooled variance estimate is used to compute the t-statistic. See * {@link #homoscedasticT(double[], double[])}. The sum of the sample sizes - * minus 2 is used as the degrees of freedom. + * minus 2 is used as the degrees of freedom.

    *

    * Usage Note:
    * The validity of the p-value depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The observed array lengths must both be at least 2. - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -536,13 +536,12 @@ *

    * Returns true iff the null hypothesis that the means are * equal can be rejected with confidence 1 - alpha. To - * perform a 1-sided test, use alpha * 2 + * perform a 1-sided test, use alpha * 2

    *

    * See {@link #t(double[], double[])} for the formula used to compute the * t-statistic. Degrees of freedom are approximated using the * - * Welch-Satterthwaite approximation. - + * Welch-Satterthwaite approximation.

    *

    * Examples:

      *
    1. To test the (2-sided) hypothesis mean 1 = mean 2 at @@ -553,19 +552,19 @@ * at the 99% level, first verify that the measured mean of sample 1 * is less than the mean of sample 2 and then use *
      tTest(sample1, sample2, 0.02) - *
    + *

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The observed array lengths must both be at least 2. *
    • *
    • 0 < alpha < 0.5 - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -594,11 +593,11 @@ * equal can be rejected with confidence 1 - alpha. To * perform a 1-sided test, use alpha * 2. To perform the test * without the assumption of equal subpopulation variances, use - * {@link #tTest(double[], double[], double)}. + * {@link #tTest(double[], double[], double)}.

    *

    * A pooled variance estimate is used to compute the t-statistic. See * {@link #t(double[], double[])} for the formula. The sum of the sample - * sizes minus 2 is used as the degrees of freedom. + * sizes minus 2 is used as the degrees of freedom.

    *

    * Examples:

      *
    1. To test the (2-sided) hypothesis mean 1 = mean 2 at @@ -609,19 +608,19 @@ * sample 1 is less than the mean of sample 2 * and then use *
      tTest(sample1, sample2, 0.02) - *
    + *

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The observed array lengths must both be at least 2. *
    • *
    • 0 < alpha < 0.5 - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -645,24 +644,24 @@ * The number returned is the smallest significance level * at which one can reject the null hypothesis that the two means are * equal in favor of the two-sided alternative that they are different. - * For a one-sided test, divide the returned value by 2. + * For a one-sided test, divide the returned value by 2.

    *

    * The test does not assume that the underlying popuation variances are * equal and it uses approximated degrees of freedom computed from the * sample data to compute the p-value. To perform the test assuming * equal variances, use - * {@link #homoscedasticTTest(StatisticalSummary, StatisticalSummary)}. + * {@link #homoscedasticTTest(StatisticalSummary, StatisticalSummary)}.

    *

    * Usage Note:
    * The validity of the p-value depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The datasets described by the two Univariates must each contain * at least 2 observations. - *
    + *

    * * @param sampleStats1 StatisticalSummary describing data from the first sample * @param sampleStats2 StatisticalSummary describing data from the second sample @@ -685,21 +684,21 @@ * The number returned is the smallest significance level * at which one can reject the null hypothesis that the two means are * equal in favor of the two-sided alternative that they are different. - * For a one-sided test, divide the returned value by 2. + * For a one-sided test, divide the returned value by 2.

    *

    * See {@link #homoscedasticT(double[], double[])} for the formula used to * compute the t-statistic. The sum of the sample sizes minus 2 is used as - * the degrees of freedom. + * the degrees of freedom.

    *

    * Usage Note:
    * The validity of the p-value depends on the assumptions of the parametric * t-test procedure, as discussed * here - *

    + *

    * Preconditions:

      *
    • The datasets described by the two Univariates must each contain * at least 2 observations. - *
    + *

    * * @param sampleStats1 StatisticalSummary describing data from the first sample * @param sampleStats2 StatisticalSummary describing data from the second sample @@ -724,12 +723,12 @@ *

    * Returns true iff the null hypothesis that the means are * equal can be rejected with confidence 1 - alpha. To - * perform a 1-sided test, use alpha * 2 + * perform a 1-sided test, use alpha * 2

    *

    * See {@link #t(double[], double[])} for the formula used to compute the * t-statistic. Degrees of freedom are approximated using the * - * Welch-Satterthwaite approximation. + * Welch-Satterthwaite approximation.

    *

    * Examples:

      *
    1. To test the (2-sided) hypothesis mean 1 = mean 2 at @@ -741,20 +740,20 @@ * sample 1 is less than the mean of sample 2 * and then use *
      tTest(sampleStats1, sampleStats2, 0.02) - *
    + *

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The datasets described by the two Univariates must each contain * at least 2 observations. *
    • *
    • 0 < alpha < 0.5 - *
    + *

    * * @param sampleStats1 StatisticalSummary describing sample data values * @param sampleStats2 StatisticalSummary describing sample data values Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/TTestImpl.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/TTestImpl.java?rev=617953&r1=617952&r2=617953&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/TTestImpl.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/TTestImpl.java Sat Feb 2 21:54:00 2008 @@ -27,7 +27,7 @@ * Implements t-test statistics defined in the {@link TTest} interface. *

    * Uses commons-math {@link org.apache.commons.math.distribution.TDistribution} - * implementation to estimate exact p-values. + * implementation to estimate exact p-values.

    * * @version $Revision$ $Date$ */ @@ -65,7 +65,7 @@ * Preconditions:
      *
    • The input arrays must have the same length and their common length * must be at least 2. - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -95,23 +95,23 @@ * at which one can reject the null hypothesis that the mean of the paired * differences is 0 in favor of the two-sided alternative that the mean paired * difference is not equal to 0. For a one-sided test, divide the returned - * value by 2. + * value by 2.

    *

    * This test is equivalent to a one-sample t-test computed using * {@link #tTest(double, double[])} with mu = 0 and the sample * array consisting of the signed differences between corresponding elements of - * sample1 and sample2. + * sample1 and sample2.

    *

    * Usage Note:
    * The validity of the p-value depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The input array lengths must be the same and their common length must * be at least 2. - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -136,20 +136,20 @@ *

    * Returns true iff the null hypothesis can be rejected with * confidence 1 - alpha. To perform a 1-sided test, use - * alpha * 2 + * alpha * 2

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The input array lengths must be the same and their common length * must be at least 2. *
    • *
    • 0 < alpha < 0.5 - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -172,10 +172,10 @@ * t statistic given observed values and a comparison constant. *

    * This statistic can be used to perform a one sample t-test for the mean. - *

    + *

    * Preconditions:

      *
    • The observed array length must be at least 2. - *
    + *

    * * @param mu comparison constant * @param observed array of values @@ -197,10 +197,10 @@ * sampleStats to mu. *

    * This statistic can be used to perform a one sample t-test for the mean. - *

    + *

    * Preconditions:

      *
    • observed.getN() > = 2. - *
    + *

    * * @param mu comparison constant * @param sampleStats DescriptiveStatistics holding sample summary statitstics @@ -222,27 +222,27 @@ * equal variances hypothesis, use {@link #t(double[], double[])}. *

    * This statistic can be used to perform a (homoscedastic) two-sample - * t-test to compare sample means. + * t-test to compare sample means.

    *

    - * The t-statisitc is + * The t-statisitc is

    *

    *    t = (m1 - m2) / (sqrt(1/n1 +1/n2) sqrt(var)) - *

    + *

    * where n1 is the size of first sample; * n2 is the size of second sample; * m1 is the mean of first sample; * m2 is the mean of second sample * * and var is the pooled variance estimate: - *

    + *

    * var = sqrt(((n1 - 1)var1 + (n2 - 1)var2) / ((n1-1) + (n2-1))) - *

    + *

    * with var1 the variance of the first sample and * var2 the variance of the second sample. - *

    + *

    * Preconditions:

      *
    • The observed array lengths must both be at least 2. - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -266,22 +266,22 @@ * variances, use {@link #homoscedasticT(double[], double[])}. *

    * This statistic can be used to perform a two-sample t-test to compare - * sample means. + * sample means.

    *

    - * The t-statisitc is + * The t-statisitc is

    *

    *    t = (m1 - m2) / sqrt(var1/n1 + var2/n2) - *

    + *

    * where n1 is the size of the first sample * n2 is the size of the second sample; * m1 is the mean of the first sample; * m2 is the mean of the second sample; * var1 is the variance of the first sample; * var2 is the variance of the second sample; - *

    + *

    * Preconditions:

      *
    • The observed array lengths must both be at least 2. - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -307,23 +307,23 @@ * compute a t-statistic under the equal variances assumption. *

    * This statistic can be used to perform a two-sample t-test to compare - * sample means. + * sample means.

    *

    - * The returned t-statisitc is + * The returned t-statisitc is

    *

    *    t = (m1 - m2) / sqrt(var1/n1 + var2/n2) - *

    + *

    * where n1 is the size of the first sample; * n2 is the size of the second sample; * m1 is the mean of the first sample; * m2 is the mean of the second sample * var1 is the variance of the first sample; * var2 is the variance of the second sample - *

    + *

    * Preconditions:

      *
    • The datasets described by the two Univariates must each contain * at least 2 observations. - *
    + *

    * * @param sampleStats1 StatisticalSummary describing data from the first sample * @param sampleStats2 StatisticalSummary describing data from the second sample @@ -351,27 +351,27 @@ * {@link #t(StatisticalSummary, StatisticalSummary)}. *

    * This statistic can be used to perform a (homoscedastic) two-sample - * t-test to compare sample means. + * t-test to compare sample means.

    *

    - * The t-statisitc returned is + * The t-statisitc returned is

    *

    *    t = (m1 - m2) / (sqrt(1/n1 +1/n2) sqrt(var)) - *

    + *

    * where n1 is the size of first sample; * n2 is the size of second sample; * m1 is the mean of first sample; * m2 is the mean of second sample * and var is the pooled variance estimate: - *

    + *

    * var = sqrt(((n1 - 1)var1 + (n2 - 1)var2) / ((n1-1) + (n2-1))) *

    * with var1 the variance of the first sample and * var2 the variance of the second sample. - *

    + *

    * Preconditions:

      *
    • The datasets described by the two Univariates must each contain * at least 2 observations. - *
    + *

    * * @param sampleStats1 StatisticalSummary describing data from the first sample * @param sampleStats2 StatisticalSummary describing data from the second sample @@ -400,16 +400,16 @@ * at which one can reject the null hypothesis that the mean equals * mu in favor of the two-sided alternative that the mean * is different from mu. For a one-sided test, divide the - * returned value by 2. + * returned value by 2.

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the parametric * t-test procedure, as discussed * here - *

    + *

    * Preconditions:

      *
    • The observed array length must be at least 2. - *
    + *

    * * @param mu constant value to compare sample mean against * @param sample array of sample data values @@ -434,7 +434,7 @@ * Returns true iff the null hypothesis can be * rejected with confidence 1 - alpha. To * perform a 1-sided test, use alpha * 2 - *

    + *

    * Examples:

      *
    1. To test the (2-sided) hypothesis sample mean = mu at * the 95% level, use
      tTest(mu, sample, 0.05) @@ -443,16 +443,16 @@ * at the 99% level, first verify that the measured sample mean is less * than mu and then use *
      tTest(mu, sample, 0.02) - *
    + *

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the one-sample * parametric t-test procedure, as discussed * here - *

    + *

    * Preconditions:

      *
    • The observed array length must be at least 2. - *
    + *

    * * @param mu constant value to compare sample mean against * @param sample array of sample data values @@ -479,17 +479,17 @@ * at which one can reject the null hypothesis that the mean equals * mu in favor of the two-sided alternative that the mean * is different from mu. For a one-sided test, divide the - * returned value by 2. + * returned value by 2.

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The sample must contain at least 2 observations. - *
    + *

    * * @param mu constant value to compare sample mean against * @param sampleStats StatisticalSummary describing sample data @@ -514,7 +514,7 @@ *

    * Returns true iff the null hypothesis can be rejected with * confidence 1 - alpha. To perform a 1-sided test, use - * alpha * 2. + * alpha * 2.

    *

    * Examples:

      *
    1. To test the (2-sided) hypothesis sample mean = mu at @@ -524,16 +524,16 @@ * at the 99% level, first verify that the measured sample mean is less * than mu and then use *
      tTest(mu, sampleStats, 0.02) - *
    + *

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the one-sample * parametric t-test procedure, as discussed * here - *

    + *

    * Preconditions:

      *
    • The sample must include at least 2 observations. - *
    + *

    * * @param mu constant value to compare sample mean against * @param sampleStats StatisticalSummary describing sample data values @@ -559,7 +559,7 @@ * The number returned is the smallest significance level * at which one can reject the null hypothesis that the two means are * equal in favor of the two-sided alternative that they are different. - * For a one-sided test, divide the returned value by 2. + * For a one-sided test, divide the returned value by 2.

    *

    * The test does not assume that the underlying popuation variances are * equal and it uses approximated degrees of freedom computed from the @@ -569,17 +569,17 @@ * as described * * here. To perform the test under the assumption of equal subpopulation - * variances, use {@link #homoscedasticTTest(double[], double[])}. + * variances, use {@link #homoscedasticTTest(double[], double[])}.

    *

    * Usage Note:
    * The validity of the p-value depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The observed array lengths must both be at least 2. - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -609,21 +609,21 @@ * The number returned is the smallest significance level * at which one can reject the null hypothesis that the two means are * equal in favor of the two-sided alternative that they are different. - * For a one-sided test, divide the returned value by 2. + * For a one-sided test, divide the returned value by 2.

    *

    * A pooled variance estimate is used to compute the t-statistic. See * {@link #homoscedasticT(double[], double[])}. The sum of the sample sizes - * minus 2 is used as the degrees of freedom. + * minus 2 is used as the degrees of freedom.

    *

    * Usage Note:
    * The validity of the p-value depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The observed array lengths must both be at least 2. - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -656,12 +656,12 @@ *

    * Returns true iff the null hypothesis that the means are * equal can be rejected with confidence 1 - alpha. To - * perform a 1-sided test, use alpha / 2 + * perform a 1-sided test, use alpha / 2

    *

    * See {@link #t(double[], double[])} for the formula used to compute the * t-statistic. Degrees of freedom are approximated using the * - * Welch-Satterthwaite approximation. + * Welch-Satterthwaite approximation.

    *

    * Examples:

      @@ -673,19 +673,19 @@ * the 99% level, first verify that the measured mean of sample 1 * is less than the mean of sample 2 and then use *
      tTest(sample1, sample2, 0.02) - *
    + *

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The observed array lengths must both be at least 2. *
    • *
    • 0 < alpha < 0.5 - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -718,11 +718,11 @@ * equal can be rejected with confidence 1 - alpha. To * perform a 1-sided test, use alpha * 2. To perform the test * without the assumption of equal subpopulation variances, use - * {@link #tTest(double[], double[], double)}. + * {@link #tTest(double[], double[], double)}.

    *

    * A pooled variance estimate is used to compute the t-statistic. See * {@link #t(double[], double[])} for the formula. The sum of the sample - * sizes minus 2 is used as the degrees of freedom. + * sizes minus 2 is used as the degrees of freedom.

    *

    * Examples:

      *
    1. To test the (2-sided) hypothesis mean 1 = mean 2 at @@ -733,19 +733,19 @@ * sample 1 is less than the mean of sample 2 * and then use *
      tTest(sample1, sample2, 0.02) - *
    + *

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The observed array lengths must both be at least 2. *
    • *
    • 0 < alpha < 0.5 - *
    + *

    * * @param sample1 array of sample data values * @param sample2 array of sample data values @@ -773,24 +773,24 @@ * The number returned is the smallest significance level * at which one can reject the null hypothesis that the two means are * equal in favor of the two-sided alternative that they are different. - * For a one-sided test, divide the returned value by 2. + * For a one-sided test, divide the returned value by 2.

    *

    * The test does not assume that the underlying popuation variances are * equal and it uses approximated degrees of freedom computed from the * sample data to compute the p-value. To perform the test assuming * equal variances, use - * {@link #homoscedasticTTest(StatisticalSummary, StatisticalSummary)}. + * {@link #homoscedasticTTest(StatisticalSummary, StatisticalSummary)}.

    *

    * Usage Note:
    * The validity of the p-value depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The datasets described by the two Univariates must each contain * at least 2 observations. - *
    + *

    * * @param sampleStats1 StatisticalSummary describing data from the first sample * @param sampleStats2 StatisticalSummary describing data from the second sample @@ -820,21 +820,21 @@ * The number returned is the smallest significance level * at which one can reject the null hypothesis that the two means are * equal in favor of the two-sided alternative that they are different. - * For a one-sided test, divide the returned value by 2. + * For a one-sided test, divide the returned value by 2.

    *

    * See {@link #homoscedasticT(double[], double[])} for the formula used to * compute the t-statistic. The sum of the sample sizes minus 2 is used as - * the degrees of freedom. + * the degrees of freedom.

    *

    * Usage Note:
    * The validity of the p-value depends on the assumptions of the parametric * t-test procedure, as discussed * here - *

    + *

    * Preconditions:

      *
    • The datasets described by the two Univariates must each contain * at least 2 observations. - *
    + *

    * * @param sampleStats1 StatisticalSummary describing data from the first sample * @param sampleStats2 StatisticalSummary describing data from the second sample @@ -868,12 +868,12 @@ *

    * Returns true iff the null hypothesis that the means are * equal can be rejected with confidence 1 - alpha. To - * perform a 1-sided test, use alpha * 2 + * perform a 1-sided test, use alpha * 2

    *

    * See {@link #t(double[], double[])} for the formula used to compute the * t-statistic. Degrees of freedom are approximated using the * - * Welch-Satterthwaite approximation. + * Welch-Satterthwaite approximation.

    *

    * Examples:

      *
    1. To test the (2-sided) hypothesis mean 1 = mean 2 at @@ -885,20 +885,20 @@ * sample 1 is less than the mean of sample 2 * and then use *
      tTest(sampleStats1, sampleStats2, 0.02) - *
    + *

    *

    * Usage Note:
    * The validity of the test depends on the assumptions of the parametric * t-test procedure, as discussed * - * here + * here

    *

    * Preconditions:

      *
    • The datasets described by the two Univariates must each contain * at least 2 observations. *
    • *
    • 0 < alpha < 0.5 - *
    + *

    * * @param sampleStats1 StatisticalSummary describing sample data values * @param sampleStats2 StatisticalSummary describing sample data values @@ -959,7 +959,7 @@ /** * Computes t test statistic for 2-sample t-test. *

    - * Does not assume that subpopulation variances are equal. + * Does not assume that subpopulation variances are equal.

    * * @param m1 first sample mean * @param m2 second sample mean @@ -1013,7 +1013,7 @@ * Computes p-value for 2-sided, 2-sample t-test. *

    * Does not assume subpopulation variances are equal. Degrees of freedom - * are estimated from the data. + * are estimated from the data.

    * * @param m1 first sample mean * @param m2 second sample mean @@ -1038,7 +1038,7 @@ * Computes p-value for 2-sided, 2-sample t-test, under the assumption * of equal subpopulation variances. *

    - * The sum of the sample sizes minus 2 is used as degrees of freedom. + * The sum of the sample sizes minus 2 is used as degrees of freedom.

    * * @param m1 first sample mean * @param m2 second sample mean Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/UnknownDistributionChiSquareTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/UnknownDistributionChiSquareTest.java?rev=617953&r1=617952&r2=617953&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/UnknownDistributionChiSquareTest.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/UnknownDistributionChiSquareTest.java Sat Feb 2 21:54:00 2008 @@ -40,7 +40,7 @@ *
    K = &sqrt;[&sum(observed2 / ∑(observed1)] *

    *

    This statistic can be used to perform a Chi-Square test evaluating the null hypothesis that - * both observed counts follow the same distribution. + * both observed counts follow the same distribution.

    *

    * Preconditions:

      *
    • Observed counts must be non-negative. @@ -51,9 +51,9 @@ *
    • *
    • The arrays observed1 and observed2 must have the same length and * their common length must be at least 2. - *

    + *

    * If any of the preconditions are not met, an - * IllegalArgumentException is thrown. + * IllegalArgumentException is thrown.

    * * @param observed1 array of observed frequency counts of the first data set * @param observed2 array of observed frequency counts of the second data set @@ -91,7 +91,7 @@ * their common length must be at least 2. *

    * If any of the preconditions are not met, an - * IllegalArgumentException is thrown. + * IllegalArgumentException is thrown.

    * * @param observed1 array of observed frequency counts of the first data set * @param observed2 array of observed frequency counts of the second data set @@ -127,7 +127,7 @@ *
  • 0 < alpha < 0.5 *
  • * If any of the preconditions are not met, an - * IllegalArgumentException is thrown. + * IllegalArgumentException is thrown.

    * * @param observed1 array of observed frequency counts of the first data set * @param observed2 array of observed frequency counts of the second data set