commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r1405634 - in /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference: ChiSquareTest.java TestUtils.java
Date Sun, 04 Nov 2012 20:51:21 GMT
Author: psteitz
Date: Sun Nov  4 20:51:21 2012
New Revision: 1405634

URL: http://svn.apache.org/viewvc?rev=1405634&view=rev
Log:
Javadoc fix.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/ChiSquareTest.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/TestUtils.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/ChiSquareTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/ChiSquareTest.java?rev=1405634&r1=1405633&r2=1405634&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/ChiSquareTest.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/ChiSquareTest.java
Sun Nov  4 20:51:21 2012
@@ -30,9 +30,12 @@ import org.apache.commons.math3.util.Mat
 
 /**
  * Implements Chi-Square test statistics.
- * <p>This implementation handles both, known and unknown distributions.</p>
- * <p>Two samples tests are used when the distribution is unknown <i>a priori</i>
- * but provided by one sample. We compare the second sample against the first.</p>
+ *
+ * <p>This implementation handles both known and unknown distributions.</p>
+ *
+ * <p>Two samples tests can be used when the distribution is unknown <i>a priori</i>
+ * but provided by one sample, or when the hypothesis under test is that the two
+ * samples come from the same underlying distribution.</p>
  *
  * @version $Id$
  */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/TestUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/TestUtils.java?rev=1405634&r1=1405633&r2=1405634&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/TestUtils.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/inference/TestUtils.java
Sun Nov  4 20:51:21 2012
@@ -47,6 +47,9 @@ public class TestUtils  {
     /** Singleton OneWayAnova instance. */
     private static final OneWayAnova ONE_WAY_ANANOVA = new OneWayAnova();
 
+    /** Singleton G-Test instance. */
+    private static final GTest G_TEST = new GTest();
+
     /**
      * Prevent instantiation.
      */
@@ -362,6 +365,83 @@ public class TestUtils  {
         return ONE_WAY_ANANOVA.anovaTest(categoryData, alpha);
     }
 
+     /**
+     * @see org.apache.commons.math3.stat.inference.GTest#gValueGoodnessOfFit(double[], long[])
+     */
+    public static double gValue(final double[] expected, final long[] observed)
+        throws NotPositiveException, NotStrictlyPositiveException,
+        DimensionMismatchException {
+        return G_TEST.gValueGoodnessOfFit(expected, observed);
+    }
+
+    /**
+     * @see org.apache.commons.math3.stat.inference.GTest#gTestGoodnessOfFitPValue( double[],
 long[] )
+     */
+    public static double gTest_pValue(final double[] expected, final long[] observed)
+        throws NotPositiveException, NotStrictlyPositiveException,
+        DimensionMismatchException, MaxCountExceededException {
+        return G_TEST.gTestGoodnessOfFitPValue(expected, observed);
+    }
+
+    /**
+     * @see org.apache.commons.math3.stat.inference.GTest#gTestGoodnessOfFitIntrinsicPValue(double[],
long[] )
+     */
+    public static double gTestIntrinsic_pValue(final double[] expected, final long[] observed)
+        throws NotPositiveException, NotStrictlyPositiveException,
+        DimensionMismatchException, MaxCountExceededException {
+        return G_TEST.gTestGoodnessOfFitIntrinsicPValue(expected, observed);
+    }
+
+     /**
+     * @see org.apache.commons.math3.stat.inference.GTest#gTestGoodnessOfFit( double[],long[],double)
+     */
+    public static boolean gTest(final double[] expected, final long[] observed,
+                                final double alpha)
+        throws NotPositiveException, NotStrictlyPositiveException,
+        DimensionMismatchException, OutOfRangeException, MaxCountExceededException {
+        return G_TEST.gTestGoodnessOfFit(expected, observed, alpha);
+    }
+
+    /**
+     * @see org.apache.commons.math3.stat.inference.GTest#gValueDataSetsComparison(long[],
long[])
+     */
+    public static double gValueDataSetsComparison(final long[] observed1,
+                                                  final long[] observed2)
+        throws DimensionMismatchException, NotPositiveException, ZeroException {
+        return G_TEST.gValueDataSetsComparison(observed1, observed2);
+    }
+
+    /**
+     * @see org.apache.commons.math3.stat.inference.GTest#rootLogLikelihoodRatio(long, long,
long, long)
+     */
+    public static double rootLogLikelihoodRatio(final long k11, final long k12, final long
k21, final long k22)
+        throws DimensionMismatchException, NotPositiveException, ZeroException {
+        return G_TEST.rootLogLikelihoodRatio(k11, k12, k21, k22);
+    }
+
+
+    /**
+     * @see org.apache.commons.math3.stat.inference.ChiSquareTest#gTestDataSetsComparisonPValue(long[],
long[])
+     *
+     */
+    public static double gTestDataSetsComparison_pValue(final long[] observed1,
+                                                        final long[] observed2)
+        throws DimensionMismatchException, NotPositiveException, ZeroException,
+        MaxCountExceededException {
+        return G_TEST.gTestDataSetsComparisonPValue(observed1, observed2);
+    }
+
+    /**
+     * @see org.apache.commons.math3.stat.inference.ChiSquareTest#gTestDataSetsComparison(double[],long[],double)
+     */
+    public static boolean gTestDataSetsComparison(final long[] observed1,
+                                                  final long[] observed2,
+                                                  final double alpha)
+        throws DimensionMismatchException, NotPositiveException,
+        ZeroException, OutOfRangeException, MaxCountExceededException {
+        return G_TEST.gTestDataSetsComparison(observed1, observed2, alpha);
+    }
+
     // CHECKSTYLE: resume JavadocMethodCheck
 
 }



Mime
View raw message