We will eventually learn how to find this function value (which is called the cumulative density function for the normal distribution) using a technique called quadrature, but we would like to be able to approximate a function based on some given values.
Given a set of points \((x_{i}, f_{i})\) for \(i=0,1,2, \ldots, n\text{,}\) where the \(x_{i}\) are distinct and \(f_{i}\) are the corresponding function values (perhaps either given or \(f_{i}=f(x_{i})\) for some \(f\)), we wish to find:
Or find a function \(g\) such that \(g(x_{i})=f_{i}\) and for other \(x\) values, \(g\) is “reasonable” between the points. Typically “reasonable” needs to be defined clearly.
First, a bit about terminology. You probably have heard the word regression used in terms of data fitting. For example, linear regression for the data given above may seek to find the line that best fits the data above in the table.
In the case of finding the values of the cumulative density function above, this is not desirable. Instead, interpolation finds a function \(g\) that passes through the given points and approximates (hopefully in a smooth manner) between the points.
There are many reasons for using polynomials. From a computational point of view, a polynomial can be evaluated only with four basic operations (\(+,-,\times,\div{}\)) that are easily done in computers. Except for Rational Functions (which are usually the second encountered class of interpolated functions), all other functions require some kind of approximation to find function values. In addition, polynomials can be evaluated efficiently. See Subsection 2.3.3 for more details.
Finally (and probably the most-important) is that polynomial can always be used to approximate any other function. This is stated more precisely in the following theorem:
Suppose that \(f\) is defined and continuous on \([a,b]\text{.}\) For each \(\epsilon \gt 0\text{,}\) there exists a polynomial \(P(x)\) with the property that
The proof of this theorem is rather complicated so will not be presented here, however this is a crucial theorem and can be found in functional analysis texts such as rudin1991. In short, any continuous function can be approximated (to within any value) with a polynomial. This is an important reason for using polynomial in both interpolation and approximation.
One way to handle this problem is to write a general quadratic function: \(P(x)=a_{0} + a_{1} x + a_{2} x^{2}\) and note that the polynomial must satisfy the data. \(P(0)=0, P(1)=1, P(3)=2\text{.}\) Then write down the function values for each of the three points:
This is a linear system that can be solve using Gaussian Elimination (or a CAS can solve it directly) as \(a_{0}=0, a_{1} = 7/6, a_{2} = -1/6\text{.}\) Thus the polynomial that interpolates the given set of points is: