Interpolation Error
students, when a curve is built from data points, the big question is not just can we connect the dots? but how close is that curve to the real function? 📈 In numerical analysis, that difference is called interpolation error. It tells us how much the interpolating polynomial, piecewise polynomial, or spline differs from the exact function we want to model.
Learning Goals
By the end of this lesson, students, you should be able to:
- explain what interpolation error means and why it matters,
- identify the main terms used when studying interpolation error,
- use basic reasoning to estimate or interpret error,
- connect interpolation error to piecewise interpolation and splines,
- describe why error behavior is a major part of Interpolation II.
Interpolation is used everywhere: predicting temperatures between weather measurements, estimating a missing GPS position, or drawing a smooth graph from sampled data. But an interpolant is still only an approximation. The difference between the true function $f(x)$ and the approximation $p(x)$ is the heart of this lesson.
What Interpolation Error Means
Suppose we have a function $f(x)$ and data values at points $x_0, x_1, \dots, x_n$. An interpolating polynomial $p(x)$ is built so that
$$p(x_i)=f(x_i) \quad \text{for each } i=0,1,\dots,n.$$
This means the interpolant matches the data exactly at the chosen nodes. However, between the nodes, $p(x)$ may differ from $f(x)$. The interpolation error is
$$E(x)=f(x)-p(x).$$
If $E(x)$ is small, the approximation is good. If $E(x)$ is large, the approximation may be misleading. The key idea is that zero error at the sample points does not guarantee zero error everywhere else.
A simple real-world example is temperature recording. If a thermometer gives readings every hour, a smooth curve may be used to estimate the temperature at 10:30. Even though the curve matches the hourly readings, the actual temperature at 10:30 may be a little different. That difference is interpolation error 🌡️
The Error Formula and Its Meaning
For polynomial interpolation, there is an important theoretical error formula. If $f$ is sufficiently smooth, then for interpolation at nodes $x_0, x_1, \dots, x_n$, the error at a point $x$ can be written as
$$f(x)-p(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}\prod_{i=0}^{n}(x-x_i),$$
for some $\xi$ between the smallest and largest nodes and the point $x$.
This formula gives several important insights:
- The factor $\prod_{i=0}^{n}(x-x_i)$ becomes $0$ at each node, which is why the error is zero there.
- The derivative term $f^{(n+1)}(\xi)$ shows that the smoothness and curvature of the original function affect the error.
- The term $(n+1)!$ in the denominator shows that higher-degree interpolation has a built-in scaling effect.
Even if you do not know the exact value of $\xi$, the formula is still useful because it shows what influences the size of the error. For example, if the $(n+1)$st derivative is very large, the error may also be large.
A practical takeaway is that interpolation error depends on both the function and the choice of nodes. Two different sets of points can produce very different accuracy.
Why Node Placement Matters
students, one of the most important facts in interpolation is that the same degree polynomial can behave very differently depending on where the nodes are placed. This is why error analysis is not only about the function $f(x)$, but also about the geometry of the data points.
If the nodes are evenly spaced over a wide interval, high-degree polynomial interpolation can show strong oscillations near the ends. This phenomenon is often linked to large error in those regions. In contrast, choosing nodes more carefully can reduce error significantly.
A famous example is the Runge phenomenon. For certain smooth functions, polynomial interpolation at equally spaced points can become worse as the degree increases. This means that “more points” does not always mean “better approximation” if the node choice is poor.
This is a major reason numerical analysts use piecewise methods and splines. Instead of forcing one high-degree polynomial to fit everything, they split the interval into smaller parts and approximate locally. That usually gives better accuracy and stability ✅
Estimating Error in Practice
In real applications, the exact function $f(x)$ may not be fully known, so exact error may be impossible to compute directly. Instead, numerical analysis often uses theoretical bounds or indirect evidence.
A common strategy is to estimate the size of the derivative term in the error formula. If the function is known to be smooth and its higher derivatives are bounded, then the error can be bounded as well. A general bound looks like
$$|f(x)-p(x)|\leq \frac{M}{(n+1)!}\left|\prod_{i=0}^{n}(x-x_i)\right|,$$
where $M$ is an upper bound for $|f^{(n+1)}(x)|$ on the interval.
This bound is useful because it separates the problem into two parts:
- how curved or complicated the function is, and
- how the interpolation nodes are arranged.
For example, if a function changes very quickly in one region, a coarse interpolation there may have larger error. In that case, using more points in that region can improve the approximation. This idea leads naturally to adaptive methods, where the mesh is refined where needed.
From Global Interpolation to Piecewise Interpolation
Global interpolation uses one formula across the entire interval. Piecewise interpolation breaks the interval into smaller subintervals and uses separate interpolants on each part. This is a major topic in Interpolation II because it is often more reliable than using one high-degree polynomial.
Imagine drawing a road map. A single giant curve trying to represent every turn in the road would be hard to control. Instead, it is easier to draw the road in smaller sections. Piecewise interpolation works the same way 🚗
When each piece covers a shorter interval, the factor $\prod_{i=0}^{n}(x-x_i)$ is typically smaller, so error can be reduced. This is one reason piecewise methods are effective. They limit the distance over which a single polynomial must behave well.
Piecewise linear interpolation is the simplest example. On each interval $[x_i,x_{i+1}]$, the function is approximated by a line segment. The error is usually larger than in higher-order methods, but it is easy to compute and often good enough when data are dense.
Piecewise methods show an important trade-off:
- simpler approximations may be less accurate on each subinterval,
- but they are often more stable and easier to control overall.
Spline Overview and Error Reduction
A spline is a piecewise polynomial that is smooth where the pieces meet. The most common example is the cubic spline, which uses cubic polynomials on each subinterval and matches values and derivatives at the knots.
Why are splines important for interpolation error? Because they combine local control with smooth transitions. A spline usually avoids the wild oscillations that can happen with high-degree global polynomials. This makes the approximation more reliable in many applications.
For a cubic spline, the function and its first and second derivatives are typically continuous across the knots. That smoothness is helpful when modeling physical systems such as motion, elevation profiles, or engineering shapes. Smoothness often reduces visible error and improves realism.
A useful way to think about splines is this: instead of asking one polynomial to do all the work, the problem is shared among many smaller polynomials, each responsible for a short interval. This often makes the total error more manageable.
In practice, splines are common in computer graphics, CAD design, and data fitting. When the data are noisy or unevenly spaced, splines can give a better balance between accuracy and stability than a single interpolating polynomial.
Interpolation Error in the Bigger Picture
Interpolation error is not a side topic; it is central to the whole study of Interpolation II. It explains why some methods work better than others and why numerical analysts care so much about node selection, interval size, and smoothness.
Here is the bigger picture:
- Interpolation creates a formula that matches data values.
- Interpolation error measures how far that formula is from the true function.
- Piecewise interpolation lowers error by using smaller intervals.
- Splines reduce error and improve smoothness by joining local polynomials.
So, students, interpolation error is the bridge between theory and practice. A formula may look perfect at data points, but error analysis tells us whether it is truly useful between those points.
Conclusion
Interpolation error helps us judge the quality of an approximation. The exact match at sample points can hide differences elsewhere, and the size of those differences depends on the function, the nodes, and the method used. Global polynomial interpolation can be accurate, but it may also be unstable or oscillatory for poor node choices. Piecewise interpolation and splines are often better because they reduce error and improve control over the approximation. In numerical analysis, understanding interpolation error is essential for choosing the right method and trusting the result.
Study Notes
- Interpolation error is $E(x)=f(x)-p(x)$, where $f(x)$ is the true function and $p(x)$ is the interpolant.
- Interpolants always satisfy $p(x_i)=f(x_i)$ at the data points, but they may differ between points.
- For polynomial interpolation, the error can be expressed as $$f(x)-p(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}\prod_{i=0}^{n}(x-x_i).$$
- The error depends on the smoothness of $f(x)$, especially the size of the $(n+1)$st derivative.
- Node placement matters a lot; evenly spaced nodes can cause large errors in some cases.
- The Runge phenomenon is an example where high-degree interpolation at equally spaced nodes can behave badly.
- Piecewise interpolation usually reduces error by working on shorter intervals.
- Splines are piecewise polynomials chosen to be smooth at the joining points.
- Cubic splines are especially common because they are smooth and stable.
- Interpolation error is a key idea linking interpolation, piecewise methods, and splines in Interpolation II.
