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

 
 

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

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

Submitter:  Patrick Alken <psa>
Submitted:  Sun 30 Jun 2013 08:56:15 AM UTC
   
 
Category:  None Severity:  3 - Normal
Operating System:  Status:  Fixed
Assigned to:  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>
Group administrator
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>
Group 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>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-13 psa StatusNone Fixed
        Open/ClosedOpen Closed
    2013-06-30 psa Attached File- Added test_lm.c, #28451
        Attached File- Added input.dat, #28452

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code