# I Fitting points z = f(x,y) to a quadratic surface

#### maistral

Hi! I am aware that standard fitting numerical methods like Levenberg-Marquardt, Gauss-Newton, among others, are able to fit a dataset z = f(x,y) to a quadratic surface of the form z = Ax2 + Bxy + Cy2 + Dx + Ey + F, where A to F are the coefficients.

Is there a simpler method that exists? I'm trying to find something similar to fitting the same z = f(x,y) dataset to a linear plane z = A + Bx + Cy where it only involves solving matrices.

Related Set Theory, Logic, Probability, Statistics News on Phys.org

Mentor
2018 Award

#### maistral

Actually I am looking for the method where I can fit the second-degree surface polynomial z= f(x,y) to datasets similar to the Vandermonde matrix method for fitting a simple y = f(x) polynomial.

The reference stated the Gauss-Newton algorithm, which I am trying to evade using. Is there such a method that can fit quadratic surfaces without the need for iterative algorithms?

#### fresh_42

Mentor
2018 Award
You want to fit something curved into something linear, so you first have to find a measure for what is a good fit for you and what is not. The least squared distances come to mind, but which measure you chose, you will have to perform an optimization, and algorithms for this are of course iterative. An algorithm is by nature. What you are looking for is a one step formula. Let us assume for a moment that we have such a formula. How can we determine, whether our approximation is a good one or not? And if not, how can we proceed to a better one? Et voilà: the recursive algorithm is born.

If your data are concentrated at a certain point, then you could perhaps chose the tangent plane of your surface. But this depends on what is "close to a point".

"Fitting points z = f(x,y) to a quadratic surface"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving