Required polynomial order for 2D least square function fit

1.3k Views Asked by At

I am working with a point cloud of approximately 500 points which has the form $p = f(x,y)$ and I need to find a function $\hat{f}$ that will correctly approximate $f$ on all of its domain. To do so, I impose $\hat{f}$ to be a $n^{th}$ order 2D polynomial, for example:

$\hat{f}_{n=3}(x,y) = a_0 + a_1x + a_2y + a_3xy + a_4x^2 + a_5y^2 + a_6x^3 + a_7x^2y + a_8y^3 + a_9xy^2$

I can obtain a solution for the coefficients with a linear least square fit. By trial and error, I have found that a fourth order polynomial is required to lower the RMS error below a given value. However, previous experiences showed that a third order polynomial should be sufficient.

My main question is whether or not there is a way to find or estimate the required polynomial order? Are there any indicators that would show me that four orders are necessary, and if so in which dimension?

Secondly, is it possible to know if the least square fit does a good job for finding the coefficients? If I'm not mistaken, orthogonal decomposition methods should be better at this, but in my case solving the least square problem with a direct inversion of the normal equations or with a QR decomposition give the same results.

I don't have much knowledge about the subject other than what can be found here, but I would be pleased if you could point me in the right direction.