5: Interpolation
Consider the following problem: Given the values of a known function \(y=f(x)\) at a sequence of ordered points \(x_{0}, x_{1}, \ldots, x_{n}\) , find \(f(x)\) for arbitrary \(x .\) When \(x_{0} \leq\) \(x \leq x_{n}\) , the problem is called interpolation. When \(x<x_{0}\) or \(x>x_{n}\) the problem is called extrapolation.
With \(y_{i}=f\left(x_{i}\right)\) , the problem of interpolation is basically one of drawing a smooth curve through the known points \(\left(x_{0}, y_{0}\right),\left(x_{1}, y_{1}\right), \ldots,\left(x_{n}, y_{n}\right)\) . This is not the same problem as drawing a smooth curve that approximates a set of data points that have experimental error. This latter problem is called least-squares approximation.
Here, we will consider three interpolation algorithms: (1) polynomial interpolation; (2) piecewise linear interpolation, and; (3) cubic spline interpolation.
-
- 5.2: Piecewise Linear Interpolation
- Instead of constructing a single global polynomial that goes through all the points, one can construct local polynomials that are then connected together. In the the section following this one, we will discuss how this may be done using cubic polynomials. Here, we discuss the simpler case of linear polynomials. This is the default interpolation typically used when plotting data.