Spline Interpolation
Spline interpolation is a method of Interpolation that connects data points with piece-wise polynomial functions, rather than using a single high-degree polynomial.
Motivation
High-degree polynomial interpolation (like Lagrange Interpolation) suffers from:
- Runge phenomenon: Wild oscillations between data points
- Numerical instability: Small changes in data cause large changes in polynomial
- Poor edge behaviour: Especially with equispaced points
Splines solve these problems by using many low-degree polynomials joined together smoothly.
Definition
A spline of degree is a piece-wise polynomial function where:
- Each piece is a polynomial of degree at most
- The pieces join together smoothly at knots (data points)
- Continuity conditions are satisfied at knots
Common Spline Types
Linear Splines
The simplest splines are linear splines, which connect consecutive points with straight line segments.
- Degree: 1 (linear)
- Continuity: (continuous, but not differentiable at knots)
- Identical to: Piecewise Linear Interpolation
Example: Excel’s straight-line plot uses linear splines.
Quadratic Splines
Quadratic splines use parabolic segments:
- Degree: 2
- Continuity: Typically (continuous first derivative)
Cubic Splines
Cubic splines are the most commonly used:
- Degree: 3
- Continuity: (continuous second derivative)
- Properties: Smooth appearance, minimum curvature
Example: Excel uses cubic splines for smooth curve plots.
Cubic Spline Construction
For data points, we need cubic polynomials for intervals :
Conditions
To determine the coefficients, we need equations:
-
Interpolation ( equations):
- for
- for
-
First derivative continuity ( equations):
- for
-
Second derivative continuity ( equations):
- for
-
Boundary conditions (2 equations):
- Various choices possible (see below)
Total: equations ✓
Boundary Conditions
The two remaining degrees of freedom are specified by boundary conditions:
Natural Spline
Zero curvature at endpoints (most common).
Clamped Spline
Specified derivatives at endpoints (when known).
Not-a-Knot
Third derivative continuous at second and penultimate points.
Properties of Cubic Splines
- Minimal curvature: Natural cubic splines minimize
- Smooth appearance: continuity ensures visually smooth curves
- Local control: Changing one data point affects only nearby segments
- Stability: No wild oscillations like high-degree polynomials
- Optimal approximation: Best piece-wise cubic approximation in certain norms
Advantages
- No oscillations: Avoids Runge phenomenon
- Local behaviour: Changes in data have local effects
- Smooth: continuity for cubic splines
- Efficient: Low computational cost
- Stable: Numerically stable
Limitations
- Not truly global: Not a single polynomial
- Computational setup: Requires solving a linear system
- Boundary sensitivity: Results depend on boundary condition choice
- Derivative jumps: Lower-order splines have derivative discontinuities
Construction Algorithm (Cubic)
-
Compute second derivatives by solving a tridiagonal system
-
Use values to determine spline coefficients: