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/


_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl

Reply via email to