Interpolation: Introduction
Given \(n+1\) data points \((x_i,y_i)\), find a function \(f\) such that \(f(x_i) = y_i\) for \(i = 0, 1, \dots, n\):
Given \(n+1\) data points \((x_i,y_i)\), find a function \(f\) such that
\[f(x_i) = y_i \text{ for } i = 0, 1, \dots, n\]
What kind of function?
Question: Does such function even exist?
Question: How do we find it?
Definition: A real vector space is a non-empty set \(V\) together with an operation \({}+{}\colon V\times V \to V\) (addition) and a function from \(\mathbb{R}\times V\) to \(V\) (scalar multiple) denoted using superposition: \(a\mathbf{v}\), with the following properties:
\(V\) is closed under addition.
\(V\) is closed under scalar multiple.
Associativity of addition.
Commutativity of addition.
Additive identity.
Additive inverse.
Compatibility of scalar multiplication with multiplication of real numbers.
Scalar identity.
Distributing over vector addition.
Distributing over scalar addition.
Given \(n + 1\) data points \((x_i,y_i)\), \(i = 0, 1, \dots, n\), find a function \(f\) that belongs to an \(n+1\)-dimensional vector space \(V\) with bases \[\left\{\phi_0, \phi_1, \dots, \phi_n\right\}\] such that \[f(x_i) = y_i \text{ for } i = 0, 1, \dots, n.\]
We know that \(f\) can be written as a linear combination of \(\phi_0, \phi_1, \dots, \phi_n\):
\[f(x) = \sum_{k = 0}^n a_k\phi_k(x).\]
\[f(x_i) = \sum_{k = 0}^n a_k\phi_k(x_i) = y_i \text{ for } i = 0, 1, \dots, n.\]
\[\sum_{k = 0}^n a_k\class{emph}{\phi_k(x_i)} = \class{emph}{y_i} \text{ for } i = 0, 1, \dots, n.\]
Matrix form:
\[ \class{emph}{\begin{bmatrix} \phi_0(x_0) & \phi_1(x_0) & \phi_2(x_0) & \cdots & \phi_n(x_0)\\ \phi_0(x_1) & \phi_1(x_1) & \phi_2(x_1) & \cdots & \phi_n(x_1)\\ \phi_0(x_2) & \phi_1(x_2) & \phi_2(x_2) & \cdots & \phi_n(x_2)\\ \vdots & \vdots & \vdots & \ddots & \vdots \\ \phi_0(x_n) & \phi_1(x_n) & \phi_2(x_n) & \cdots & \phi_n(x_n)\\ \end{bmatrix}} \begin{bmatrix} a_0\\a_1\\a_2\\\vdots\\a_n \end{bmatrix} = \class{emph}{\begin{bmatrix} y_0\\y_1\\y_2\\\vdots\\y_n \end{bmatrix}} \]
If the matrix is non-singular, there is a unique solution.
It would be good if this system was also easy to solve.
Theorem: If points \(x_0, x_1, \dots, x_n\) are distinct, then for any real values \(y_0, y_i, \dots, y_n\) there is a unique polynomial \(p\) of degree at most \(n\) such that \(p(x_i) = y_i\) for \(i = 0, 1, \dots, n\).
The matrix
\[ \begin{bmatrix} \phi_0(x_0) & \phi_1(x_0) & \phi_2(x_0) & \cdots & \phi_n(x_0)\\ \phi_0(x_1) & \phi_1(x_1) & \phi_2(x_1) & \cdots & \phi_n(x_1)\\ \phi_0(x_2) & \phi_1(x_2) & \phi_2(x_2) & \cdots & \phi_n(x_2)\\ \vdots & \vdots & \vdots & \ddots & \vdots \\ \phi_0(x_n) & \phi_1(x_n) & \phi_2(x_n) & \cdots & \phi_n(x_n)\\ \end{bmatrix} \]
is non-singular
\[B = \{1, x, x^2, \dots, x^n\}\]
in other words, \(\phi_k(x) = x^k\) for \(k = 0, 1, \dots, n\).
Example:
Find a polynomial \(p\) of degree 2 such that \(p(-1) = 11\), \(p(1) = -1\), and \(p(2) = 2\).