Return-Path:
- * The following recursive updating formula is used:
+ * The following recursive updating formula is used:
* Let
*
- * 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.
- * 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, orDouble.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.
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. ReturnsDouble.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).
* 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.
* Throws IllegalArgumentException
if the array is null or
- * the array index parameters are not valid.
+ * the array index parameters are not valid.
*
NaN
iff all values are NaN
* (i.e. NaN
values have no impact on the value of the statistic).Double.POSITIVE_INFINITY
,
* the result is Double.POSITIVE_INFINITY.
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).
* 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.
* Throws IllegalArgumentException
if the array is null or
- * the array index parameters are not valid.
+ * the array index parameters are not valid.
*
NaN
iff all values are NaN
* (i.e. NaN
values have no impact on the value of the statistic).Double.NEGATIVE_INFINITY
,
* the result is Double.NEGATIVE_INFINITY.
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.
values
array.
*
* Calls to this method do not modify the internal quantile
- * state of this statistic.
+ * state of this statistic.
*
Double.NaN
if values
has length
@@ -105,10 +105,10 @@
* 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 @@ *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.
*
Double.NaN
if length = 0
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.
Double.NaN
if the designated subarray
* is empty.
*
- * Throws IllegalArgumentException
if the array is null.
+ * Throws IllegalArgumentException
if the array is null.
* 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.
Double.NaN
if the designated subarray
* is empty.
*
- * Throws IllegalArgumentException
if the array is null.
+ * Throws IllegalArgumentException
if the array is null.
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.
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.
Double.NaN
if the designated subarray
* is empty.
*
- * Throws IllegalArgumentException
if the array is null.
+ * Throws IllegalArgumentException
if the array is null.
* 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:
+ *
* If any of the preconditions are not met, an
- * IllegalArgumentException
is thrown.
+ * IllegalArgumentException
is thrown.
* 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:
+ *
* If any of the preconditions are not met, an
- * IllegalArgumentException
is thrown.
+ * IllegalArgumentException
is thrown.
* 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:
0 < alpha < 0.5
- * + *
* If any of the preconditions are not met, an
- * IllegalArgumentException
is thrown.
+ * IllegalArgumentException
is thrown.
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:
counts
must have at least 2 columns and
- * at least 2 rows.
+ * 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.
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:
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.
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:
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.
* 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.
* 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:
* 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:
0 < alpha < 0.5
- * * This statistic can be used to perform a one sample t-test for the mean. - *
+ *
* Preconditions:
sampleStats
to mu
.
* * This statistic can be used to perform a one sample t-test for the mean. - *
+ *
* Preconditions:
observed.getN() > = 2
.
- * * 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:
* 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:
* 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:
* 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:
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:
* 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:
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:
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:
* 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:
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 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 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:
* 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:
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:
0 < alpha < 0.5
- * 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:
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:
0 < alpha < 0.5
- * * 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:
* 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:
* 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:
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:
0 < alpha < 0.5
- * * 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:
* 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:
* 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:
0 < alpha < 0.5
- * * This statistic can be used to perform a one sample t-test for the mean. - *
+ *
* Preconditions:
sampleStats
to mu
.
* * This statistic can be used to perform a one sample t-test for the mean. - *
+ *
* Preconditions:
observed.getN() > = 2
.
- * * 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:
* 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:
* 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:
* 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:
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:
true
iff the null hypothesis can be
* rejected with confidence 1 - alpha
. To
* perform a 1-sided test, use alpha * 2
- * + *
* Examples:
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:
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:
* 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:
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 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:
* 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:
* 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:
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:
0 < alpha < 0.5
- * 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:
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:
0 < alpha < 0.5
- * * 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:
* 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:
* 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:
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:
0 < alpha < 0.5
- * - * 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:
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.
* If any of the preconditions are not met, an
- * IllegalArgumentException
is thrown.
+ * IllegalArgumentException
is thrown.
0 < alpha < 0.5
*
* If any of the preconditions are not met, an
- * IllegalArgumentException
is thrown.
+ * IllegalArgumentException
is thrown.