bugGNU Scientific Library - Bugs: bug #39369, Nonlinear least squares solver...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #39369: Nonlinear least squares solver fails when MINPACK succeeds

Submitted by:  Patrick Alken <psa>
Submitted on:  Sun 30 Jun 2013 08:56:15 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Operating System: Status: Fixed
Assigned to: Patrick Alken <psa>Open/Closed: Closed
Release: 

Thu 13 Feb 2014 06:13:13 PM UTC, comment #2:

Yes I've increased this limit to 100 and also fixed the update_diag routine to use the entire column of J for the scale factors, this should improve the robustness of lmsder

Patrick Alken <psa>
Project AdministratorIn charge of this item.
Thu 03 Oct 2013 08:04:03 PM UTC, comment #1:

The original Fortran program doesn't limit the number of iterations needed to achieve a solution but the GSL version returns 'no progress' if 10 or more iterations are needed. Increasing the iteration limit to 20 provides convergence on the example given:

=== GSL SOLUTION ===
S = 1.0018817 1.0024552 0.9994202
O = -14.2134727 2.3374475 6.3478359
A = 89.9459832 90.0165629 89.9379597

Is this an acceptance solution to this problem?

Brian Gladman <gladman>
Project Member
Sun 30 Jun 2013 08:56:15 AM UTC, original submission:

Although the GSL implementation of LM nonlinear least squares follows MINPACK, there are some cases when the GSL method won't converge but MINPACK does. I believe this is related to the 'xtol' convergence test in MINPACK's lmder routine which seems to be missing from the GSL implementation.

Attached is a test program and data which illustrate the problem.

Scaling the input data to be close to magnitude 1 allows GSL to find a solution. However MINPACK finds a solution whether or not the data is scaled.

Sample output:

--- USE_SCALE = 1 ---

> ./test_lm < input.dat

6979 data points read

GSL SOLUTION

S = 1.0018817 1.0024550 0.9994202
O = -14.2133707 2.3442451 6.3475414
A = 89.9459953 90.0165637 89.9379515

LEVMAR SOLUTION

S = 1.0018817 1.0024552 0.9994202
O = -14.2136590 2.3391624 6.3479131
A = 89.9459872 90.0165636 89.9379575

--- USE_SCALE = 0 ---

>./test_lm < input.dat

6979 data points read
compute_model: GSL error: s = 27

LEVMAR SOLUTION

S = 1.0018817 1.0024552 0.9994202
O = -14.2136530 2.3390507 6.3479175
A = 89.9459871 90.0165636 89.9379577

Patrick Alken <psa>
Project AdministratorIn charge of this item.

 

Attached Files
file #28452:  input.dat added by psa (526kB - application/x-ns-proxy-autoconfig)
file #28451:  test_lm.c added by psa (5kB - text/x-csrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gladman (Posted a comment)
  • -unavailable- added by psa (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 13 Feb 2014 06:13:13 PM UTCpsaStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Sun 30 Jun 2013 08:56:15 AM UTCpsaAttached File-=>Added test_lm.c, #28451
      Attached File-=>Added input.dat, #28452

    Back to the top


    Powered by Savane 3.1-cleanup