Numerical Methods · Numerical Methods
Interpolation and Curve Fitting
Explanation
What is Interpolation?
Given data points , interpolation finds a function that passes exactly through all points. Goal: estimate values between the data points.
Linear Interpolation
Between two points and , the simplest formula:
Error:
Lagrange Interpolation Polynomial
Principle: there exists a unique polynomial of degree at most passing through distinct points.
Lagrange formula:
where the Lagrange basis polynomial is:
Property: (equals 1 at , zero at all other nodes).
Error: where .
Newton's Interpolation — Divided Differences
First-order divided difference:
Second-order divided difference:
Newton's formula (equivalent to Lagrange, but convenient for adding new points):
Advantage: adding a new point appends one new term to the polynomial; but computing its coefficient requires a chain of new divided differences from the stored table (order 1 up to order ). Compared to rebuilding from scratch — a significant saving — but not "just one divided difference". (Assumption: the nodes are all distinct.)
Hermite Interpolation
Generalizes Lagrange: derivatives at the nodes are also specified. The polynomial matches both function values and derivative values. Used in cubic splines.
Splines — Piecewise Interpolation
The problem with high-degree polynomials: Runge's phenomenon — strong oscillations near the endpoints between nodes.
Solution: cubic splines. Between each pair of points use a different degree-3 polynomial. Ensure continuity of the function, first derivative, and second derivative at all interior nodes.
Result: a very smooth curve without oscillations — usually preferable to a single polynomial.
Curve Fitting
Unlike interpolation (which passes exactly through points), fitting finds a curve that passes close to the points — minimizing the sum of squared residuals.
Linear least squares :
Accuracy — coefficient of determination :
: perfect fit. : no better than the mean.
Given data points , interpolation finds a function that passes exactly through all points. Goal: estimate values between the data points.
Linear Interpolation
Between two points and , the simplest formula:
Error:
Lagrange Interpolation Polynomial
Principle: there exists a unique polynomial of degree at most passing through distinct points.
Lagrange formula:
where the Lagrange basis polynomial is:
Property: (equals 1 at , zero at all other nodes).
Error: where .
Newton's Interpolation — Divided Differences
First-order divided difference:
Second-order divided difference:
Newton's formula (equivalent to Lagrange, but convenient for adding new points):
Advantage: adding a new point appends one new term to the polynomial; but computing its coefficient requires a chain of new divided differences from the stored table (order 1 up to order ). Compared to rebuilding from scratch — a significant saving — but not "just one divided difference". (Assumption: the nodes are all distinct.)
Hermite Interpolation
Generalizes Lagrange: derivatives at the nodes are also specified. The polynomial matches both function values and derivative values. Used in cubic splines.
Splines — Piecewise Interpolation
The problem with high-degree polynomials: Runge's phenomenon — strong oscillations near the endpoints between nodes.
Solution: cubic splines. Between each pair of points use a different degree-3 polynomial. Ensure continuity of the function, first derivative, and second derivative at all interior nodes.
Result: a very smooth curve without oscillations — usually preferable to a single polynomial.
Curve Fitting
Unlike interpolation (which passes exactly through points), fitting finds a curve that passes close to the points — minimizing the sum of squared residuals.
Linear least squares :
Accuracy — coefficient of determination :
: perfect fit. : no better than the mean.
Interactive Visualization
Loading visualization
Worked Examples
Practice
Exercise 1 of 6
1
Given and . Using linear interpolation, what is ?
★Quiz
Test your knowledge from this lesson
A mix of questions from the lesson — each attempt varies slightly
Answer at least 4 out of 5 questions correctly to pass (70%)