Thin plate spline interpolation and fitting

ALGLIB, a free and commercial open source numerical library, provides the best open-source implementation of thin plate splines (TPSs) and related algorithms (biharmonic splines and multiquadrics). ALGLIB is available in multiple programming languages, including C++, C#, Java, and Python.

Our multi-threaded, SIMD-optimized implementation of the TPS algorithm can interpolate and smooth scattered spatial data, compute model values and derivatives, and convert scattered data into a gridded form. Unlike other open-source implementations, it is scalable to big datasets with hundreds of thousands of points.

Contents

    1 Using the DDM-RBF solver
           Programming languages supported
           RBF types supported
           API overview
           Interpolation vs. smoothing
    2 Mathematical background: Fast algorithms for polyharmonic splines and RBFs
    3 Downloads section

Using the DDM-RBF solver

Programming languages supported

ALGLIB supports many programming languages, including C++, C#, Java, Python, and others:

A distinctive feature of ALGLIB is that it provides the same API in all programming languages. This is achieved through our exclusive automatic code translation and wrapper generation technology.

RBF types supported

The DDM-RBF solver is a fast large-scale model construction algorithm employing state-of-the-art mathematical methods. It can handle hundreds of thousands of points and supports the following basis functions:

API overview

RBF interpolation functionality is provided by the rbf subpackage (the link points to the ALGLIB Reference Manual entry for the subpackage).

The first step is model construction, which involves the following steps:

After the model is built, the following operations can be performed:

Interpolation vs. smoothing

All RBF algorithms in ALGLIB accept the smoothing parameter LambdaV. A zero value means that we solve an exact RBF interpolation problem. Such problems arise in many areas, including geospatial applications, surface reconstruction, and others.

When the smoothing parameter LambdaV is nonzero, the solver fits a smoothing RBF spline to the data. Smoothing may be used to actually smooth the data, e.g., to suppress noise. Another reason for employing smoothing is its regularizing effect on the model.

Generally, RBF interpolation requires nodes to be distinct and well separated, but industrial data often contain badly separated nodes. Some RBF kernels (Gaussian and multiquadric) are extremely sensitive to such nodes. Other kernels are also sensitive, albeit to a lesser extent. In such cases, specifying a small, nonzero LambdaV will help the solver deal with the data.

Mathematical background: Fast algorithms for polyharmonic splines and RBFs

The most time- and memory-consuming element of RBF interpolation is model construction. Our DDM-RBF solver accelerates its computations by using the following:

These improvements result in a parallel large-scale interpolation/fitting method with O(N) memory requirements and O(N2) running time.

Note #1
For comparison, a straightforward solution with a dense linear solver (as in SciPy and other open-source implementations) requires O(N3) time and O(N2) memory.

Download ALGLIB for C++ / C# / Java / Python / ...

ALGLIB Project offers you two editions of ALGLIB:

ALGLIB Free Edition:
+delivered for free
+offers full set of numerical functionality
+extensive algorithmic optimizations
-no multithreading
-non-commercial license

ALGLIB Commercial Edition:
+flexible pricing
+offers full set of numerical functionality
+extensive algorithmic optimizations
+high performance (SMP, SIMD)
+commercial license with support plan

Links to download sections for Free and Commercial editions can be found below:

ALGLIB 4.03.0 for C++

C++ library.
Delivered with sources.
Monolithic design.
Extreme portability.
Editions:   FREE   COMMERCIAL

ALGLIB 4.03.0 for C#

C# library with native kernels.
Delivered with sources.
VB.NET and IronPython wrappers.
Extreme portability.
Editions:   FREE   COMMERCIAL

ALGLIB 4.03.0 for Java

Java wrapper around HPC core.
Delivered with sources.
Seamless integration with Java.
Editions:   FREE   COMMERCIAL

ALGLIB 4.03.0 for Delphi

Delphi wrapper around C core.
Delivered as precompiled binary.
Compatible with FreePascal.
Editions:   FREE   COMMERCIAL

ALGLIB 4.03.0 for CPython

CPython wrapper around C core.
Delivered as precompiled binary.
Editions:   FREE   COMMERCIAL