Added final modifier for parameters, minor formatting changes for stat.inference package

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1241836 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2012-02-08 09:40:40 +00:00
parent eec73bbca2
commit f2a5e4f51e
3 changed files with 18 additions and 15 deletions

View File

@ -56,8 +56,8 @@ public class MannWhitneyUTestImpl implements MannWhitneyUTest {
* @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);
}

View File

@ -67,7 +67,7 @@ public class OneWayAnovaImpl implements OneWayAnova {
* 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 OneWayAnova {
* 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 OneWayAnova {
* 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 OneWayAnova {
* 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 OneWayAnova {
// 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[]

View File

@ -57,8 +57,8 @@ public class WilcoxonSignedRankTestImpl implements WilcoxonSignedRankTest {
* @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 implements WilcoxonSignedRankTest {
/** {@inheritDoc} */
public double wilcoxonSignedRankTest(final double[] x, final double[] y,
boolean exactPValue)
final boolean exactPValue)
throws NullArgumentException, NoDataException, DimensionMismatchException,
NumberIsTooLargeException, ConvergenceException, MaxCountExceededException {