1
$\begingroup$

I was wondering how I could fit a polynomial surface through a set of points in two variables. When I look up this problem in the literature, I usually see two options:

  • Use a tensor product, but this only seems to work in the case the points are evaluated in a grid
  • Use some special point layouts, like Padua or Chebyshev points.

Neither options seems feasible for pseudo-random point sets. Does anyone have an idea? (I guess I could use the standard Lagrange formula in two variables, but that doesn't seem like a numerically stable solution.)

  • 0
    A surface; sorry.2011-11-06

1 Answers 1

2

You can do a multidimensional function minimization. Write your polynomial as $\sum a_{ij}x^iy^j$ over whatever range of $i,j$ you like (hope you have less terms than data points). Then calculate the polynomial at each point, square the errors and sum. Feed it to a minimizer taking the $a_{ij}$ as the parameters and minimize. Sections 10.4 through 10.7 of Numerical Recipes deal with this, as will any numerical analysis text.

  • 1
    @Howard: it will not. In theory, if you have as many polynomials as points, it should be able to fit them e$x$actly (within numerical error). Usually the point of least squares is to smooth the data and you don't want it hitting the points e$x$actly. If you want the polynomials to fit e$x$actly, you need as many as you have data points and then you have a simultaneous equations problem.2011-11-06