# Surface Function Fitting to Spherical Data

I have a set of geographic (longitude,latitude,value) data to which I would like to fit surface functions, specifically, the set of quadratic surfaces:

$f(x,y)=Ax^2+Bx^2+Cxy+Dx+Ey+F$

At the moment, I am converting the spherical (or rather, WGS84 geodesic) data to planar data using the Lambert Conformal Conic projection. I then fit my surface functions to the planar data, do whatever other calculations I need, and then invert the projection.

But the planar projection incorporates distortions into the data, and thus the fitting process. It would be nice if it were possible to fit the quadratic surface around the sphere/ellipsoid, but I'm not sure how to go about doing this.

Any thoughts?

-
The form you have will have you fitting paraboloids to your data; what you need is an equation with terms like $z^2$, $yz$, and $xz$... – J. M. Aug 11 '11 at 19:15
How big is the region you are fitting data over? You may want to look into using spherical harmonics as a basis instead of quadratic polynomials. – Rahul Aug 11 '11 at 19:46
@Rahul, I'll be finding the intersections of these surfaces later using the Levinberg-Marquadt algorithm - I'm not sure if that would be possible with spherical harmonics, but I'll look into it. – Richard Aug 11 '11 at 21:03
@J.M., I'm afraid I don't understand your comment. Since the variables A-F are free to range over all values, including zero, I'd assume my fitting routine is choosing from a variety of possible quadratic surfaces. Paraboloids are just one possibility. – Richard Aug 11 '11 at 21:04
$z=Ax^2+Bx^2+Cxy+Dx+Ey+F$ implies that you have ellipses/hyperbolas as your $x-y$ slices, and parabolas as your $x-z$ and $y-z$ slices. To get for instance an ellipsoid, you need your $z$ to be in a quadratic term like $z^2$ or $yz$. LM works with any nonlinear regression problem. – J. M. Aug 11 '11 at 21:09