You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2012/02/08 10:40:40 UTC

svn commit: r1241836 - in /commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference: MannWhitneyUTestImpl.java OneWayAnovaImpl.java WilcoxonSignedRankTestImpl.java

Author: tn
Date: Wed Feb  8 09:40:40 2012
New Revision: 1241836

URL: http://svn.apache.org/viewvc?rev=1241836&view=rev
Log:
Added final modifier for parameters, minor formatting changes for stat.inference package

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/MannWhitneyUTestImpl.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/OneWayAnovaImpl.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/WilcoxonSignedRankTestImpl.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/MannWhitneyUTestImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/MannWhitneyUTestImpl.java?rev=1241836&r1=1241835&r2=1241836&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/MannWhitneyUTestImpl.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/MannWhitneyUTestImpl.java Wed Feb  8 09:40:40 2012
@@ -56,8 +56,8 @@ public class MannWhitneyUTestImpl implem
      * @param tiesStrategy
      *            specifies the strategy that should be used for ties
      */
-    public MannWhitneyUTestImpl(NaNStrategy nanStrategy,
-            TiesStrategy tiesStrategy) {
+    public MannWhitneyUTestImpl(final NaNStrategy nanStrategy,
+                                final TiesStrategy tiesStrategy) {
         naturalRanking = new NaturalRanking(nanStrategy, tiesStrategy);
     }
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/OneWayAnovaImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/OneWayAnovaImpl.java?rev=1241836&r1=1241835&r2=1241836&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/OneWayAnovaImpl.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/OneWayAnovaImpl.java Wed Feb  8 09:40:40 2012
@@ -67,7 +67,7 @@ public class OneWayAnovaImpl implements 
      * are as defined <a href="http://faculty.vassar.edu/lowry/ch13pt1.html">
      * here</a></p>
      */
-    public double anovaFValue(Collection<double[]> categoryData)
+    public double anovaFValue(final Collection<double[]> categoryData)
         throws NullArgumentException, DimensionMismatchException {
 
         AnovaStats a = anovaStats(categoryData);
@@ -85,7 +85,7 @@ public class OneWayAnovaImpl implements 
      * where <code>F</code> is the F value and <code>cumulativeProbability</code>
      * is the commons-math implementation of the F distribution.</p>
      */
-    public double anovaPValue(Collection<double[]> categoryData)
+    public double anovaPValue(final Collection<double[]> categoryData)
         throws NullArgumentException, DimensionMismatchException,
         ConvergenceException, MaxCountExceededException {
 
@@ -106,13 +106,15 @@ public class OneWayAnovaImpl implements 
      * is the commons-math implementation of the F distribution.</p>
      * <p>True is returned iff the estimated p-value is less than alpha.</p>
      */
-    public boolean anovaTest(Collection<double[]> categoryData, double alpha)
-        throws NullArgumentException, DimensionMismatchException, OutOfRangeException,
-        ConvergenceException, MaxCountExceededException {
+    public boolean anovaTest(final Collection<double[]> categoryData,
+                             final double alpha)
+        throws NullArgumentException, DimensionMismatchException,
+        OutOfRangeException, ConvergenceException, MaxCountExceededException {
 
         if ((alpha <= 0) || (alpha > 0.5)) {
-            throw new OutOfRangeException(LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL,
-                                          alpha, 0, 0.5);
+            throw new OutOfRangeException(
+                    LocalizedFormats.OUT_OF_BOUND_SIGNIFICANCE_LEVEL,
+                    alpha, 0, 0.5);
         }
         return anovaPValue(categoryData) < alpha;
 
@@ -130,7 +132,7 @@ public class OneWayAnovaImpl implements 
      * array is less than 2 or a contained <code>double[]</code> array does not contain
      * at least two values
      */
-    private AnovaStats anovaStats(Collection<double[]> categoryData)
+    private AnovaStats anovaStats(final Collection<double[]> categoryData)
         throws NullArgumentException, DimensionMismatchException {
 
         if (categoryData == null) {
@@ -139,8 +141,9 @@ public class OneWayAnovaImpl implements 
 
         // check if we have enough categories
         if (categoryData.size() < 2) {
-            throw new DimensionMismatchException(LocalizedFormats.TWO_OR_MORE_CATEGORIES_REQUIRED,
-                                                 categoryData.size(), 2);
+            throw new DimensionMismatchException(
+                    LocalizedFormats.TWO_OR_MORE_CATEGORIES_REQUIRED,
+                    categoryData.size(), 2);
         }
 
         // check if each category has enough data and all is double[]

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/WilcoxonSignedRankTestImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/WilcoxonSignedRankTestImpl.java?rev=1241836&r1=1241835&r2=1241836&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/WilcoxonSignedRankTestImpl.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/inference/WilcoxonSignedRankTestImpl.java Wed Feb  8 09:40:40 2012
@@ -57,8 +57,8 @@ public class WilcoxonSignedRankTestImpl 
      * @param tiesStrategy
      *            specifies the strategy that should be used for ties
      */
-    public WilcoxonSignedRankTestImpl(NaNStrategy nanStrategy,
-                                      TiesStrategy tiesStrategy) {
+    public WilcoxonSignedRankTestImpl(final NaNStrategy nanStrategy,
+                                      final TiesStrategy tiesStrategy) {
         naturalRanking = new NaturalRanking(nanStrategy, tiesStrategy);
     }
 
@@ -226,7 +226,7 @@ public class WilcoxonSignedRankTestImpl 
 
     /** {@inheritDoc} */
     public double wilcoxonSignedRankTest(final double[] x, final double[] y,
-                                         boolean exactPValue)
+                                         final boolean exactPValue)
         throws NullArgumentException, NoDataException, DimensionMismatchException,
         NumberIsTooLargeException, ConvergenceException, MaxCountExceededException {