# Why do people fit polynomials?

Could someone explain the justification and limits of fitting polynomials to arbitrary data points? I mean what about square roots or fractional or inverse powers? Most of the time some wants to improve a linear fit, they rather include quadric terms than anything else.

Can you think of a mathematical justification why plain powers are favoured? I assume it might be related to function approximation Taylor series.

Suppose I wanted to include fractional powers, would it rather make sense to include $x^a$ or $x^{0.5}+a\cdot x^{1.5}$ for "common real world data".

Or do rational polynomials do better and I'd rather try these first?

Maybe someone can elaborate the power of these method to approximate an unknown function in data.

-

Polynominals are smooth on whole $\mathbb R$, but $\sqrt{x} = x^{\frac 1 2}$ isn't differentiable at 0 for example. – Stefan Nov 17 '12 at 17:56
Ease of manipulation, smoothness(?). Further, almost everything can be written out as polynomials using Taylor Expansion. – Inquest Nov 17 '12 at 17:56
@Inquest: Not everything, so the question is why is the "almost" part more relevant for the "real world". – Gerenuk Nov 17 '12 at 18:04
@Stefan: Can this be translated into an argument why differentiability at zero is important for real world data? I suppose that is because real world shouldnt have infinite slopes? – Gerenuk Nov 17 '12 at 18:06
Well, Taylor approximation is such a good tool, and for it to work you need your function to be smooth, if you can't differentiate at a point, you can approximate. And of course infinite slopes don't make sense in real world application. – Stefan Nov 17 '12 at 18:13
show 5 more comments

## 2 Answers

There are lots of theoretical results telling us that approximation by polynomials works well for various classes of functions, and even telling us what the maximum approximation error will be. For example, there's the Stone-Weiertrass theorem mentioned in the other answer, plus the "Jackson" theorems and many others in constructive approximation: http://en.wikipedia.org/wiki/Constructive_function_theory

There are fast reliable easy-to-implement algorithms for computing the approximations. For some good examples, look at the Chebfun system, which basically does everything by computing high-degree polynomial approximations: http://www2.maths.ox.ac.uk/chebfun/

Once you have a polynomial, it's relatively easy (and inexpensive) to calculate function values, derivatives, integrals, zeros, bounds, and so on. Again, see Chebfun for examples.

In some fields (like computer-aided design), polynomial forms are considered "standard", and using anything else causes data exchange problems.

Rational approximations will sometimes work better than polynomial ones (in the sense that you get a smaller error with no increase in the degrees of freedom of the approximant). But optimal rational approximations are much harder to compute, and, once you have them, they are more difficult to handle (harder to integrate, for example).

Polynomial approximation is not always the best choice (nothing is), but it's often a pretty good one, and it's a reasonable thing to try unless the nature of your specific problem suggests something different.

-

The square root itself is approximated with polynomial functions see here (for example for computations), so polynomials are here a bit more 'fundamental'.

By the Stone–Weierstrass theorem every continuous function defined on a closed interval [a,b] can be uniformly approximated as closely as desired by a polynomial function.

For numerical quadrature the definite integral of polynomials is exact, so if you approximate your function with polynomials the only step where approximation errors happens is the polynomial approximation...

However, polynomials are not the only suitable basis for approximating continuous functions. For example $\sin(nx)$ and $\cos(nx)$ are very popular. Additionally if your functions are continuous but maybe have values that are not differentiable then in fact wavelets are a more modern alternative...

EDIT: as to fitting points... no, polynomials are not usually the top choice. For points the function to be fitted depends very much on your problem domain. For example if the points represent populations growth then usually exponential functions are fitted. Also it matters how many dimensions your data has. High dimension point fitting problems (or clustering or seperating the points etc) go more in the direction of machine learning than approximation...

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 6, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9220218658447266, "perplexity_flag": "middle"}