## Interpolation on an unstructured (mostly-structured) grid in 4D+

13

6

I frequently need to perform interpolations on an unstructured grid. Mostly, with the purpose of filling grid holes and then later continue with regular grid interpolations.

Mathematica V9 and V10 supports linear Interpolation on an unstructured grid up to 3D:

In:= if =
Interpolation[RandomReal[1, {2000, 2}], InterpolationOrder -> 1]; if[.5]

Out= 0.61608

In:= if =
Interpolation[RandomReal[1, {2000, 3}], InterpolationOrder -> 1]; if[.5, .5]

Out= 0.41285

In:= if =
Interpolation[RandomReal[1, {2000, 4}], InterpolationOrder -> 1]; if[.5, .5, .5]

Out= 0.496552


In V8 however, it was possible to apply the same to even higher dimensions. On my present machine I can get up to 5D (higher dimensions apparently require more than the 16GB RAM that I have):

In:= if =
Interpolation[RandomReal[1, {2000, 5}], InterpolationOrder -> 1]; if[.5, .5, .5, .3]

Out= 4.82823

In:= if =
Interpolation[RandomReal[1, {2000, 6}], InterpolationOrder -> 1]; if[.5, .5, .5, .3, .6]

Out= 0.119046


To compensate I used the Imtek Mathematica Supplement. However, this accumulated some incompatibilities with the recent Versions of Mathematica and the performance for higher dimensions is not sufficient for my applications. I am about to switch to Ingolf Dahl's Obtuse package which adds five interpolation methods to the Mathematica Interpolation command. Alternatively, there in this Mathematica Stackexchange post one can find a Radial Basis Function based Interpolation command.

Now my question(s) are:

1. Why has this functionality been removed for V8+ and is there are work-around to this new limitations?

2. What other possibilities are there to perform unstructured grid interpolations in 4D+ with reasonable Performance and some control over the applied methods?

3. Unfortunately I often need to interpolate missing grid points at the edges of the N-dim grid. For this reason I need to prevent/suppress divergent behavior, similar to the divergent extrapolation Problems when using higher order spline/polynomial inter/extrapolation methods. I know that the data cube is reasonably well behaved and would be content with linear Interpolation/Extrapolation behavior - any tips for that?

Another option is using MATLink to call MATLAB. This is practical only if you do not need to make many calls, i.e. if computing the interpolation function value in many points in a single step is acceptable. Otherwise the overhead is too much. And of course you need to have MATLAB. To do simple linear interpolation we need to construct a Delaunay tesselation first. The program qhull can do this. There are a number of posts on this site about how to use qhull from within Mathematica. Are you still interested in this?