You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gustav Ryd (JIRA)" <ji...@apache.org> on 2010/08/31 13:02:55 UTC

[jira] Created: (MATH-414) ConvergenceException in NormalDistributionImpl.cumulativeProbability()

ConvergenceException in NormalDistributionImpl.cumulativeProbability()
----------------------------------------------------------------------

                 Key: MATH-414
                 URL: https://issues.apache.org/jira/browse/MATH-414
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 2.1
         Environment: Jdk 1.6.
            Reporter: Gustav Ryd
            Priority: Minor


I get a ConvergenceException in  NormalDistributionImpl.cumulativeProbability() for very large/small parameters including Infinity, -Infinity.
For instance in the following code:

	@Test
	public void testCumulative() {
		final NormalDistribution nd = new NormalDistributionImpl();
		for (int i = 0; i < 500; i++) {
			final double val = Math.exp(i);
			try {
				System.out.println("val = " + val + " cumulative = " + nd.cumulativeProbability(val));
			} catch (MathException e) {
				e.printStackTrace();
				fail();
			}
		}
	}

In version 2.0, I get no exception. 

My suggestion is to change in the implementation of cumulativeProbability(double) to catch all ConvergenceException (and return for very large and very small values), not just MaxIterationsExceededException.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (MATH-414) ConvergenceException in NormalDistributionImpl.cumulativeProbability()

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-414?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz updated MATH-414:
-----------------------------

    Fix Version/s: 2.2

> ConvergenceException in NormalDistributionImpl.cumulativeProbability()
> ----------------------------------------------------------------------
>
>                 Key: MATH-414
>                 URL: https://issues.apache.org/jira/browse/MATH-414
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Jdk 1.6.
>            Reporter: Gustav Ryd
>            Priority: Minor
>             Fix For: 2.2
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> I get a ConvergenceException in  NormalDistributionImpl.cumulativeProbability() for very large/small parameters including Infinity, -Infinity.
> For instance in the following code:
> 	@Test
> 	public void testCumulative() {
> 		final NormalDistribution nd = new NormalDistributionImpl();
> 		for (int i = 0; i < 500; i++) {
> 			final double val = Math.exp(i);
> 			try {
> 				System.out.println("val = " + val + " cumulative = " + nd.cumulativeProbability(val));
> 			} catch (MathException e) {
> 				e.printStackTrace();
> 				fail();
> 			}
> 		}
> 	}
> In version 2.0, I get no exception. 
> My suggestion is to change in the implementation of cumulativeProbability(double) to catch all ConvergenceException (and return for very large and very small values), not just MaxIterationsExceededException.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.