Path: blob/master/material/interpolation_details.ipynb
934 views
Appendix
Thecnical details of interpolation functions: interpolation_details.ipynb
Bibligraphy
https://www.math.ust.hk/~mamu/courses/231/Slides/CH03_3A.pdf
Narváez, Diana Marcela Devia. "Comparison between some techniques of interpolators: An application in engineering." Scientia et technica 24.1 (2019): 173-178. DOI: https://doi.org/10.22517/23447214.21341 (Open Access)
Atkinson, Kendall E. An introduction to numerical analysis. John wiley & sons, 2008. PDF
Divided Differences
In spite of the good precision achieved by the Lagrange interpolating polynomials, analytical manipulation of such an expressions is rather complicated. Furthermore, when applying other polynomials-based techniques like Hermite polynomials, the algorithms present very different ways to achieve the final interpolation, making a comparison unclear.
Divided differences is a way to standardize the notation for interpolating polynomials. Suppose a polynomial and write it in the next form:
where are a set of constants to be determined from the given data .
Obtain
Note that due to the definition of an interpolant function, previous expression should satisfy:
Obtain
Obtain evaluating in that we can rewrite like
In summary
The key observation, by using the symmetry , is
Allow us to definine the zeroth divided difference, , of like
the first divided difference, of like
the second divided difference, of like
successively until the kth divided difference
These expressions are the fundamental bricks for any interpolating method.
Example 2
As an example, Lagrange interpolation can be also derived by using divided differences, which is reached through the next equation:
Note this expression is by far easier to be manipulated analytically as we can know the coefficients of each order.
Activity
Hermite Interpolation
From calculus we know that Taylor polynomials expand a function at a specific point , being both functions (the original one and the Taylor function) exactly equal at any derivative-order at that point. Also, as mentioned before, a Lagrange polynomial, given a set of data points, passes through all those points at the same time. However if those points come from an unknown underlying function , the interpolant polynomial might (surely) differ from the real function at any superior derivative-order. So we have:
Taylor polynomials are exact at any order, but that only remains true at a specific point.
Lagrange polynomials pass through all points of a give dataset, but only at zeroth-order. Derivatives are not longer equal.
Once established these differences, we can introduce Hermite polynomials just as a generalization of both, Taylor and Lagrange polynomials.
At first, Hermite polynomials can be approximated at any desired order at all the points, as long as one has all these information. However, for the sake of simplicity and without loss of generality, we shall assume Hermite polynomials equal to the real function at zeroth and first-derivative order. For that, we also need to know the points associated to the first-derivate.
Let's suppose a dataset for with the respective values and . If we assume two different polynomials to fit each set of data, i.e. a polynomial for and another for , we obtain coefficients, however zeroth-order coefficients can be put together so finally there are independet coefficients to be determined. In this case, we assign the respective Hermite polynimial as .
Derivation in terms of divided differences
Remembering the divided differences expression for a Lagrange polynomial
and by defining a new sequence such that
For even while for odd
However, divided differences has to be modified in order to include first-order derivatives:
Note that sould be originally
but replacing this would lead an indetermination. In order to solve this issue, this indertemination can be readily approximated to the derivative at , so
or using the previously defined notation
Generally, for first-order divided differences we will have
even odd
Higher order divided differences are calculated as usual:
Finally, the Hermite polynomial is built using the next expression
Order zero coefficient:
Hermite polynomials
Example
Example 3
Define a routine to calculate divided differences for Hermite polynomials.
Activity
Calculate a routine, using the previous program for divided differences, that computes the Hermite polynomial given a dataset.
Generate a set of points of the function between and , including an array of positions, and first derivative .
Show which polynomial gives the best approximation to the real function, Hermite or Lagrange polynomial.