• ``` lowerBound <=3D a < initial < b <=3D upperBound > ```
• ``` > - * f(a) * f(b) < 0 > + * f(a) * f(b) <=3D 0 > * ```
``` > * If f is continuous on [a,b], this means that > a > * and b bracket a root of f. > @@ -141,7 +141,7 @@ > * function at a and b and keeps > moving > * the endpoints out by one unit each time through a loop that > terminates=20 > * when one of the following happens: > - * f(a) * f(b) < 0 -- success! > + * f(a) * f(b) <=3D 0 -- success! > * a =3D lower and b =3D upper=20 > * -- ConvergenceException > * maximumIterations iterations elapse=20 > @@ -195,7 +195,7 @@ > } while ((fa * fb > 0.0) && (numIterations < > maximumIterations) &&=20 > ((a > lowerBound) || (b < upperBound))); > =20 > - if (fa * fb >=3D 0.0 ) { > + if (fa * fb > 0.0 ) { > throw new ConvergenceException( > "number of iterations=3D{0}, maximum > iterations=3D{1}, " + > "initial=3D{2}, lower bound=3D{3}, upper bound=3D{= 4}, > final a value=3D{5}, " + >=20 > Modified: > commons/proper/math/trunk/src/java/org/apache/commons/math/distribution/A= bstractContinuousDistribution.java > URL: > http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apach= e/commons/math/distribution/AbstractContinuousDistribution.java?rev=3D79176= 6&r1=3D791765&r2=3D791766&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- > commons/proper/math/trunk/src/java/org/apache/commons/math/distribution/A= bstractContinuousDistribution.java > (original) > +++ > commons/proper/math/trunk/src/java/org/apache/commons/math/distribution/A= bstractContinuousDistribution.java > Tue Jul 7 09:19:46 2009 > @@ -65,7 +65,7 @@ > } > =20 > // by default, do simple root finding using bracketing and > default solver. > - // subclasses can overide if there is a better method. > + // subclasses can override if there is a better method. > UnivariateRealFunction rootFindingFunction =3D > new UnivariateRealFunction() { > public double value(double x) throws > FunctionEvaluationException { >=20 > Modified: commons/proper/math/trunk/src/site/xdoc/changes.xml > URL: > http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/chan= ges.xml?rev=3D791766&r1=3D791765&r2=3D791766&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- commons/proper/math/trunk/src/site/xdoc/changes.xml (original) > +++ commons/proper/math/trunk/src/site/xdoc/changes.xml Tue Jul 7 > 09:19:46 2009 > @@ -39,6 +39,9 @@ > > > > + > + Fixed a bracketing issue in inverse cumulative probability > computation > + > Bjorkegren"> > Added a check for too few rows with respect to the number of > predictors in linear regression > >=20 > Modified: > commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/solve= rs/UnivariateRealSolverUtilsTest.java > URL: > http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apach= e/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java?rev=3D79= 1766&r1=3D791765&r2=3D791766&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- > commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/solve= rs/UnivariateRealSolverUtilsTest.java > (original) > +++ > commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/solve= rs/UnivariateRealSolverUtilsTest.java > Tue Jul 7 09:19:46 2009 > @@ -17,13 +17,12 @@ > =20 > package org.apache.commons.math.analysis.solvers; > =20 > -import org.apache.commons.math.ConvergenceException; > +import junit.framework.TestCase; > + > import org.apache.commons.math.MathException; > import org.apache.commons.math.analysis.SinFunction; > import org.apache.commons.math.analysis.UnivariateRealFunction; > =20 > -import junit.framework.TestCase; > - > /** > * @version \$Revision\$ \$Date\$ > */ > @@ -91,15 +90,6 @@ > assertTrue(sin.value(result[1]) > 0); > } > =20 > - public void testBracketCornerSolution() throws MathException { > - try { > - UnivariateRealSolverUtils.bracket(sin, 1.5, 0, 2.0);=20 > - fail("Expecting ConvergenceException"); > - } catch (ConvergenceException ex) { > - // expected > - } > - } > - =20 > public void testBadParameters() throws MathException { > try { // null function > UnivariateRealSolverUtils.bracket(null, 1.5, 0, 2.0); >=20 > Modified: > commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/N= ormalDistributionTest.java > URL: > http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apach= e/commons/math/distribution/NormalDistributionTest.java?rev=3D791766&r1=3D7= 91765&r2=3D791766&view=3Ddiff > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- > commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/N= ormalDistributionTest.java > (original) > +++ > commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/N= ormalDistributionTest.java > Tue Jul 7 09:19:46 2009 > @@ -17,6 +17,8 @@ > =20 > package org.apache.commons.math.distribution; > =20 > +import org.apache.commons.math.MathException; > + > /** > * Test cases for NormalDistribution. > * Extends ContinuousDistributionAbstractTest. See class javadoc > for > @@ -161,4 +163,11 @@ > } > }=20 > } > + > + public void testMath280() throws MathException { > + NormalDistribution normal =3D new NormalDistributionImpl(0,1); > + double result =3D > normal.inverseCumulativeProbability(0.9772498680518209); > + assertEquals(2.0, result, 1.0e-12); > + } > + > } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org ```