>> *
• ` lowerBound <= a < initial < b <= upperBound` >>
• >> - *
• ` f(a) * f(b) < 0 `
• >> + *
• ` f(a) * f(b) <= 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 >> * when one of the following happens:
>> - *
• ` f(a) * f(b) < 0 ` -- success!
• >> + *
• ` f(a) * f(b) <= 0 ` -- success!
• >> *
• ` a = lower ` and ` b = upper` >> * -- ConvergenceException
• >> *
• ` maximumIterations` iterations elapse >> @@ -195,7 +195,7 @@ >> } while ((fa * fb > 0.0) && (numIterations < >> maximumIterations) && >> ((a > lowerBound) || (b < upperBound))); >> >> - if (fa * fb >= 0.0 ) { >> + if (fa * fb > 0.0 ) { >> throw new ConvergenceException( >> "number of iterations={0}, maximum >> iterations={1}, " + >> "initial={2}, lower bound={3}, upper bound={4}, >> final a value={5}, " + >> >> Modified: >> commons/proper/math/trunk/src/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java >> URL: >> http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java?rev=791766&r1=791765&r2=791766&view=diff >> ============================================================================== >> --- >> commons/proper/math/trunk/src/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java >> (original) >> +++ >> commons/proper/math/trunk/src/java/org/apache/commons/math/distribution/AbstractContinuousDistribution.java >> Tue Jul 7 09:19:46 2009 >> @@ -65,7 +65,7 @@ >> } >> >> // 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 = >> new UnivariateRealFunction() { >> public double value(double x) throws >> FunctionEvaluationException { >> >> 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=791766&r1=791765&r2=791766&view=diff >> ============================================================================== >> --- 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 >> + >> >> Added a check for too few rows with respect to the number of >> predictors in linear regression >> >> >> Modified: >> commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java >> URL: >> http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java?rev=791766&r1=791765&r2=791766&view=diff >> ============================================================================== >> --- >> commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java >> (original) >> +++ >> commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtilsTest.java >> Tue Jul 7 09:19:46 2009 >> @@ -17,13 +17,12 @@ >> >> package org.apache.commons.math.analysis.solvers; >> >> -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; >> >> -import junit.framework.TestCase; >> - >> /** >> * @version \$Revision\$ \$Date\$ >> */ >> @@ -91,15 +90,6 @@ >> assertTrue(sin.value(result[1]) > 0); >> } >> >> - public void testBracketCornerSolution() throws MathException { >> - try { >> - UnivariateRealSolverUtils.bracket(sin, 1.5, 0, 2.0); >> - fail("Expecting ConvergenceException"); >> - } catch (ConvergenceException ex) { >> - // expected >> - } >> - } >> - >> public void testBadParameters() throws MathException { >> try { // null function >> UnivariateRealSolverUtils.bracket(null, 1.5, 0, 2.0); >> >> Modified: >> commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/NormalDistributionTest.java >> URL: >> http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/NormalDistributionTest.java?rev=791766&r1=791765&r2=791766&view=diff >> ============================================================================== >> --- >> commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/NormalDistributionTest.java >> (original) >> +++ >> commons/proper/math/trunk/src/test/org/apache/commons/math/distribution/NormalDistributionTest.java >> Tue Jul 7 09:19:46 2009 >> @@ -17,6 +17,8 @@ >> >> package org.apache.commons.math.distribution; >> >> +import org.apache.commons.math.MathException; >> + >> /** >> * Test cases for NormalDistribution. >> * Extends ContinuousDistributionAbstractTest. See class javadoc >> for >> @@ -161,4 +163,11 @@ >> } >> } >> } >> + >> + public void testMath280() throws MathException { >> + NormalDistribution normal = new NormalDistributionImpl(0,1); >> + double result = >> 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 > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org