bugGNU Scientific Library - Bugs: bug #26871, inconsistent error detection in...


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

bug #26871: inconsistent error detection in non-linear fitting

Submitter:  Mateus Araújo Santos <masantos>
Submitted:  Mon 22 Jun 2009 09:09:26 PM UTC
Category:  Runtime error Severity:  3 - Normal
Operating System:  debian squeeze Status:  Fixed
Assigned to:  None Open/Closed:  Closed
Release:  1.12

Wed 24 Jun 2009 04:32:28 PM UTC, comment #1: 

Thanks for the bug report.  I will add the error code check in lmset.c.

For Nelder Mead, the recommended procedure would be to set a GSL error handler with gsl_set_error_handler() to override the default call to abort().  If you're calling GSL from a gui application that would be a good thing to do globally anyway.

-Deleted Account- <bjg>
Mon 22 Jun 2009 09:09:26 PM UTC, original submission:  


In fixing a bug with QtiPlot, I found myself in the need of asking gsl to abort the fitting process if an error occurred. Unfortunately, the error detection is not uniformly handled, and could be made to work satisfactorily in only one case, in the iterations of the Levenberg-Masquardt algorithm.

To be specific, the function set() in lmset.c does not check for error status in the evaluation of the points.

the line


should be

  int status = GSL_MULTIFIT_FN_EVAL_F_DF (fdf, x_trial, J);
  if (status)
    return status;

as it's done correctly in the function iterate in lmiterate.c

as for the Nelder-Mead simplex, there's no way (that I could find ;) of passing an error status from the iterator to GSL. the function call is something like

val = GSL_MULTIMIN_FN_EVAL (f, x);
if (!gsl_finite(val))
... error ...

in both nmsimplex_iterate() and nmsimplex_set(), so the only way I figured to signalize an error is to pass an inf to val, so that the process will abort. Unfortunately, this crashes QtiPlot. There should be a way to pass a gsl status (in my case, GSL_ESING), as it's done in the Levenberg-Marquardt case.

Best regards,


Mateus Araújo Santos <masantos>


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

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by masantos (Submitted the item)



    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-07-09 bjg StatusConfirmed Fixed
    2009-06-24 bjg StatusNone Confirmed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.9