API
ScatteredInterpolation.ThinPlate
ScatteredInterpolation.evaluate
ScatteredInterpolation.interpolate
ScatteredInterpolation.Gaussian
ScatteredInterpolation.GeneralizedMultiquadratic
ScatteredInterpolation.GeneralizedPolyharmonic
ScatteredInterpolation.InverseMultiquadratic
ScatteredInterpolation.InverseQuadratic
ScatteredInterpolation.Multiquadratic
ScatteredInterpolation.NearestNeighbor
ScatteredInterpolation.Polyharmonic
ScatteredInterpolation.Shepard
Functions
ScatteredInterpolation.interpolate
— Functioninterpolate(method, points, samples; metric = Euclidean(), returnRBFmatrix = false; smooth = false)
Create an interpolation of the data in samples
sampled at the locations defined in points
based on the interpolation method method
. metric
is any of the metrics defined by the Distances
package. The RBF matrix used for solving the weights can be returned with the boolean returnRBFmatrix
. Note that this option is only valid for RadialBasisFunction interpolations.
points
should be an $n×k$ matrix, where $n$ is dimension of the sampled space and $k$ is the number of points. This means that each column in the matrix defines one point.
samples
is an $k×m$ array, where $k$ is the number of sampled points (same as for points
) and $m$ is the dimension of the sampled data.
The RadialBasisFunction interpolation supports the use of unique RBF functions and widths for each sampled point by supplying method
with a vector of interpolation methods of length $k$.
The RadialBasisFunction interpolation also supports smoothing of the data points using ridge regression. All points can be smoothed equally supplying a scalar value, alternatively each point can be smoothed independently by supplying a vector of smoothing values. Note that it is no longer interpolating when using smoothing.
The returned ScatteredInterpolant
object can be passed to evaluate
to interpolate the data to new points.
ScatteredInterpolation.evaluate
— Functionevaluate(itp, points)
Evaluate an interpolation object itp
at the locations defined in points
.
points
should be an $n×k$ matrix, where $n$ is dimension of the sampled space and $k$ is the number of points. This means that each column in the matrix defines one point.
Types
Radial Basis Functions
ScatteredInterpolation.Multiquadratic
— TypeMultiquadratic(ɛ = 1)
Define a Multiquadratic Radial Basis Function
\[ϕ(r) = \sqrt{1 + (ɛr)^2}\]
ScatteredInterpolation.InverseMultiquadratic
— TypeInverseMultiquadratic(ɛ = 1)
Define an Inverse Multiquadratic Radial Basis Function
\[ϕ(r) = \frac{1}{\sqrt{1 + (ɛr)^2}}\]
ScatteredInterpolation.Gaussian
— TypeGaussian(ɛ = 1)
Define a Gaussian Radial Basis Function
\[ϕ(r) = e^{-(ɛr)^2}\]
ScatteredInterpolation.InverseQuadratic
— TypeInverseQuadratic(ɛ = 1)
Define an Inverse Quadratic Radial Basis Function
\[ϕ(r) = \frac{1}{1 + (ɛr)^2}\]
ScatteredInterpolation.Polyharmonic
— TypePolyharmonic(k = 1)
Define a Polyharmonic Spline Radial Basis Function
\[ϕ(r) = r^k, k = 1, 3, 5, ... \\ ϕ(r) = r^k ln(r), k = 2, 4, 6, ...\]
ScatteredInterpolation.ThinPlate
— FunctionThinPlate()
Define a Thin Plate Spline Radial Basis Function
\[ϕ(r) = r^2 ln(r)\]
This is a shorthand for Polyharmonic(2)
.
ScatteredInterpolation.GeneralizedMultiquadratic
— TypeGeneralizedMultiquadratic(ɛ, β, degree)
Define a generalized Multiquadratic Radial Basis Function
\[ϕ(r) = (1 + (ɛ*r)^2)^β\]
Results in a positive definite system for a 'degree' of ⌈β⌉ or higher.
ScatteredInterpolation.GeneralizedPolyharmonic
— TypeGeneralizedPolyharmonic(k, degree)
Define a generalized Polyharmonic Radial Basis Function
\[ϕ(r) = r^k, k = 1, 3, 5, ... \\ ϕ(r) = r^k ln(r), k = 2, 4, 6, ...\]
Results in a positive definite system for a 'degree' of ⌈k/2⌉ or higher for k = 1, 3, 5, ... and of exactly k + 1 for k = 2, 4, 6, ...
Inverse Distance Weighting (Shepard)
ScatteredInterpolation.Shepard
— TypeShepard(P = 2)
Standard Shepard interpolation with power parameter P
.
Nearest Neighbor
ScatteredInterpolation.NearestNeighbor
— TypeNearestNeigbor()
Nearest neighbor interpolation.