3 ms·
>This blog post’s statement that “higher degree polynomials can have problems with numerical accuracy” turns out to be a myth (author here) I should have quali
by jason_s 11y ago
>This blog post’s statement that “higher degree polynomials can have problems with numerical accuracy” turns out to be a myth
(author here) I should have qualified or corrected that statement in my article. There are a few reasons I rarely use n>5:
- when polynomial approximation is appropriate, high-degree polynomials are usually unnecessary on embedded systems (0.1% accuracy usually sufficient)
- it's usually a sign that polynomial approximation is being misapplied and there are better ways (via range reduction, transformation like 1/f(x), etc.)
- with least-squares, computation of the coefficients can have problems with numerical accuracy. When I've used least-squares fitting polynomials with n>10, I often get a complaint from my numerical tool (MATLAB or Python) that the matrix in question is ill-conditioned. That may be because I used the Vandermonde matrix rather than Chebyshev polynomials, or because I used a large number of points. Chebyshev approximation doesn't have the same problem, I don't think, and I should not have mapped my experience with least-squares fitting onto Chebyshev approximation.
Evaluation of the polynomials themselves should be fine (after all, we can easily compute a 20th-degree Chebyshev polynomial).
- jacobolus 11y agoFor fitting arbitrary spaced data, you might also try using a rational interpolant, e.g. Floater & Hormann’s http://www.inf.usi.ch/hormann/papers/Floater.2007.BRI.pdf http://www.inf.usi.ch/hormann/papers/Floater.2007.BRI.pdf and then afterward approximating that by a Chebyshev polynomial of somewhat higher degree for evaluation or other operations like taking derivatives or finding roots etc. (IIRC Trefethen’s book explains this idea, and the last few links in my comment above are also related).
- srean 11y agoHigh order monomials and uniform grids are a bad mix. If you have the flexibility of choosing the grid many of the problems of higher order poly can be overcome. But as you said using very high orders should indeed set off alarm bells in the worst case and warrant good justification in the best case