3
$\begingroup$

Assume I have a multidimensional grid $G$. I consider two functions $f(x)$ and $g(x)$. I have solved the values for the functions over all grid points $x \in G$. Let me now be interested in some third function $F(f(x),g(x))$. I am looking to evaluate $F$ at a point $y$ that is not a grid point using interpolation.

There are two approaches. First I could find $f(y)$ and $g(y)$ using interpolation and then plug them into $F$. Alternatively I could solve for $F$ over the grid and then interpolate on those values directly.

Which method should yield more accurate results? Is there some discussion on this issue in the literature? Does the answer depend on the interpolation method, e.g. multilinear vs. multidimensional spline interpolation?

$\endgroup$

1 Answer 1

5
$\begingroup$

This will implicitly depend on your function, $F$, as well as the method you used to derive your $f$ and $g$. If your $F$ were, say, the constant function $F(y,z)=1$, then you'd be guaranteed to have no error whatever you do. On the other hand, if you have a discontinuous $F$, say

$$F(x,y)=\begin{cases} 1&y\leq0,\\ 0& y>0, \end{cases} $$ then interpolation second is almost definitely going to have an error even on linear, while calculate then interpolate might be exact (or not, depending on the behaviour of its second variable). On the other hand, for other choices of functions, interpolation second might yield an impossible value, say for an $F$ known to be bounded above zero. Note that both of these effects can appear even in the 1D case.

More generally, errors may cancel, or they may accumulate. If all your functions are sufficiently well behaved, you can calculate bounds on your truncation error via (e.g Taylor series analysis of your interpolation method, along with any original errors in your $f$ & $g$). But remember, these are bounds, and either might be closer to the exact solution depending on your specific use case.

$\endgroup$
2
  • $\begingroup$ Thanks. Do you have an idea which method is used more frequently? All underlying functions I am using are smooth although discretization of course makes the functions discrete. $\endgroup$
    – fes
    Commented Feb 20, 2021 at 9:24
  • $\begingroup$ @fesman That may very well vary from field to field. In the relevant area I'm most used to (working with engineering finite element codes) it's mostly dependent on historical and performance choices rather than accuracy, where calculating then interpolating makes the most sense. $\endgroup$
    – origimbo
    Commented Feb 21, 2021 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.