Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-1179 kolmogorovSmirnovTest poor performance in monteCarloP method
  3. MATH-1240

Kolmogorov-Smirnov 2-sample test returns wrong p-value if input data is identical

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0, 3.6
    • None
    • None

    Description

      Depending on the method used, wrong results are returned:

      • exact -> correct
      • monteCarlo -> wrong (returns a very small p-value)
      • approximate -> wrong (returns 0 instead of 1)

      The problem for the approximate version is due to this code snippet in ksSum

              if (t == 0.0) {
                  return 1.0;
              }
      

      should rather return 0 in this case, but needs to be verified.

      This problem was hidden (due to wrong statistic calculation) in previous versions of commons-math or resulted in a TooManyIterationsException (if statistic is 0 as correct in case of identical values).

      Attachments

        Activity

          People

            Unassigned Unassigned
            tn Thomas Neidhart
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: