Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-414

ConvergenceException in NormalDistributionImpl.cumulativeProbability()

Rank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersConvert to sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1
    • 2.2
    • None
    • Jdk 1.6.

    Description

      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;
      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            gustav.ryd Gustav Ryd
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified

                Slack

                  Issue deployment