1. The Interpolation Problem
Slides 4-10Given a set of data points $(t_1, y_1), (t_2, y_2), \dots, (t_n, y_n)$, find a function $y=f(t)$ such that:
Interpolation đ¯
Passing exactly through every data point. Used when data is precise (e.g., table values).
Approximation (Fitting) đ
Getting "close" to points. Used when data is noisy (e.g., experimental measurements).
2. Monomial Basis
Slides 11-18The most natural way to find a polynomial $p(t)$ of degree $n-1$ that passes through $n$ points is to write it as a linear combination of powers of $t$ (monomials):
We want to find coefficients $x_1, \dots, x_n$ such that the polynomial matches our data points $(t_i, y_i)$:
This system of linear equations can be written in matrix form $A \mathbf{x} = \mathbf{y}$, where $A$ is the Vandermonde Matrix:
Algorithm & Implementation
2.1 The Problem: Ill-Conditioning
Slides 11-18 (Cont.)The basis functions $t^k$ look very similar as $k$ increases.
2.2 Deriving Lagrange đ§
Motivation3. Lagrange Interpolation
Slides 19-24Instead of solving a linear system, we can write the polynomial directly:
3.1 Interactive Lagrange đšī¸
Playground3.2 SciPy Implementation
Slides 19-24 (Cont.)SciPy Implementation
4. Newton Interpolation
Slides 25-30Uses Divided Differences to build the polynomial incrementally.
Benefit: Adding a new data point is cheap ($O(n)$) compared to Lagrange or Monomial ($O(n^2)$ or $O(n^3)$).
4.1 Interactive Newton đšī¸
Playground5. Splines & The Wiggle
Slides 41+Runge's Phenomenon ã°ī¸
High-degree polynomials oscillate wildly near the edges.
5.1 B-Splines (Basis Splines)
Slides 41+ (Cont.)Local basis functions ("hat functions") prevent global oscillation.