Fitting a Polynomial to Data

Polynomials are often used for interpolation because they are easy to evaluate and easy to manipulate analytically.

Table 7.1: Fitting a polynomial to data.

x f(x)
3.2 22.0
2.7 17.8
1.0 14.2
4.8 38.3
5.6 51.7
  • Suppose that we have a data set.
  • First, we need to select the points that determine our polynomial.
  • The maximum degree of the polynomial is always one less than the number of points.
  • Suppose we choose the first four points. If the cubic is $\boxed{ax^3 + bx^2 + cx + d}$,

Figure 7.1: Polynomial Interpolation.
Image 13-4
Image interpolation

Table 7.2: Interpolation of gasoline prices.
year price
1986 133.5
1988 132.2
1990 138.7
1992 141.5
1994 137.6
1996 144.2
  • Another example;
  • Use the polynomial order 5, why?

    $\displaystyle P=a_1+a_2y+a_3y^2+a_4y^3+a_5y^4+a_6y^5
$

  • Make a guess about the prices of gasoline at year of 1991 (2011).

Figure 7.2: Polynomial Interpolation - Gasoline Case.
Image 13-5
Image gasoline