diff --git a/src/main/java/org/apache/commons/math/stat/inference/TTestImpl.java b/src/main/java/org/apache/commons/math/stat/inference/TTestImpl.java index 20a81a187..fa04d4a6c 100644 --- a/src/main/java/org/apache/commons/math/stat/inference/TTestImpl.java +++ b/src/main/java/org/apache/commons/math/stat/inference/TTestImpl.java @@ -35,7 +35,9 @@ import org.apache.commons.math.util.FastMath; */ public class TTestImpl implements TTest { - /** Distribution used to compute inference statistics. */ + /** Distribution used to compute inference statistics. + * @deprecated in 2.2 (to be removed in 3.0). + */ private TDistribution distribution; /** @@ -50,6 +52,7 @@ public class TTestImpl implements TTest { * inference statistics. * @param t distribution used to compute inference statistics. * @since 1.2 + * @deprecated in 2.2 (to be removed in 3.0). */ public TTestImpl(TDistribution t) { super(); @@ -1015,6 +1018,7 @@ public class TTestImpl implements TTest { * Modify the distribution used to compute inference statistics. * @param value the new distribution * @since 1.2 + * @deprecated in 2.2 (to be removed in 3.0). */ public void setDistribution(TDistribution value) { distribution = value; diff --git a/src/main/java/org/apache/commons/math/stat/regression/SimpleRegression.java b/src/main/java/org/apache/commons/math/stat/regression/SimpleRegression.java index d5f8d5d69..4fde70023 100644 --- a/src/main/java/org/apache/commons/math/stat/regression/SimpleRegression.java +++ b/src/main/java/org/apache/commons/math/stat/regression/SimpleRegression.java @@ -101,12 +101,25 @@ public class SimpleRegression implements Serializable { * compute inference statistics. * @param t the distribution used to compute inference statistics. * @since 1.2 + * @deprecated in 2.2 (to be removed in 3.0). Please use the {@link + * #SimpleRegression(int) other constructor} instead. */ public SimpleRegression(TDistribution t) { super(); setDistribution(t); } + /** + * Create an empty SimpleRegression. + * + * @param degrees Number of degrees of freedom of the distribution + * used to compute inference statistics. + * @since 2.2 + */ + public SimpleRegression(int degrees) { + setDistribution(new TDistributionImpl(degrees)); + } + /** * Adds the observation (x,y) to the regression data set. *

@@ -611,6 +624,7 @@ public class SimpleRegression implements Serializable { * Modify the distribution used to compute inference statistics. * @param value the new distribution * @since 1.2 + * @deprecated in 2.2 (to be removed in 3.0). */ public void setDistribution(TDistribution value) { distribution = value; diff --git a/src/main/java/org/apache/commons/math/util/FastMath.java b/src/main/java/org/apache/commons/math/util/FastMath.java index 9c471e636..4f5616b6f 100644 --- a/src/main/java/org/apache/commons/math/util/FastMath.java +++ b/src/main/java/org/apache/commons/math/util/FastMath.java @@ -2881,8 +2881,8 @@ public class FastMath { } /** Compute the cubic root of a number. - * @param a number on which evaluation is done - * @return cubic root of a + * @param x number on which evaluation is done + * @return cubic root of x */ public static double cbrt(double x) { /* Convert input double to bits */