Interpolation
Data and Interpolating Functions
Lagrange interpolation
(x1,y1),(x2,y2),(x3,y3)P2(x)=y1(x1−x2)(x1−x3)(x−x2)(x−x3)+y2(x2−x1)(x2−x3)(x−x1)(x−x3)+y3(x3−x1)(x3−x2)(x−x1)(x−x2) Newton's divided differences
f[xk]f[xkxk+1]f[xkxk+1xk+2]f[xkxk+1xk+2xk+3]=f(xk)=xk+1−xkf[xk+1]−f[xk]=xk+2−xkf[xk+1xk+2]−f[xkxk+1]=xk+3−xkf[xk+1xk+2xk+3]−f[xkxk+1xk+2] P(x)=f[x1]+f[x1x2](x−x1)+f[x1x2x3](x−x1)(x−x2)+f[x1x2x3,x4](x−x1)(x−x2)(x−x3)+⋯+f[x1⋯xn](x−x1)(x−x2)⋯(x−xn−1)
x1x2x3f[x1]f[x2]f[x3]f[x1x2]f[x2x3]f[x1x2x3] How many degree d polynomials pass through n points
points:(−1,−5),(0,−1),(2,1),(3,11)P3(x)=−5+4(x+1)−(x+1)x+(x+1)x(x−2)P4(x)=P3(x)+c1(x+1)x(x−2)(x−3)P5(x)=P3(x)+c2(x+1)x2(x−2)(x−3)c1=0,c2=0 Representing functions by approximating polynomials
a major use of polynomial interpolations is to replace evaluation of a complicated function by evaluation of a polynomial, which involves only elementary computer operation like addition , subtraction , and multiplication . Think of this as a form of compression
Interpolation error
interpolation error=f(x)−P(x)=n!(x−x1)(x−x2)…(x−xn)f(n)(c) where c lies between the smallest and largest of the numbers x,x1,⋯,xn , and P(x) is the (degree n - 1 or less) interpolating polynomial fitting the n points (x1,y1),⋯,(xn,yn)
Runge's phenomenon is a problem of oscillation at the edges of an interval that occurs when using polynomial interpolation with polynomials of high degree over a set of equispaced interpolation points. It was discovered by Carl David Tolmé Runge (1901) when exploring the behavior of errors when using polynomial interpolation to approximate certain functions. The discovery was important because it shows that going to higher degrees does not always improve accuracy.
Chebyshev interpolation
Chebyshev's theorem
the choice of real numbers −1≤x1,⋯,xn≤1 that makes the value of −1≤x≤1max∣(x−x1)⋯(x−xn)∣
as small as possible is xi=cos2n(2i−1)π
We will call the interpolating polynomial that uses the Chebyshev roots as base points the Chebyshev interpolating polynomial
Change of interval
on the interval [a,b]
xi=2a+b+2b−acos2n(2i−1)π ∣(x−x1)⋯(x−xn)∣≤2n−1(2b−a)n cubic splines
the idea of splines is to use several formulas , each a low-degree polynomial , to pass through the data points
linear splines lack smoothness , Cubic splines are meant to address this shortcoming of linear splines
the neighboring pieces Si and Si+1 of the spline to have the same zeroth, first ,and second derivatives when evaluated at the knots
Properties of splines
Sn−1(x)=yn−1+bn−1(x−xn−1)+cn−1(x−xn−1)2+dn−1(x−xn−1)3on[xn−1,xn] Property 1: Si(xi)=yi and Si(xi+1)=yi+1 for i=1,⋯,n−1
Property 2: Si−1′(xi)=Si′(xi) for i=2,⋯,n−1
Property 3: Si−1′′(xi)=Si′′(xi) for i=2,⋯,n−1
there totally (n−1)+(n−2)+(n−2) equations provided by these three properties ,but the unknown coefficients count is 3n−3
Property 4 for Natural spline: S1′′(x1)=Sn−1′′(xn)=0
Endpoint conditions
Natural spline
S1′′(x1)=Sn−1′′(xn)=0 Curvature-adjusted cubic spline
setting S1′′(x1) and Sn−1′′(xn) to arbitrary values ,chosen by the user
Clamped cubic spline
first derivatives S1′(x1) and Sn−1′(xn) that are set to user-specified values
Parabolically terminated cubic spline
the first and last parts of spline , S1 and Sn−1 are forced to be at most degree 2,by specifying that d1=dn−1=0
Not-a-knot cubic spline
d1=d2 and dn−2=dn−1
Bézier splines are appropriate for cases where corners (discontinuous first derivatives) and abrupt changes in curvature (discontinuous second derivatives) are occasionally needed
{x(t)=1+6t2−5t3y(t)=1+6t−6t2+t3t∈[0,1]