In numerical analysis, Hermite interpolation, named after Charles Hermite, is a method of polynomial interpolation, which generalizes Lagrange interpolation. Lagrange interpolation allows computing a polynomial of degree less than n that takes the same value at n given points as a given function. Instead, Hermite interpolation computes a polynomial of degree less than n such that the polynomial and its first few derivatives have the same values at m (fewer than n) given points as the given function and its first few derivatives at those points. The number of pieces of information, function values and derivative values, must add up to n {\displaystyle n} .
Hermite's method of interpolation is closely related to the Newton's interpolation method, in that both can be derived from the calculation of divided differences. However, there are other methods for computing a Hermite interpolating polynomial. One can use linear algebra, by taking the coefficients of the interpolating polynomial as unknowns, and writing as linear equations the constraints that the interpolating polynomial must satisfy. For another method, see Chinese remainder theorem § Hermite interpolation. For yet another method, see, which uses contour integration.
Statement of the problem
In the restricted formulation studied in,2 Hermite interpolation consists of computing a polynomial of degree as low as possible that matches an unknown function both in observed value, and the observed value of its first m derivatives. This means that n(m + 1) values ( x 0 , y 0 ) , ( x 1 , y 1 ) , … , ( x n − 1 , y n − 1 ) , ( x 0 , y 0 ′ ) , ( x 1 , y 1 ′ ) , … , ( x n − 1 , y n − 1 ′ ) , ⋮ ⋮ ⋮ ( x 0 , y 0 ( m ) ) , ( x 1 , y 1 ( m ) ) , … , ( x n − 1 , y n − 1 ( m ) ) {\displaystyle {\begin{matrix}(x_{0},y_{0}),&(x_{1},y_{1}),&\ldots ,&(x_{n-1},y_{n-1}),\\[1ex](x_{0},y_{0}'),&(x_{1},y_{1}'),&\ldots ,&(x_{n-1},y_{n-1}'),\\[1ex]\vdots &\vdots &&\vdots \\[1.2ex](x_{0},y_{0}^{(m)}),&(x_{1},y_{1}^{(m)}),&\ldots ,&(x_{n-1},y_{n-1}^{(m)})\end{matrix}}} must be known. The resulting polynomial has a degree less than n(m + 1). (In a more general case, there is no need for m to be a fixed value; that is, some points may have more known derivatives than others. In this case the resulting polynomial has a degree less than the number of data points.)
Let us consider a polynomial P(x) of degree less than n(m + 1) with indeterminate coefficients; that is, the coefficients of P(x) are n(m + 1) new variables. Then, by writing the constraints that the interpolating polynomial must satisfy, one gets a system of n(m + 1) linear equations in n(m + 1) unknowns.
In general, such a system has exactly one solution. In,3 Charles Hermite used contour integration to prove that this is effectively the case here, and to find the unique solution, provided that the xi are pairwise different. The Hermite interpolation problem is a problem of linear algebra that has the coefficients of the interpolation polynomial as unknown variables and a confluent Vandermonde matrix as its matrix.4 The general methods of linear algebra, and specific methods for confluent Vandermonde matrices are often used for computing the interpolation polynomial. Another method is described below.
Using Chinese remainder theorem
See also: Chinese remainder theorem § Hermite interpolation
Let k be a positive integer, m 1 , … , m k {\displaystyle m_{1},\ldots ,m_{k}} be nonnegative integers, and values x 1 , … , x k {\displaystyle x_{1},\ldots ,x_{k}} that are real numbers or belong to any other field of characteristic zero. Hermite interpolation problem consists of finding a polynomial f such that
f ( x i ) = y i , 0 , f ′ ( x i ) = y i , 1 , … , f m i ( x i ) = y i , m i {\displaystyle f(x_{i})=y_{i,0},f'(x_{i})=y_{i,1},\ldots ,f^{m_{i}}(x_{i})=y_{i,m_{i}}}for i = 1 , … , k {\displaystyle i=1,\ldots ,k} , where the y i , j {\displaystyle y_{i,j}} are given values in the same field as the x i {\displaystyle x_{i}} .
These conditions implies that the Taylor polynomial of f of degree m i {\displaystyle m_{i}} at x i {\displaystyle x_{i}} is
∑ j = 0 m y i , j i ! ( x − x i ) j . {\displaystyle \sum _{j=0}^{m}{\frac {y_{i,j}}{i!}}(x-x_{i})^{j}.}In other words, the desired polynomial f is congruent to this polynomial modulo ( x − x i ) m i + 1 {\displaystyle (x-x_{i})^{m_{i}+1}} .
The Chinese remainder theorem for polynomials implies that there is exactly one solution of degree less than n = ∑ i = 0 k ( m i + 1 ) . {\textstyle n=\sum _{i=0}^{k}(m_{i}+1).}
Moreover, this solution can be computed with O ( n 2 ) {\displaystyle O(n^{2})} arithmetic operations, or even faster with fast polynomial multiplication.
This approach does not works in positive characteristic, because of the denominators of the coefficients of the Taylor polynomial. The approach through divided differences, below, works in every characteristic.
Using divided differences
Simple case when all k=2
When using divided differences to calculate the Hermite polynomial of a function f, the first step is to copy each point m times. (Here we will consider the simplest case m = 1 {\displaystyle m=1} for all points.) Therefore, given n + 1 {\displaystyle n+1} data points x 0 , x 1 , x 2 , … , x n {\displaystyle x_{0},x_{1},x_{2},\ldots ,x_{n}} , and values f ( x 0 ) , f ( x 1 ) , … , f ( x n ) {\displaystyle f(x_{0}),f(x_{1}),\ldots ,f(x_{n})} and f ′ ( x 0 ) , f ′ ( x 1 ) , … , f ′ ( x n ) {\displaystyle f'(x_{0}),f'(x_{1}),\ldots ,f'(x_{n})} for a function f {\displaystyle f} that we want to interpolate, we create a new dataset z 0 , z 1 , … , z 2 n + 1 {\displaystyle z_{0},z_{1},\ldots ,z_{2n+1}} such that z 2 i = z 2 i + 1 = x i . {\displaystyle z_{2i}=z_{2i+1}=x_{i}.}
Now, we create a divided differences table for the points z 0 , z 1 , … , z 2 n + 1 {\displaystyle z_{0},z_{1},\ldots ,z_{2n+1}} . However, for some divided differences, z i = z i + 1 ⟹ f [ z i , z i + 1 ] = f ( z i + 1 ) − f ( z i ) z i + 1 − z i = 0 0 {\displaystyle z_{i}=z_{i+1}\implies f[z_{i},z_{i+1}]={\frac {f(z_{i+1})-f(z_{i})}{z_{i+1}-z_{i}}}={\frac {0}{0}}} which is undefined. In this case, the divided difference is replaced by f ′ ( z i ) {\displaystyle f'(z_{i})} . All others are calculated normally.
A more general case when k>2
In the general case, suppose a given point x i {\displaystyle x_{i}} has k derivatives. Then the dataset z 0 , z 1 , … , z N {\displaystyle z_{0},z_{1},\ldots ,z_{N}} contains k identical copies of x i {\displaystyle x_{i}} . When creating the table, divided differences of j = 2 , 3 , … , k {\displaystyle j=2,3,\ldots ,k} identical values will be calculated as f ( j ) ( x i ) j ! . {\displaystyle {\frac {f^{(j)}(x_{i})}{j!}}.}
For example, f [ x i , x i , x i ] = f ″ ( x i ) 2 {\displaystyle f[x_{i},x_{i},x_{i}]={\frac {f''(x_{i})}{2}}} f [ x i , x i , x i , x i ] = f ( 3 ) ( x i ) 6 {\displaystyle f[x_{i},x_{i},x_{i},x_{i}]={\frac {f^{(3)}(x_{i})}{6}}} etc.
A fast algorithm for the fully general case is given in.5 A slower but more numerically stable algorithm is described in.6
Example
Consider the function f ( x ) = x 8 + 1 {\displaystyle f(x)=x^{8}+1} . Evaluating the function and its first two derivatives at x ∈ { − 1 , 0 , 1 } {\displaystyle x\in \{-1,0,1\}} , we obtain the following data:
x | f(x) | f′(x) | f″(x) |
---|---|---|---|
−1 | 2 | −8 | 56 |
0 | 1 | 0 | 0 |
1 | 2 | 8 | 56 |
Since we have two derivatives to work with, we construct the set { z i } = { − 1 , − 1 , − 1 , 0 , 0 , 0 , 1 , 1 , 1 } {\displaystyle \{z_{i}\}=\{-1,-1,-1,0,0,0,1,1,1\}} . Our divided difference table is then: z 0 = − 1 f [ z 0 ] = 2 f ′ ( z 0 ) 1 = − 8 z 1 = − 1 f [ z 1 ] = 2 f ″ ( z 1 ) 2 = 28 f ′ ( z 1 ) 1 = − 8 f [ z 3 , z 2 , z 1 , z 0 ] = − 21 z 2 = − 1 f [ z 2 ] = 2 f [ z 3 , z 2 , z 1 ] = 7 15 f [ z 3 , z 2 ] = − 1 f [ z 4 , z 3 , z 2 , z 1 ] = − 6 − 10 z 3 = 0 f [ z 3 ] = 1 f [ z 4 , z 3 , z 2 ] = 1 5 4 f ′ ( z 3 ) 1 = 0 f [ z 5 , z 4 , z 3 , z 2 ] = − 1 − 2 − 1 z 4 = 0 f [ z 4 ] = 1 f ″ ( z 4 ) 2 = 0 1 2 1 f ′ ( z 4 ) 1 = 0 f [ z 6 , z 5 , z 4 , z 3 ] = 1 2 1 z 5 = 0 f [ z 5 ] = 1 f [ z 6 , z 5 , z 4 ] = 1 5 4 f [ z 6 , z 5 ] = 1 f [ z 7 , z 6 , z 5 , z 4 ] = 6 10 z 6 = 1 f [ z 6 ] = 2 f [ z 7 , z 6 , z 5 ] = 7 15 f ′ ( z 6 ) 1 = 8 f [ z 8 , z 7 , z 6 , z 5 ] = 21 z 7 = 1 f [ z 7 ] = 2 f ″ ( z 7 ) 2 = 28 f ′ ( z 7 ) 1 = 8 z 8 = 1 f [ z 8 ] = 2 {\displaystyle {\begin{array}{llcclrrrrr}z_{0}=-1&f[z_{0}]=2&&&&&&&&\\&&{\frac {f'(z_{0})}{1}}=-8&&&&&&&\\z_{1}=-1&f[z_{1}]=2&&{\frac {f''(z_{1})}{2}}=28&&&&&&\\&&{\frac {f'(z_{1})}{1}}=-8&&f[z_{3},z_{2},z_{1},z_{0}]=-21&&&&&\\z_{2}=-1&f[z_{2}]=2&&f[z_{3},z_{2},z_{1}]=7&&15&&&&\\&&f[z_{3},z_{2}]=-1&&f[z_{4},z_{3},z_{2},z_{1}]=-6&&-10&&&\\z_{3}=0&f[z_{3}]=1&&f[z_{4},z_{3},z_{2}]=1&&5&&4&&\\&&{\frac {f'(z_{3})}{1}}=0&&f[z_{5},z_{4},z_{3},z_{2}]=-1&&-2&&-1&\\z_{4}=0&f[z_{4}]=1&&{\frac {f''(z_{4})}{2}}=0&&1&&2&&1\\&&{\frac {f'(z_{4})}{1}}=0&&f[z_{6},z_{5},z_{4},z_{3}]=1&&2&&1&\\z_{5}=0&f[z_{5}]=1&&f[z_{6},z_{5},z_{4}]=1&&5&&4&&\\&&f[z_{6},z_{5}]=1&&f[z_{7},z_{6},z_{5},z_{4}]=6&&10&&&\\z_{6}=1&f[z_{6}]=2&&f[z_{7},z_{6},z_{5}]=7&&15&&&&\\&&{\frac {f'(z_{6})}{1}}=8&&f[z_{8},z_{7},z_{6},z_{5}]=21&&&&&\\z_{7}=1&f[z_{7}]=2&&{\frac {f''(z_{7})}{2}}=28&&&&&&\\&&{\frac {f'(z_{7})}{1}}=8&&&&&&&\\z_{8}=1&f[z_{8}]=2&&&&&&&&\\\end{array}}} and the generated polynomial is P ( x ) = 2 − 8 ( x + 1 ) + 28 ( x + 1 ) 2 − 21 ( x + 1 ) 3 + 15 x ( x + 1 ) 3 − 10 x 2 ( x + 1 ) 3 + 4 x 3 ( x + 1 ) 3 − 1 x 3 ( x + 1 ) 3 ( x − 1 ) + x 3 ( x + 1 ) 3 ( x − 1 ) 2 = 2 − 8 + 28 − 21 − 8 x + 56 x − 63 x + 15 x + 28 x 2 − 63 x 2 + 45 x 2 − 10 x 2 − 21 x 3 + 45 x 3 − 30 x 3 + 4 x 3 + x 3 + x 3 + 15 x 4 − 30 x 4 + 12 x 4 + 2 x 4 + x 4 − 10 x 5 + 12 x 5 − 2 x 5 + 4 x 5 − 2 x 5 − 2 x 5 − x 6 + x 6 − x 7 + x 7 + x 8 = x 8 + 1. {\displaystyle {\begin{aligned}P(x)&=2-8(x+1)+28(x+1)^{2}-21(x+1)^{3}+15x(x+1)^{3}-10x^{2}(x+1)^{3}\\&\quad {}+4x^{3}(x+1)^{3}-1x^{3}(x+1)^{3}(x-1)+x^{3}(x+1)^{3}(x-1)^{2}\\&=2-8+28-21-8x+56x-63x+15x+28x^{2}-63x^{2}+45x^{2}-10x^{2}-21x^{3}\\&\quad {}+45x^{3}-30x^{3}+4x^{3}+x^{3}+x^{3}+15x^{4}-30x^{4}+12x^{4}+2x^{4}+x^{4}\\&\quad {}-10x^{5}+12x^{5}-2x^{5}+4x^{5}-2x^{5}-2x^{5}-x^{6}+x^{6}-x^{7}+x^{7}+x^{8}\\&=x^{8}+1.\end{aligned}}} by taking the coefficients from the diagonal of the divided difference table, and multiplying the kth coefficient by ∏ i = 0 k − 1 ( x − z i ) {\textstyle \prod _{i=0}^{k-1}(x-z_{i})} , as we would when generating a Newton polynomial.
Quintic Hermite interpolation
The quintic Hermite interpolation based on the function ( f {\displaystyle f} ), its first ( f ′ {\displaystyle f'} ) and second derivatives ( f ″ {\displaystyle f''} ) at two different points ( x 0 {\displaystyle x_{0}} and x 1 {\displaystyle x_{1}} ) can be used for example to interpolate the position of an object based on its position, velocity and acceleration. The general form is given by p ( x ) = f ( x 0 ) + f ′ ( x 0 ) ( x − x 0 ) + 1 2 f ″ ( x 0 ) ( x − x 0 ) 2 + f ( x 1 ) − f ( x 0 ) − f ′ ( x 0 ) ( x 1 − x 0 ) − 1 2 f ″ ( x 0 ) ( x 1 − x 0 ) 2 ( x 1 − x 0 ) 3 ( x − x 0 ) 3 + 3 f ( x 0 ) − 3 f ( x 1 ) + 2 ( f ′ ( x 0 ) + 1 2 f ′ ( x 1 ) ) ( x 1 − x 0 ) + 1 2 f ″ ( x 0 ) ( x 1 − x 0 ) 2 ( x 1 − x 0 ) 4 ( x − x 0 ) 3 ( x − x 1 ) + 6 f ( x 1 ) − 6 f ( x 0 ) − 3 ( f ′ ( x 0 ) + f ′ ( x 1 ) ) ( x 1 − x 0 ) + 1 2 ( f ″ ( x 1 ) − f ″ ( x 0 ) ) ( x 1 − x 0 ) 2 ( x 1 − x 0 ) 5 ( x − x 0 ) 3 ( x − x 1 ) 2 . {\displaystyle {\begin{aligned}p(x)&=f(x_{0})+f'(x_{0})(x-x_{0})+{\frac {1}{2}}f''(x_{0})(x-x_{0})^{2}+{\frac {f(x_{1})-f(x_{0})-f'(x_{0})(x_{1}-x_{0})-{\frac {1}{2}}f''(x_{0})(x_{1}-x_{0})^{2}}{(x_{1}-x_{0})^{3}}}(x-x_{0})^{3}\\&+{\frac {3f(x_{0})-3f(x_{1})+2\left(f'(x_{0})+{\frac {1}{2}}f'(x_{1})\right)(x_{1}-x_{0})+{\frac {1}{2}}f''(x_{0})(x_{1}-x_{0})^{2}}{(x_{1}-x_{0})^{4}}}(x-x_{0})^{3}(x-x_{1})\\&+{\frac {6f(x_{1})-6f(x_{0})-3\left(f'(x_{0})+f'(x_{1})\right)(x_{1}-x_{0})+{\frac {1}{2}}\left(f''(x_{1})-f''(x_{0})\right)(x_{1}-x_{0})^{2}}{(x_{1}-x_{0})^{5}}}(x-x_{0})^{3}(x-x_{1})^{2}.\end{aligned}}}
Error
Call the calculated polynomial H and original function f. Consider first the real-valued case. Evaluating a point x ∈ [ x 0 , x n ] {\displaystyle x\in [x_{0},x_{n}]} , the error function is f ( x ) − H ( x ) = f ( K ) ( c ) K ! ∏ i ( x − x i ) k i , {\displaystyle f(x)-H(x)={\frac {f^{(K)}(c)}{K!}}\prod _{i}(x-x_{i})^{k_{i}},} where c is an unknown within the range [ x 0 , x N ] {\displaystyle [x_{0},x_{N}]} , K is the total number of data-points, and k i {\displaystyle k_{i}} is the number of derivatives known at each x i {\displaystyle x_{i}} . The degree of the polynomial on the right is thus one higher than the degree bound for H ( x ) {\displaystyle H(x)} . Furthermore, the error and all its derivatives up to the k i − 1 {\displaystyle k_{i}-1} st order is zero at each node, as it should be.
In the complex case, as described for example on p. 360 in,7 f ( z ) − H ( z ) = w ( z ) 2 π i ∮ C f ( ζ ) w ( ζ ) ( ζ − z ) d ζ {\displaystyle f(z)-H(z)={\frac {w(z)}{2\pi i}}\oint _{C}{\frac {f(\zeta )}{w(\zeta )(\zeta -z)}}d\zeta } where the contour C {\displaystyle C} encloses z {\displaystyle z} and all the nodes x i {\displaystyle x_{i}} , and the node polynomial is w ( z ) = ∏ i ( z − x i ) k i {\displaystyle w(z)=\prod _{i}(z-x_{i})^{k_{i}}} .
See also
- Cubic Hermite spline
- Newton series, also known as finite differences
- Neville's schema
- Bernstein polynomials
External links
- Hermites Interpolating Polynomial at Mathworld
References
Hermite, Charles (1878). "Sur la formule d'interpolation de Lagrange". Journal für die reine und angewandte Mathematik. 84: 70–79. https://eudml.org/doc/148345 ↩
Traub, J. F. (December 1964). "On Lagrange—Hermite interpolation". Journal of the Society for Industrial and Applied Mathematics. 12 (4): 886–891. doi:10.1137/0112076. JSTOR 2946361. https://www.jstor.org/stable/2946361 ↩
Hermite, Charles (1878). "Sur la formule d'interpolation de Lagrange". Journal für die reine und angewandte Mathematik. 84: 70–79. https://eudml.org/doc/148345 ↩
Spitzbart, A (January 1960). "A Generalization of Hermite Interpolation". American Mathematical Monthly. 67 (1): 42–46. doi:10.1080/00029890.1960.11989446. JSTOR 2308924. Retrieved 2 June 2024. https://www.jstor.org/stable/2308924 ↩
Schneider, C; Werner, W (1991). "Hermite Interpolation: The Barycentric Approach". Computing. 46: 35–51. doi:10.1007/BF02239010. https://link.springer.com/article/10.1007/BF02239010 ↩
Corless, Robert M; Fillion, Nicolas (2013). A Graduate Introduction to Numerical Methods. New York: Springer. ISBN 978-1-4614-8452-3. 978-1-4614-8452-3 ↩
Corless, Robert M; Fillion, Nicolas (2013). A Graduate Introduction to Numerical Methods. New York: Springer. ISBN 978-1-4614-8452-3. 978-1-4614-8452-3 ↩