Interpolation Used to estimate values between data points difference from regression - goes through data points no error in data points
Most common method is polynomial interpolation Given n+1 data points, a unique n th order polynomial fits them. Polynomial interpolation determines a’s of this polynomial A number of methods
Newton divided difference interpolating polynomials Start with linear interpolation
x0x0 xx1x1 f(x 0 ) f 1 (x) f(x 1 ) From similar triangles
Can rearrange to get linear interpolation formula Example: Interpolate exp(2) using 1) exp(1) and exp(6) and 2) exp(1.5) and exp (2.5) 1) 2)
Quadratic interpolation - need three points Use parabola This is the same as with
To get b’s 1) set x=x 0 in quadratic 2) use b 0 and x=x 1 in quadratic
3) use b 0 and b 1 and x=x 2 b 0 is a constant (0th order) b 1 gives slope (finite difference) b 2 give curvature (difference of finite differences)
Example: interpolate exp(2) using exp(1), exp(3) and exp(4)
Example: interpolate exp(2) using exp(1), exp(1.5) and exp(2.5)
General form for Newton’s interpolating polynomials Bracketed functions are finite differences
First finite difference Second finite difference The difference of two finite differences
The nth finite difference An interative proceedure 1) make all first order finite differences; save f(x 0 ) for b 0 2) make second order from firsts; save f[x 1,x 0 ] for b 1 3) continue to nth order, saving needed ones
Example: estimate exp(2) using 6 points - 0,1, 3, 4, 5, 6 Do first differences, get b 1
Use firsts to get seconds and save b 2
Use seconds to get thirds and get b 3
Use thirds to get fourths and b 4 Use fourths to get the fifth finite difference and b 5
So
Blow up
Error for Newton’s polynomial - estimate from Thinking of interpolation like a Taylor series
Example: use exp(2.5)=12.18 Calculate
Matlab code Excel code