From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brian Gough To: Andreas Gros Cc: gsl-discuss@sources.redhat.com Subject: Re: Nonlinear Least Squares Fitting Date: Wed, 19 Dec 2001 13:20:00 -0000 Message-id: <15354.8667.540079.973847@debian> References: <200111200858.fAK8w4f10486@omecihuatl.rz.uni-osnabrueck.de> X-SW-Source: 2001/msg00720.html 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10666 invoked by alias); 20 Nov 2001 10:00:50 -0000 Mailing-List: contact gsl-discuss-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sources.redhat.com Received: (qmail 10635 invoked from network); 20 Nov 2001 10:00:46 -0000 Received: from unknown (HELO cmailg6.svr.pol.co.uk) (195.92.195.176) by sourceware.cygnus.com with SMTP; 20 Nov 2001 10:00:46 -0000 Received: from modem-150.flame-angel.dialup.pol.co.uk ([62.137.13.150] helo=debian) by cmailg6.svr.pol.co.uk with esmtp (Exim 3.13 #0) id 1667hh-0007CL-00; Tue, 20 Nov 2001 10:00:34 +0000 Received: from bjg by debian with local (Exim 2.05 #1 (Debian)) id 1667B6-0000A4-00; Tue, 20 Nov 2001 09:26:52 +0000 From: Brian Gough MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15354.8667.540079.973847@debian> Date: Fri, 16 Nov 2001 14:39:00 -0000 To: Andreas Gros Cc: gsl-discuss@sources.redhat.com Subject: Re: Nonlinear Least Squares Fitting In-Reply-To: <200111200858.fAK8w4f10486@omecihuatl.rz.uni-osnabrueck.de> References: <200111200858.fAK8w4f10486@omecihuatl.rz.uni-osnabrueck.de> X-Mailer: VM 6.62 under Emacs 19.34.1 X-SW-Source: 2001-q4/txt/msg00044.txt.bz2 Message-ID: <20011116143900.Z9Ec_HoP47BK7nhz99e1Ih28ZAjEXNgLOvp2ArJhzFE@z> 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