public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
From: tlb@tlb.org
To: gsl-discuss@sources.redhat.com
Subject: multifit_nlin on linear data
Date: Fri, 12 Jul 2002 13:24:00 -0000	[thread overview]
Message-ID: <200207122024.g6CKODl4055949@tlb.blackwells.net> (raw)


I have a multiparameter fitting problem which is nonlinear in general,
but has linear behavior in some regions where I can exactly calculate
the derivatives. So sometimes when I use gsl_multifit_fdfsolver it's
able to jump to the correct solution in a single jump, as you'd expect
it to.

But, when this happens, the second iteration of
gsl_multifit_fdfsolver_iterate returns GSL_ETOLF, because after the
first step it can neither predict nor achieve any further reduction.
To paraphrase the code in gtl/multifit/lmiterate.c

  prered is predicted reduction from step*jacobians [0]
  actred is result of taking that step [also 0]
 
  if (prered > 0)
      ratio = actred / prered;
  else
      ratio = 0;

  ...

  if (ratio >= 0.0001) {
     ... update answer ...

  else if (fabs(actred) <= GSL_DBL_EPSILON  && 
           prered <= GSL_DBL_EPSILON && 
           p5 * ratio <= 1.0) {
    return GSL_ETOLF;

Does this need rethinking, or does my problem need re-posing? My
function has regions of linearity and nonlinearity and it's hard for
me to know in advance if it's going to admit a single-step solution or
not, so it's not easy to just switch to a linear multifit algorithm
instead.

Should I be using a different termination critereon than
gsl_multifit_test_delta?

One workaround is to set the elements of the Jacobian matrix to 0.99 *
the actual derivative; it then converges nicely in 2-3 steps. 

Or, I could just accept ETOLF as an indication of being done.

--
Trevor Blackwell         tlb@tlb.org          (650) 776-7870

             reply	other threads:[~2002-07-12 20:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-12 13:24 tlb [this message]
2002-07-14 14:05 ` Brian Gough

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200207122024.g6CKODl4055949@tlb.blackwells.net \
    --to=tlb@tlb.org \
    --cc=gsl-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).