Polint routine used with 200 data points
rchen9
04-19-2002, 03:02 PM
As I was using the polynomial interpolation routine polint(), it seemed to work fine with under 20 data point. But when I have 200 data points, the returned result would be a non-number. Is this a known fact?
Robin
Bill Press
04-19-2002, 03:26 PM
Yes! This is not a problem with the program but with the very idea of interpolating a polynomial of order 200. Such a polynomial is wildly unstable!
You should never use polynomial interpolation with a degree of more than, say, 10. Usually degree 4 or 5 is a useful maximum. If you have more data points than this, you should do piecewise interpolation using only a few neighboring points on both sides of each interval. Read the last paragraph in Section 3.1 of the book, as well as the subsection at the end of Section 3.4.
Of course you will eventually have to worry about continuity of the interpolated function or its derivatives at the joins, and that will quickly lead you to spline interpolation. Without knowing the details, my guess is that you would be better off using cubic spline interpolation on your data set of 200 points, so you should just forget about polynomial interpolation.
Good luck!
rchen9
04-19-2002, 04:36 PM
Thank you, Bill. That clarifies things. I was wondering about that too. When I had a 6 data point sample, the program worked fine. I'm going to give the Bicubic Spline a try.
Robin