This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Nonlinear Least Squares Fitting
- From: Brian Gough <bjg at network-theory dot co dot uk>
- To: Andreas Gros <agros at rz dot uni-osnabrueck dot de>
- Cc: gsl-discuss at sources dot redhat dot com
- Date: Tue, 20 Nov 2001 09:26:51 +0000 (GMT)
- Subject: Re: Nonlinear Least Squares Fitting
- References: <200111200858.fAK8w4f10486@omecihuatl.rz.uni-osnabrueck.de>
Andreas Gros writes:
> In the section "Providing the function to be minimized" where the
> function gsl_multifit_function_fdf is described, you mention the
> function f that should store the distance between the values
> calculated by the algorithm and the provided values. As I tested
> the algorithm I've found, that this distance is not taken as a
> "square", instead the algebraic sign of the distance seems to be of
> some importance. My results were quite different, whenever I took
> (y[i]-Yi) instead of (Yi-y[i]) (as it is shown in the example).
> Taking the latter the solver works fine, taking the first distance
> the results have been quite funny.
Hi,
The sign of the jacobian needs to match the sign of the function.
If you change one you need to change the other.
I think this will fix your problem.
regards
Brian