Post Reply 
Peeking at different interpolation algorithms
08-02-2019, 09:27 PM (This post was last modified: 08-04-2019 01:43 PM by Albert Chan.)
Post: #2
RE: Peeking at different interpolation algorithms
With divided difference, there is no requirement that the table be sorted.
Just do Forward Divided Difference, with the entries closest to interested region up on top.

Example, from https://jp.mathworks.com/matlabcentral/f...on-formula
(note: the link had the entries entered wrong, below is corrected points)

Points: (-2, 18.4708), (-1, 17.8144), (0, 17.107), (1, 16.3432), (2, 15.5154), find y(0.25):

Assume calculations with 6 sig. digits, and we want best interpolated values in the middle:

Code:
p   y(p)      Divided Difference Table
+0  17.107
+1  16.3432  -0.763800
-1  17.8144  -0.735600  -0.0282000
+2  15.5154  -0.766333  -0.0307330  -0.00126650
-2  18.4708  -0.738850  -0.0274830  -0.00108333  -0.0000915850

y(p) = 17.107 + (p-0)*(-0.7638 + (p-1)*(-0.0282 + (p+1)*(-0.0012665 + (p-2)*(-0.000091585))))

→ y(0.25) ≈ 16.9216

Above formula is same (except slight rounding errors) as Gauss Forward Formula:
Code:
p   y(p)      Difference Table
-2  18.4708  
-1  17.8144  -0.6564
+0  17.107   -0.7074  -0.0510
+1  16.3432  -0.7638  -0.0564  -0.0054
+2  15.5154  -0.8278  -0.0640  -0.0076  -0.0022

y(p) = \(17.107 + \binom{p}{1}(-0.7638) + \binom{p}{2}(-0.0564)
+ \binom{p+1}{3}(-0.0076) + \binom{p+1}{4}(-0.0022) \)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Peeking at different interpolation algorithms - Albert Chan - 08-02-2019 09:27 PM



User(s) browsing this thread: 1 Guest(s)