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

[math] SimpleRegression getSumSquaredErrors

    XMLWordPrintableJSON

Details

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

    • 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

            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: