Interpolations on scatter data of fun= f(x,y,z)

Hello everyone,
If I have scatter data of control points with x, y, z coordinates and its corresponding output (A). How can I find the interpolation for A = f(x,y,z) ? where x, y, z and A are vectors.
Thank you so much for you help.

# ---True function----
func(x,y,z) = x .+ y.^2 .+ z
# ----Data---
x_train = 5*rand(10)
y_train = 5*rand(10)
z_train = 5*rand(10)
A = func.(x_train,y_train,z_train)
# ====Interpolation for A = f(x_train,y_train,z_train) ? ===

Some tools can be found in the discussion here

some of them will probably work in 3D too. You should also consider if your data are “perfect” or if they contain noise before choosing an interpolation method. With DIVAnd, you can do something like

using DIVAnd
func(x,y,z) = x .+ y.^2 .+ z
# ----Data---
x_train = 5*rand(10)
y_train = 5*rand(10)
z_train = 5*rand(10)
A = func.(x_train,y_train,z_train)
myfun=DIVAndfun((x_train,y_train,z_train),A;epsilon2=0.001)
i=1
@show A[i],myfun(x_train[i],y_train[i],z_train[i])
@show myfun(2.5,2.5,2.5)
3 Likes

Thank you so much for your help.

One option not mentioned in the above thread is my package KernelInterpolation.jl. It works on scattered data, in arbitrary dimension, and can also handle noisy data.

4 Likes

Are there any desired properties of the interpolation function like smoothness, extrapolation behavior, degrees of freedom in fitting etc.?