# Newton's method in interpolation

I've seen that in Newton's method for interpolating polynomials, the coefficients can be found algorithmically using (in Python-ish):

a = Y_DataPoints.copy()
m = length(X_DataPoints)
for k in range(1,m):
a[k: m] = (a[k:m] - a[k-1]) / (X_Data[k:m] - X_Data[k-1])


But I don't really understand the model is subtracting all points past $k_{i}$ by $k_{i-1}$. It seems like you would only subtract $k_{i}$ by $k_{i-1}$, not the entire vector.

Can someone shed some light on this?

EDIT: Spelling

• Are you talking about the method for interpolating datapoints by polynomials? – Wolfgang Bangerth Oct 21 '13 at 2:14
• yes I am. I'll edit my OP – 1ifbyLAN2ifbyC Oct 21 '13 at 12:26
• Your python code (line 3) is not valid... – Jan Oct 21 '13 at 13:03
• I think there's another typo in the last line. Shouldn't it be a[k:m] instead of a[k:length(m)]? – Wolfgang Bangerth Oct 21 '13 at 13:13

If you compute the coefficients of the Newton polynomial via the scheme of divided differences linewise (what is often a good choice since then one can simply add additional data), in every line, you have to compute the differences with a fixed X_data point. Also, depending on how you store the "new" abscissae in Y_DataPoints, in every line you have to take the differences with a fixed function value.