
From:  Brian Gough 
Subject:  Re: [Helpgsl] polynomial fitting using nonlinear leastsquares fitting 
Date:  Fri, 08 Dec 2006 10:56:59 +0000 
Useragent:  Mozilla/5.0 (X11; U; Linux i686; enUS; rv:1.8.0.6) Gecko/20060815 SeaMonkey/1.0.4 
Lucas Grijander wrote:
Hi all!I have to model some 3D data by using multidimensional polynomials. I'm trying to use the nonlinear leastsquares fitting functions from GSL. I'm not sure if it is the best option, but I'm having problemes of convergence. The polynomial function should be like this:Z = f(X,Y) Z = c0 + c1X + c2Y + c3X2 + c4Y2 + .....How should I define the function to minimize in the code? the order of the polynomial is defined by the user, and it can be different for X and Y.
Hello,You can use the linear leastsquares for this (the function is linear in the coefficients c which is what matters). There is a quadratic example in the linear leastsquares chapter of the manual.
 Brian Gough (GSL Maintainer) Network Theory Ltd, Publishing the GSL Manual  http://www.networktheory.co.uk/gsl/manual/
[Prev in Thread]  Current Thread  [Next in Thread] 