Author: brentworden Date: Sat Apr 5 18:25:08 2008 New Revision: 645193 URL: http://svn.apache.org/viewvc?rev=645193&view=rev Log: MATH-201. Fixed truncation error in t-test classes for large t values.
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/TTestImpl.java commons/proper/math/trunk/src/site/xdoc/changes.xml Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/TTestImpl.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/TTestImpl.java?rev=645193&r1=645192&r2=645193&view=diff ============================================================================== --- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/TTestImpl.java (original) +++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/inference/TTestImpl.java Sat Apr 5 18:25:08 2008 @@ -1006,7 +1006,7 @@ throws MathException { double t = Math.abs(t(m, mu, v, n)); distribution.setDegreesOfFreedom(n - 1); - return 1.0 - distribution.cumulativeProbability(-t, t); + return 2.0 * distribution.cumulativeProbability(-t); } /** @@ -1031,7 +1031,7 @@ double degreesOfFreedom = 0; degreesOfFreedom = df(v1, v2, n1, n2); distribution.setDegreesOfFreedom(degreesOfFreedom); - return 1.0 - distribution.cumulativeProbability(-t, t); + return 2.0 * distribution.cumulativeProbability(-t); } /** @@ -1055,7 +1055,7 @@ double t = Math.abs(homoscedasticT(m1, m2, v1, v2, n1, n2)); double degreesOfFreedom = (double) (n1 + n2 - 2); distribution.setDegreesOfFreedom(degreesOfFreedom); - return 1.0 - distribution.cumulativeProbability(-t, t); + return 2.0 * distribution.cumulativeProbability(-t); } /** Modified: commons/proper/math/trunk/src/site/xdoc/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/changes.xml?rev=645193&r1=645192&r2=645193&view=diff ============================================================================== --- commons/proper/math/trunk/src/site/xdoc/changes.xml (original) +++ commons/proper/math/trunk/src/site/xdoc/changes.xml Sat Apr 5 18:25:08 2008 @@ -45,16 +45,19 @@ Javadoc and style fixes. </action> <action dev="luc" type="fix" issue="MATH-198" due-to="Frederick Salardi"> - added an error detection for missing imaginary character while parsing complex string + Added an error detection for missing imaginary character while parsing complex string </action> <action dev="luc" type="fix" issue="MATH-199" due-to="Mick"> - detect numerical problems in Q.R decomposition for Levenberg-Marquardt estimator + Detect numerical problems in Q.R decomposition for Levenberg-Marquardt estimator and report them appropriately </action> <action dev="luc" type="fix" issue="MATH-200" due-to="Plamen Petrov"> - fixed several crashes in getCovariances() and guessParametersErrors() in + Fixed several crashes in getCovariances() and guessParametersErrors() in AbstractEstimator when some parameters are bound. The methods now explicitly give result only about unbound parameters. + </action> + <action dev="brentworden" type="fix" issue="MATH-201" due-to="Peter Wyngaard"> + Fixed truncation error in t-test classes for large t values. </action> </release> <release version="1.2" date="2008-02-24"