1
$\begingroup$

I was given 20 data points and asked to choose the most suitable lowest degree polynomial to fit them using the least-squares criterion.

I looked it up, but what i found seems far too complex or just confuses me. Can i have the general steps to solve a question of this nature, or have an example with a much smaller data set?

  • 0
    Thanks, i will give it a try.2012-11-16

1 Answers 1

1

The MathWorld article is fairly easy to understand, I think: http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html. Its shows the essential parts of the process: at a minimum, some partial derivatives are zero, and this leads to a set of linear equations that you can solve.

But, before you get started, you have to decide what degree to use. The heuristic approach is to just plot the data, stare at it, and try to decide whether its shape seems to be linear (degree 1), or parabolic (degree 2), or something more complex. If the data has $n$ turning points, then you should start with a polynomial of degree $n+1$.

A more rigorous approach is to decide what maximum error you are willing to accept. Then, just keep increasing the degree until this error is achieved. This iteration will always work -- as Will Jagy said, by the time you get to degree = 19, the error will be zero (but zero error is probably not what you want).