MATLAB: Two dimensional cubic spline interpolation – does the order matter

cubic splineinterpolationmulti-dimensionaltwo dimensional

Hi,
I am doing two-dimensional interpolation, using cubic splines. I have an M-by-N matrix of function values: z(m,n), and a vector of x-values (of length M) and a vector of y values (of length N). The task is to calculate the function value at (x*,y*), where this point is somewhere in the interior of the two-dimensional grid. In order to have a twice-differentiable interpolating function, I am using cubic splines.
My understanding is that Matlab's interp2 procedure does something that is commonly referred to as bicubic splines. Essentially, this is what it does. First, it performs M one-dimensional splines across the rows of the table, and for each of those splines, it calculates the function values at (xm,y*), for m=1,2,…,M. Then, it does one additional one-dimensional spline down the newly created column {(xm,y*)}.
My question is this: does it matter in which order do I choose the dimensions? In other words, if the first step was N one-dimensional splines across the columns of the table, followed by a one-dimensional spline across the newly created row – would I still get the same result?
My conjecture is that the answer is yes. When I do this numerically, the order does not seem to matter, I get practically the same answer. Also, it is straightforward to prove that if the interpolation was linear (bilinear), then again, the order would not matter. For cubic interpolation, the answer is less obvious. I tried to see what the literature says, but I could not find anything definitive.
Also, if the order does not matter in two-dimensions, it should not matter in three or more dimensions either, right?
Any thoughts?
Thank you,
Zsolt

Best Answer

No, the order should not matter for any separable interpolator in any dimension, except for small floating point noise. Floating point errors do depend on the order of the computations.
Related Question