help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] Multifit and GSL_CONTINUE


From: Zach
Subject: [Help-gsl] Multifit and GSL_CONTINUE
Date: Mon, 7 Dec 2009 15:48:38 -0700

I see that someone seems to have asked this questions a while ago, but it
seems to be misunderstood.  I did not find any resolution.

http://www.mail-archive.com/address@hidden/msg00025.html

Basically, gsl_multifit_fdfsolver_iterate (when used with Levensburg
Marquardt algorithm) sometimes returns GSL_CONTINUE.  This has the
interesting result of providing a GSL_SUCCESS on gsl_multifit_test_delta,
since the iteration failed to do anything.  (note: Turns out this looks more
like an issue with lmder_iterate and lmsder_iterate).

Looking at the source seems to suggest that this means that some criteria in
was not met within 10 iterations.  The LM and LMS procedures appear to have
an internal maximum iteration count of 10 iterations and then fail with a
GSL_CONTINUE return at the end of the function (see multifit/lmiterate.c).
This return is then passed on to users code instead of acted on in
lmder_iterate and lmsder_iterate.

Since it is returning GSL_CONTINUE, is there a way to ask it to continue?
If not, then it should be returning some other code, preferably one that
indicates failure, correct?  In the example program, it would explicitly
break out of the user iteration loop upon a GSL_CONTINUE return from
gsl_multifit_fdfsolver_iterate.  Or, is it perhaps the case that the return
value of gsl_multifit_fdfsolver_iterate should not be interpreted as a enum
type found in err/gsl_err.h, despite the source seeming to use that
definition?

Maybe the source should look something more like:

static int
lmder_iterate (void *vstate, gsl_multifit_function_fdf * fdf, gsl_vector *
x, gsl_vector * f, gsl_matrix * J, gsl_vector * dx)
{
  int status = iterate (vstate, fdf, x, f, J, dx, 0);
  /* For now treat GSL_CONTINUE as GSL_FAILURE.  Maybe later we can try to
continue */
  return ((GSL_CONTINUE==status)?GSL_FAILURE:status);
}


Thanks for any info,
Zach


P.S.  I want to make it clear, I am talking about the return value of
gsl_multifit_fdfsolver_iterate, which I expect on success to be
GSL_SUCCESS.  I am not talking about gsl_multifit_test_delta which is the
source of the confusion in the above link.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]