|
From: | Brian Gough |
Subject: | Re: [Help-gsl] polynomial fitting using nonlinear least-squares fitting |
Date: | Fri, 08 Dec 2006 10:56:59 +0000 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; 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 least-squares 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 least-squares for this (the function is linear in the coefficients c which is what matters). There is a quadratic example in the linear least-squares chapter of the manual.
-- Brian Gough (GSL Maintainer) Network Theory Ltd, Publishing the GSL Manual - http://www.network-theory.co.uk/gsl/manual/
[Prev in Thread] | Current Thread | [Next in Thread] |