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

[math] NaN handling in StatsUtil.min, StatsUtil.max methods

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0
    • None
    • None
    • None
    • Operating System: Windows 2000
      Platform: PC

    • 37019

    Description

      Data with NaN appears to be incorrectly handled in some cases when calculating
      min and max using StatsUtil package. See examples below:

      data=

      {NaN, 4.0, 5.0, NaN}

      max (Apache)=NaN <-- correct.
      min (Apache)=NaN <-- correct.

      data=

      {4.0, 5.0, NaN}

      max (Apache)=NaN <-- correct.
      min (Apache)=NaN <-- correct.

      data=

      {4.0, 5.0, 7.0}

      max (Apache)=7.0 <-- correct.
      min (Apache)=4.0 <-- correct.

      data=

      {NaN, 4.0, 5.0}

      max (Apache)=5.0 <-- incorrect? NaN.
      min (Apache)=4.0 <-- incorrect? NaN.

      data=

      {2.2343, NaN, NaN, 3435.32}

      max (Apache)=3435.32 <-- incorrect? NaN.
      min (Apache)=3435.32 <-- incorrect? NaN.

      data=

      {3435.32, NaN, NaN, 2.2343}

      max (Apache)=2.2343 <-- incorrect? NaN.
      min (Apache)=2.2343 <-- incorrect? NaN.

      data=

      {NaN, NaN, NaN}

      max (Apache)=NaN <-- correct.
      min (Apache)=NaN <-- correct.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mark.osborn@research.ge.com Mark Osborn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: