Function Repository Resource:

# PolyharmonicSplineInterpolation

Interpolate data using polyharmonic splines

Contributed by: Jan Mangaldan
 ResourceFunction["PolyharmonicSplineInterpolation"][{f1,f2,…}] constructs a polyharmonic spline interpolation of the function values fi, assumed to correspond to x values 1, 2, …. ResourceFunction["PolyharmonicSplineInterpolation"][{{x1,f1},{x2,f2},…}] constructs a polyharmonic spline interpolation of the function values fi corresponding to x values xi. ResourceFunction["PolyharmonicSplineInterpolation"][{{{x1,y1,…},f1},{{x2,y2,…},f2},…}] constructs a polyharmonic spline interpolation of multidimensional data.

## Details and Options

ResourceFunction["PolyharmonicSplineInterpolation"] returns a Listable pure function by default.
The pure function returned by ResourceFunction["PolyharmonicSplineInterpolation"][data] is set up so as to agree with data at every point explicitly specified in data.
The function values fi can be real or complex numbers.
The fi can be lists or arrays of any dimension.
The function arguments xi, yi, etc. must be real numbers.
ResourceFunction["PolyharmonicSplineInterpolation"] creates a polyharmonic interpolation by performing a radial basis function interpolation over the given data points, using polyharmonic radial basis functions and linear polynomial terms.
The order of the polyharmonic radial basis functions is specified by the option InterpolationOrder.
The default setting is , corresponding to a thin plate spline.
A polyharmonic radial basis function of order k is given by φ(r)=rklog r if k is even, and φ(r)=rk if k is odd, where r is EuclideanDistance[{x,y,},{x1,y1,}].
ResourceFunction["PolyharmonicSplineInterpolation"] supports a Compiled option. Setting makes ResourceFunction["PolyharmonicSplineInterpolation"] return a listable compiled function.

## Examples

### Basic Examples (4)

Construct an approximate function that interpolates the data:

 In[1]:=

Apply the function to find interpolated values:

 In[2]:=
 Out[2]=

Plot the interpolation function:

 In[3]:=
 Out[3]=

Compare with the original data:

 In[4]:=
 Out[4]=

### Scope (6)

Interpolate between points at arbitrary x-values:

 In[5]:=
 Out[5]=

Create a list of multidimensional data:

 In[6]:=
 Out[6]=

Create a compiled interpolating function:

 In[7]:=

Plot the interpolating function:

 In[8]:=
 Out[8]=

Interpolate complex values:

 In[9]:=

Plot it:

 In[10]:=
 Out[10]=

Create a list of scattered data:

 In[11]:=

Create a compiled interpolating function:

 In[12]:=

Plot the interpolating function:

 In[13]:=
 Out[13]=

Create a vector-valued function of one variable from vector-valued data:

 In[14]:=

The value is a vector:

 In[15]:=
 Out[15]=

Plot both components:

 In[16]:=
 Out[16]=

Create a vector-valued function of two variables from vector-valued data:

 In[17]:=

The value is a vector:

 In[18]:=
 Out[18]=

Plot3D will show all three components:

 In[19]:=
 Out[19]=

A single component may be plotted using Indexed:

 In[20]:=
 Out[20]=

### Options (3)

#### Compiled (2)

Use to generate a compiled function from machine precision data:

 In[21]:=
 Out[21]=

A compiled function evaluates more quickly than an uncompiled one:

 In[22]:=
 Out[22]=
 In[23]:=
 Out[23]=

is appropriate for data with arbitrary precision:

 In[24]:=
 Out[24]=

#### InterpolationOrder (1)

Compare interpolating functions of different orders:

 In[25]:=
 Out[25]=

### Properties and Relations (1)

The interpolating function always goes through the data points:

 In[26]:=
 Out[26]=

## Version History

• 1.0.0 – 19 January 2021