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

[math] SimpleRegression getSumSquaredErrors

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: Windows 2000
      Platform: PC

    • Bugzilla Id:
      39432

      Description

      getSumSquaredErrors returns -ve value. See test below:

      public void testSimpleRegression() {
      double[] y =

      { 8915.102, 8919.302, 8923.502}

      ;
      double[] x =

      { 1.107178495, 1.107264895, 1.107351295}

      ;
      double[] x2 =

      { 1.107178495E2, 1.107264895E2, 1.107351295E2}

      ;
      SimpleRegression reg = new SimpleRegression();
      for (int i = 0; i < x.length; i++)

      { reg.addData(x[i],y[i]); }

      assertTrue(reg.getSumSquaredErrors() >= 0.0); // OK
      reg.clear();
      for (int i = 0; i < x.length; i++)

      { reg.addData(x2[i],y[i]); }

      assertTrue(reg.getSumSquaredErrors() >= 0.0); // FAIL

      }

        Attachments

        1. math-85.patch
          1 kB
          Luc Maisonobe

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: