Polyharmonic spline

From HandWiki
Revision as of 20:36, 6 February 2024 by SpringEdit (talk | contribs) (update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In applied mathematics, polyharmonic splines are used for function approximation and data interpolation. They are very useful for interpolating and fitting scattered data in many dimensions. Special cases include thin plate splines[1][2] and natural cubic splines in one dimension.[3]

Definition

A polyharmonic spline is a linear combination of polyharmonic radial basis functions (RBFs) denoted by [math]\displaystyle{ \varphi }[/math] plus a polynomial term:

[math]\displaystyle{ f(\mathbf{x}) = \sum_{i=1}^N w_i \varphi(|\mathbf{x} -\mathbf{c}_i|) + \mathbf{v}^{\textrm{T}} \begin{bmatrix} 1 \\ \mathbf{x} \end{bmatrix} }[/math]

 

 

 

 

(1)

where

Polyharmonic basis functions
  • [math]\displaystyle{ \mathbf{x} = [x_1 \ x_2 \ \cdots \ x_{d}]^{\textrm{T}} }[/math] ([math]\displaystyle{ \textrm{T} }[/math] denotes matrix transpose, meaning [math]\displaystyle{ \mathbf{x} }[/math] is a column vector) is a real-valued vector of [math]\displaystyle{ d }[/math] independent variables,
  • [math]\displaystyle{ \mathbf{c}_i = [c_{i,1} \ c_{i,2} \ \cdots \ c_{i,d}]^{\textrm{T}} }[/math] are [math]\displaystyle{ N }[/math] vectors of the same size as [math]\displaystyle{ \mathbf{x} }[/math] (often called centers) that the curve or surface must interpolate,
  • [math]\displaystyle{ \mathbf{w} = [w_1 \ w_2 \ \cdots \ w_N]^{\textrm{T}} }[/math] are the [math]\displaystyle{ N }[/math] weights of the RBFs,
  • [math]\displaystyle{ \mathbf{v} = [v_1 \ v_2 \ \cdots \ v_{d+1}]^{\textrm{T}} }[/math] are the [math]\displaystyle{ d+1 }[/math] weights of the polynomial.

The polynomial with the coefficients [math]\displaystyle{ \mathbf{v} }[/math] improves fitting accuracy for polyharmonic smoothing splines and also improves extrapolation away from the centers [math]\displaystyle{ \mathbf{c}_i. }[/math] See figure below for comparison of splines with polynomial term and without polynomial term.

The polyharmonic RBFs are of the form:

[math]\displaystyle{ \begin{align} \varphi(r) &= \begin{cases} r^k & \text{with } k=1,3,5,\ldots, \\ r^k \ln(r) & \text{with } k=2,4,6,\ldots \end{cases} \\[5mm] r &= |\mathbf{x} - \mathbf{c}_i| = \sqrt{ (\mathbf{x} - \mathbf{c}_i)^\mathrm{T} \, (\mathbf{x} - \mathbf{c}_i) }. \end{align} }[/math]

Other values of the exponent [math]\displaystyle{ k }[/math] are not useful (such as [math]\displaystyle{ \varphi(r) = r^2 }[/math]), because a solution of the interpolation problem might not exist. To avoid problems at [math]\displaystyle{ r=0 }[/math] (since [math]\displaystyle{ \log(0) = -\infty }[/math]), the polyharmonic RBFs with the natural logarithm might be implemented as:

[math]\displaystyle{ \varphi(r) = \begin{cases} r^{k-1} \ln(r^r) & \text{for } r \lt 1, \quad \text {(this works because }0^0\text{ is defined)} \\ r^k \ln(r) & \text{for } r \ge 1. \end{cases} }[/math]

or, more simply adding a continuity extension in [math]\displaystyle{ r=0 }[/math]

[math]\displaystyle{ \varphi(r) = \begin{cases} 0 & \text{for } r\lt \epsilon, \quad \text{(for some very small value of }\epsilon\text{, e.g. if using floating point numbers in double precisions, } \epsilon=10^{-200}\text{)}\\ r^k \ln(r) & \text{for } r \ge \epsilon. \end{cases} }[/math]

The weights [math]\displaystyle{ w_i }[/math] and [math]\displaystyle{ v_j }[/math] are determined such that the function interpolates [math]\displaystyle{ N }[/math] given points [math]\displaystyle{ (\mathbf{c}_i, f_i) }[/math] (for [math]\displaystyle{ i=1,2,\ldots,N }[/math]) and fulfills the [math]\displaystyle{ d+1 }[/math] orthogonality conditions

[math]\displaystyle{ \sum_{i=1}^N w_i=0, \;\; \sum_{i=1}^N w_i \mathbf{c}_i=\mathbf{0}. }[/math]

All together, these constraints are equivalent to the symmetric linear system of equations

[math]\displaystyle{ \begin{bmatrix} A & B \\ B^{\textrm{T}} & 0 \end{bmatrix} \; \begin{bmatrix} \mathbf{w} \\ \mathbf{v} \end{bmatrix} \; = \; \begin{bmatrix} \mathbf{f} \\ \mathbf{0} \end{bmatrix}\;\;\;\; }[/math]

 

 

 

 

(2)

where

[math]\displaystyle{ A_{i,j} = \varphi(|\mathbf{c}_i - \mathbf{c}_j|), \quad B = \begin{bmatrix} 1 & 1 & \cdots & 1 \\ \mathbf{c}_1 & \mathbf{c}_2 & \cdots & \mathbf{c}_N \end{bmatrix}^{\textrm{T}}, \quad \mathbf{f} = [f_1, f_2, \ldots, f_N]^{\textrm{T}}. }[/math]

In order for this system of equations to have a unique solution, [math]\displaystyle{ B }[/math] must be full rank. [math]\displaystyle{ B }[/math] is full rank for very mild conditions on the input data. For example, in two dimensions, three centers forming a non-degenerate triangle ensure that [math]\displaystyle{ B }[/math] is full rank, and in three dimensions, four centers forming a non-degenerate tetrahedron ensure that B is full rank. As explained later, the linear transformation resulting from the restriction of the domain of the linear transformation [math]\displaystyle{ A }[/math] to the null space of [math]\displaystyle{ B^{\textrm{T}} }[/math] is positive definite. This means that if [math]\displaystyle{ B }[/math] is full rank, the system of equations (2) always has a unique solution and it can be solved using a linear solver specialised for symmetric matrices. The computed weights allow evaluation of the spline for any [math]\displaystyle{ \mathbf{x}\in\mathbb{R}^d }[/math] using equation (1). Many practical details of implementing and using polyharmonic splines are explained in Fasshauer.[4] In Iske[5] polyharmonic splines are treated as special cases of other multiresolution methods in scattered data modelling.

Discussion

The main advantage of polyharmonic spline interpolation is that usually very good interpolation results are obtained for scattered data without performing any "tuning", so automatic interpolation is feasible. This is not the case for other radial basis functions. For example, the Gaussian function [math]\displaystyle{ e^{-k\cdot r^2} }[/math] needs to be tuned, so that [math]\displaystyle{ k }[/math] is selected according to the underlying grid of the independent variables. If this grid is non-uniform, a proper selection of [math]\displaystyle{ k }[/math] to achieve a good interpolation result is difficult or impossible.

Main disadvantages are:

  • To determine the weights, a dense linear system of equations must be solved. Solving a dense linear system becomes impractical if the dimension [math]\displaystyle{ N }[/math] is large, since the memory required is [math]\displaystyle{ O(N^2) }[/math] and the number of operations required is [math]\displaystyle{ O(N^3). }[/math]
  • Evaluating the computed polyharmonic spline function at [math]\displaystyle{ M }[/math] data points requires [math]\displaystyle{ O(MN) }[/math] operations. In many applications (image processing is an example), [math]\displaystyle{ M }[/math] is much larger than [math]\displaystyle{ N, }[/math] and if both numbers are large, this is not practical.

Fast construction and evaluation methods

One straightforward approach to speeding up model construction and evaluation is to use a subset of [math]\displaystyle{ k }[/math] nearest interpolation nodes to build a local model every time we evaluate the spline. As a result, the total time needed for model construction and evaluation at [math]\displaystyle{ M }[/math] points changes from [math]\displaystyle{ O(N^3+MN) }[/math] to [math]\displaystyle{ O(k^3*M) }[/math]. This can yield better timings if [math]\displaystyle{ k }[/math] is much less than [math]\displaystyle{ N }[/math]. Such an approach is advocated by some software libraries, the most notable being scipy.interpolate.RBFInterpolator. The main drawback is that it introduces small discontinuities in the spline and requires problem-specific tuning: a proper choice of the neighbors count, [math]\displaystyle{ k }[/math]. Recently, methods have been developed to overcome the aforementioned difficulties without sacrificing main advantages of polyharmonic splines.

First, a bunch of methods for fast [math]\displaystyle{ O(\log N) }[/math] evaluation were proposed:

  • Beatson et al.[6] present a method to interpolate polyharmonic splines with [math]\displaystyle{ r^{2k-1} }[/math] being a basis function at one point in 3 dimensions or less
  • Cherrie et al. [7] present a method to interpolate polyharmonic splines with [math]\displaystyle{ r^{2k}\log r }[/math] as a basis function at one point in 4 dimensions or less

Second, an accelerated model construction by applying an iterative solver to an ACBF-preconditioned linear system was proposed by Brown et al.[8] This approach reduces running time from [math]\displaystyle{ O(N^3) }[/math] to [math]\displaystyle{ O(N^2) }[/math], and further to [math]\displaystyle{ O(N\log N) }[/math] when combined with accelerated evaluation techniques.

The approaches above are often employed by commercial geospatial data analysis libraries and by some open source implementations (e.g. ALGLIB). Sometimes domain decomposition methods are used to improve asymptotic behavior, reducing memory requirements from [math]\displaystyle{ O(N^2) }[/math] to [math]\displaystyle{ O(N) }[/math], thus making polyharmonic splines suitable for datasets with more than 1.000.000 points.

Reason for the name "polyharmonic"

A polyharmonic equation is a partial differential equation of the form [math]\displaystyle{ \Delta^m f = 0 }[/math] for any natural number [math]\displaystyle{ m }[/math], where [math]\displaystyle{ \Delta }[/math] is the Laplace operator. For example, the biharmonic equation is [math]\displaystyle{ \Delta^2 f = 0 }[/math] and the triharmonic equation is [math]\displaystyle{ \Delta^3 f = 0 }[/math]. All the polyharmonic radial basis functions are solutions of a polyharmonic equation (or more accurately, a modified polyharmonic equation with a Dirac delta function on the right hand side instead of 0). For example, the thin plate radial basis function is a solution of the modified 2-dimensional biharmonic equation.[9] Applying the 2D Laplace operator ([math]\displaystyle{ \Delta = \partial_{xx} + \partial_{yy} }[/math]) to the thin plate radial basis function [math]\displaystyle{ f_{\text{tp}}(x,y) = (x^2+y^2) \log \sqrt{x^2+y^2} }[/math] either by hand or using a computer algebra system shows that [math]\displaystyle{ \Delta f_{\text{tp}} = 4 + 4\log r }[/math]. Applying the Laplace operator to [math]\displaystyle{ \Delta f_{\text{tp}} }[/math] (this is [math]\displaystyle{ \Delta^2 f_{\text{tp}} }[/math]) yields 0. But 0 is not exactly correct. To see this, replace [math]\displaystyle{ r^2=x^2+y^2 }[/math] with [math]\displaystyle{ \rho^2 = x^2+y^2+h^2 }[/math] (where [math]\displaystyle{ h }[/math] is some small number tending to 0). The Laplace operator applied to [math]\displaystyle{ 4 \log \rho }[/math] yields [math]\displaystyle{ \Delta^2 f_{\text{tp}} = 8h^2 / \rho^4 }[/math]. For [math]\displaystyle{ (x,y)=(0,0), }[/math] the right hand side of this equation approaches infinity as [math]\displaystyle{ h }[/math] approaches 0. For any other [math]\displaystyle{ (x,y) }[/math], the right hand side approaches 0 as [math]\displaystyle{ h }[/math] approaches 0. This indicates that the right hand side is a Dirac delta function. A computer algebra system will show that

[math]\displaystyle{ \lim_{h \to 0}\int_{-\infty}^\infty \int_{-\infty}^\infty 8h^2/(x^2+y^2+h^2)^2 \,dx \,dy = 8\pi. }[/math]

So the thin plate radial basis function is a solution of the equation [math]\displaystyle{ \Delta^2 f_{\text{tp}} = 8\pi\delta(x,y) }[/math].

Applying the 3D Laplacian ([math]\displaystyle{ \Delta = \partial_{xx} + \partial_{yy} + \partial_{zz} }[/math]) to the biharmonic RBF [math]\displaystyle{ f_{\text{bi}}(x,y,z)=\sqrt{x^2+y^2+z^2} }[/math] yields [math]\displaystyle{ \Delta f_{\text{bi}} = 2/r }[/math] and applying the 3D [math]\displaystyle{ \Delta^2 }[/math] operator to the triharmonic RBF [math]\displaystyle{ f_{\text{tri}}(x,y,z) = (x^2+y^2+z^2)^{3/2} }[/math] yields [math]\displaystyle{ \Delta^2 f_{\text{tri}} = 24/r }[/math]. Letting [math]\displaystyle{ \rho^2 = x^2+y^2+z^2+h^2 }[/math] and computing [math]\displaystyle{ \Delta(1/\rho) = -3h^2 / \rho^5 }[/math] again indicates that the right hand side of the PDEs for the biharmonic and triharmonic RBFs are Dirac delta functions. Since

[math]\displaystyle{ \lim_{h \to 0}\int_{-\infty}^\infty\int_{-\infty}^\infty\int_{-\infty}^\infty -3h^2/(x^2+y^2+z^2+h^2)^{5/2} \,dx \,dy \,dz = -4\pi, }[/math]

the exact PDEs satisfied by the biharmonic and triharmonic RBFs are [math]\displaystyle{ \Delta^2 f_{\text{bi}} = -8\pi\delta(x,y,z) }[/math] and [math]\displaystyle{ \Delta^3 f_{\text{tri}} = -96\pi\delta(x,y,z) }[/math].

Polyharmonic smoothing splines

Polyharmonic splines minimize

[math]\displaystyle{ \sum_{i=1}^N (f(\mathbf{c}_i) - f_i)^2 + \lambda \int_{\mathcal{B} \subset \mathbb{R}^d} |\nabla^m f|^2 \,d\mathbf{x} }[/math]

 

 

 

 

(3)

where [math]\displaystyle{ \mathcal{B} }[/math] is some box in [math]\displaystyle{ \mathbb{R}^d }[/math] containing a neighborhood of all the centers, [math]\displaystyle{ \lambda }[/math] is some positive constant, and [math]\displaystyle{ \nabla^m f }[/math] is the vector of all [math]\displaystyle{ m }[/math]th order partial derivatives of [math]\displaystyle{ f. }[/math] For example, in 2D [math]\displaystyle{ \nabla^1 f = (f_x\ f_y) }[/math] and [math]\displaystyle{ \nabla^2 f = (f_{xx} \ f_{xy} \ f_{yx} \ f_{yy}) }[/math] and in 3D [math]\displaystyle{ \nabla^2 f = (f_{xx} \ f_{xy} \ f_{xz} \ f_{yx} \ f_{yy} \ f_{yz} \ f_{zx} \ f_{zy} \ f_{zz}) }[/math]. In 2D [math]\displaystyle{ |\nabla^2 f|^2 = f_{xx}^2 + 2f_{xy}^2 + f_{yy}^2, }[/math] making the integral the simplified thin plate energy functional.

To show that polyharmonic splines minimize equation (3), the fitting term must be transformed into an integral using the definition of the Dirac delta function:

[math]\displaystyle{ \sum_{i=1}^N (f(\mathbf{c}_i) - f_i)^2 = \int_{\mathcal{B}}\sum_{i=1}^N (f(\mathbf{x}) - f_i)^2 \delta(\mathbf{x} - \mathbf{c}_i) \,d\mathbf{x}. }[/math]

So equation (3) can be written as the functional

[math]\displaystyle{ J[f] = \int_{\mathcal{B}} F(\mathbf{x},f, \partial^{\alpha_1}f, \partial^{\alpha_2}f, \ldots, \partial^{\alpha_n}f ) \,d\mathbf{x} = \int_{\mathcal{B}} \left[ \sum_{i=1}^N (f(\mathbf{x}) - f_i)^2 \delta(\mathbf{x} - \mathbf{c}_i) + \lambda |\nabla^m f|^2 \right]\,d\mathbf{x}. }[/math]

where [math]\displaystyle{ \alpha_i }[/math] is a multi-index that ranges over all partial derivatives of order [math]\displaystyle{ m }[/math] for [math]\displaystyle{ \mathbb{R}^d. }[/math] In order to apply the Euler–Lagrange equation for a single function of multiple variables and higher order derivatives, the quantities

[math]\displaystyle{ {\partial F \over\partial f} = 2\sum_{i=1}^N (f(\mathbf{x}) - f_i) \delta(\mathbf{x} - x_i) }[/math]

and

[math]\displaystyle{ \sum_{i=1}^n \partial^{\alpha_i} {\partial F \over\partial (\partial^{\alpha_i}f)} = 2\lambda \Delta^m f }[/math]

are needed. Inserting these quantities into the E−L equation shows that

[math]\displaystyle{ \left( \sum_{i=1}^N (f(\mathbf{x}) - f_i) \delta(\mathbf{x} - \mathbf{c}_i) \right) + (-1)^{m} \lambda \Delta^m f = 0. }[/math]

 

 

 

 

(4)

A weak solution [math]\displaystyle{ f(\mathbf{x}) }[/math] of (4) satisfies

[math]\displaystyle{ \int_{\mathcal{B}} \left( \sum_{i=1}^N (f(\mathbf{x}) - f_i) \delta(\mathbf{x} - \mathbf{c}_i) \right) g(\mathbf{x}) + (-1)^m\lambda (\Delta^m f) g(\mathbf{x}) \,d\mathbf{x} = 0 }[/math]

 

 

 

 

( 5)

for all smooth test functions [math]\displaystyle{ g }[/math] that vanish outside of [math]\displaystyle{ \mathcal{B}. }[/math] A weak solution of equation (4) will still minimize (3) while getting rid of the delta function through integration.[10]

Let [math]\displaystyle{ f }[/math] be a polyharmonic spline as defined by equation (1). The following calculations will show that [math]\displaystyle{ f }[/math] satisfies (5). Applying the [math]\displaystyle{ \Delta^m }[/math] operator to equation (1) yields

[math]\displaystyle{ \Delta^m f = \sum_{i=1}^M w_i C_{m,d} \delta(\mathbf{x} - \mathbf{c}_i) }[/math]

where [math]\displaystyle{ C_{2,2} = 8\pi, }[/math] [math]\displaystyle{ C_{2,3}=-8\pi, }[/math] and [math]\displaystyle{ C_{3,3}=-96\pi. }[/math] So (5) is equivalent to

[math]\displaystyle{ \begin{align} \int_{\mathcal{B}} & \sum_{i=1}^N \delta(\mathbf{x} - \mathbf{c}_i) (f(\mathbf{x}) - f_i + (-1)^m\lambda C_{m,d} w_i) g(\mathbf{x}) \,d\mathbf{x} \\ &= \sum_{i=1}^N (f(\mathbf{c}_i) - f_i + (-1)^m\lambda C_{m,d} w_i) g(\mathbf{c}_i) \\ &= 0. \end{align} }[/math]

 

 

 

 

(6)

The only possible solution to (6) for all test functions [math]\displaystyle{ g }[/math] is

[math]\displaystyle{ f(\mathbf{c}_j) - f_j + (-1)^m\lambda C_{m,d} w_j = 0 \quad \text{for} \ j=1,2,\ldots,N }[/math]

 

 

 

 

(7)

(which implies interpolation if [math]\displaystyle{ \lambda=0 }[/math]). Combining the definition of [math]\displaystyle{ f }[/math] in equation (1) with equation (7) results in almost the same linear system as equation (2) except that the matrix [math]\displaystyle{ A }[/math] is replaced with [math]\displaystyle{ A + (-1)^m C_{m,d}\lambda I }[/math] where [math]\displaystyle{ I }[/math] is the [math]\displaystyle{ N\times N }[/math] identity matrix. For example, for the 3D triharmonic RBFs, [math]\displaystyle{ A }[/math] is replaced with [math]\displaystyle{ A + 96\pi\lambda I. }[/math]

Explanation of additional constraints

In (2), the bottom half of the system of equations ([math]\displaystyle{ B^{\textrm{T}}\mathbf{w} = 0 }[/math]) is given without explanation. The explanation first requires deriving a simplified form of [math]\displaystyle{ \int_{\mathcal{B}} |\nabla^m f|^2 \,d\mathbf{x} }[/math] when [math]\displaystyle{ \mathcal{B} }[/math] is all of [math]\displaystyle{ \mathbb{R}^d. }[/math]

First, require that [math]\displaystyle{ \sum_{i=1}^N w_i =0. }[/math] This ensures that all derivatives of order [math]\displaystyle{ m }[/math] and higher of [math]\displaystyle{ f(\mathbf{x}) = \sum_{i=1}^N w_i \varphi(|\mathbf{x} - \mathbf{c}_i|) }[/math] vanish at infinity. For example, let [math]\displaystyle{ m=3 }[/math] and [math]\displaystyle{ d=3 }[/math] and [math]\displaystyle{ \varphi }[/math] be the triharmonic RBF. Then [math]\displaystyle{ \varphi_{zzy} = 3y(x^2+y^2) / (x^2+y^2+z^2)^{3/2} }[/math] (considering [math]\displaystyle{ \varphi }[/math] as a mapping from [math]\displaystyle{ \mathbb{R}^3 }[/math] to [math]\displaystyle{ \mathbb{R} }[/math]). For a given center [math]\displaystyle{ \mathbf{P} = (P_1,P_2,P_3), }[/math]

[math]\displaystyle{ \varphi_{zzy}(\mathbf{x} - \mathbf{P}) = \frac{3(y-P_2)((y-P_2)^2 + (x-P_1)^2)}{((x-P_1)^2 + (y-P_2)^2 + (z-P_3)^2)^{3/2}}. }[/math]

On a line [math]\displaystyle{ \mathbf{x} = \mathbf{a} + t\mathbf{b} }[/math] for arbitrary point [math]\displaystyle{ \mathbf{a} }[/math] and unit vector [math]\displaystyle{ \mathbf{b}, }[/math]

[math]\displaystyle{ \varphi_{zzy}(\mathbf{x} - \mathbf{P}) = \frac{3(a_2+b_2t - P_2)((a_2+b_2t-P_2)^2 + (a_1+b_1t-P_1)^2)}{((a_1+b_1t-P_1)^2 + (a_2+b_2t-P_2)^2 + (a_3+b_3t-P_3)^2)^{3/2}}. }[/math]

Dividing both numerator and denominator of this by [math]\displaystyle{ t^3 }[/math] shows that [math]\displaystyle{ \lim_{t \to \infty} \varphi_{zyy}(\mathbf{x}-\mathbf{P}) = 3b_2(b_2^2 + b_1^2) / (b_1^2 + b_2^2 + b_3^2)^{3/2}, }[/math] a quantity independent of the center [math]\displaystyle{ \mathbf{P}. }[/math] So on the given line,

[math]\displaystyle{ \lim_{t\to\infty} f_{zyy}(\mathbf{x}) = \lim_{t\to\infty}\sum_{i=1}^N w_i \varphi_{zyy}(\mathbf{x} - \mathbf{c}_i) = \left(\sum_{i=1}^N w_i\right)3b_2(b_2^2 + b_1^2) / (b_1^2 + b_2^2 + b_3^2)^{3/2} = 0. }[/math]

It is not quite enough to require that [math]\displaystyle{ \sum_{i=1}^N w_i =0, }[/math] because in what follows it is necessary for [math]\displaystyle{ f_{\alpha}g_{\beta} }[/math] to vanish at infinity, where [math]\displaystyle{ \alpha }[/math] and [math]\displaystyle{ \beta }[/math] are multi-indices such that [math]\displaystyle{ |\alpha|+|\beta|=2m-1. }[/math] For triharmonic [math]\displaystyle{ \varphi, }[/math] [math]\displaystyle{ w_i u_j\varphi_\alpha(\mathbf{x}-\mathbf{c}_i) \varphi_\beta(\mathbf{x} - \mathbf{d}_j) }[/math] (where [math]\displaystyle{ u_j }[/math] and [math]\displaystyle{ \mathbf{d}_j }[/math] are the weights and centers of [math]\displaystyle{ g }[/math]) is always a sum of total degree 5 polynomials in [math]\displaystyle{ x, }[/math] [math]\displaystyle{ y, }[/math] and [math]\displaystyle{ z }[/math] divided by the square root of a total degree 8 polynomial. Consider the behavior of these terms on the line [math]\displaystyle{ \mathbf{x} = \mathbf{a} + t\mathbf{b} }[/math] as [math]\displaystyle{ t }[/math] approaches infinity. The numerator is a degree 5 polynomial in [math]\displaystyle{ t. }[/math] Dividing numerator and denominator by [math]\displaystyle{ t^4 }[/math] leaves the degree 4 and 5 terms in the numerator and a function of [math]\displaystyle{ \mathbf{b} }[/math] only in the denominator. A degree 5 term divided by [math]\displaystyle{ t^4 }[/math] is a product of five [math]\displaystyle{ b }[/math] coordinates and [math]\displaystyle{ t. }[/math] The [math]\displaystyle{ \sum w = 0 }[/math] (and [math]\displaystyle{ \sum u=0 }[/math]) constraint makes this vanish everywhere on the line. A degree 4 term divided by [math]\displaystyle{ t^4 }[/math] is either a product of four [math]\displaystyle{ b }[/math] coordinates and an [math]\displaystyle{ a }[/math] coordinate or a product of four [math]\displaystyle{ b }[/math] coordinates and a single [math]\displaystyle{ c_i }[/math] or [math]\displaystyle{ d_j }[/math] coordinate. The [math]\displaystyle{ \sum w = 0 }[/math] constraint makes the first type of term vanish everywhere on the line. The additional constraints [math]\displaystyle{ \sum_{i=1}^N w_i \mathbf{c}_i = 0 }[/math] will make the second type of term vanish.

Now define the inner product of two functions [math]\displaystyle{ f,g:\mathbb{R}^d \to \mathbb{R} }[/math] defined as a linear combination of polyharmonic RBFs [math]\displaystyle{ \varphi_{m,d} }[/math] with [math]\displaystyle{ \sum w = 0 }[/math] and [math]\displaystyle{ \sum w \mathbf{c}=0 }[/math] as

[math]\displaystyle{ \langle f, g \rangle = \int_{\mathbb{R}^d} (\nabla^m f) \cdot (\nabla^m g) \, d\mathbf{x}. }[/math]

Integration by parts shows that

[math]\displaystyle{ \langle f,g\rangle = (-1)^m \int_{\mathbb{R}^d} f (\Delta^mg) \,d\mathbf{x}. }[/math]

 

 

 

 

(8)

For example, let [math]\displaystyle{ m=2 }[/math] and [math]\displaystyle{ d=2. }[/math] Then

[math]\displaystyle{ \langle f,g\rangle = \int_{-\infty}^\infty \int_{-\infty}^\infty (f_{xx}g_{xx} + 2f_{xy}g_{xy} + f_{yy}g_{yy}) \,dx \,dy. }[/math]

 

 

 

 

(9)

Integrating the first term of this by parts once yields

[math]\displaystyle{ \int_{-\infty}^\infty \int_{-\infty}^\infty f_{xx}g_{xx} \,dx \,dy = \int_{-\infty}^\infty f_x g_{xx}\big|_{-\infty}^{\infty} \,dy - \int_{-\infty}^{\infty}\int_{-\infty}^{\infty}f_x g_{xxx} \,dx \,dy = - \int_{-\infty}^\infty \int_{-\infty}^\infty f_x g_{xxx} \,dx \,dy }[/math]

since [math]\displaystyle{ f_x g_{xx} }[/math] vanishes at infinity. Integrating by parts again results in [math]\displaystyle{ \int_{-\infty}^\infty \int_{-\infty}^\infty f g_{xxxx} \,dx \,dy. }[/math]

So integrating by parts twice for each term of (9) yields

[math]\displaystyle{ \langle f,g\rangle = \int_{-\infty}^\infty \int_{-\infty}^\infty f (g_{xxxx} + 2g_{xxyy} + g_{yyyy}) \,dx \,dy = \int_{-\infty}^\infty \int_{-\infty}^\infty f (\Delta^2 g) \,dx \,dy. }[/math]

Since [math]\displaystyle{ (\Delta^m f)(\mathbf{x}) = \sum_{i=1}^N w_i C_{m,d}\delta(\mathbf{x - \mathbf{c}_i}), }[/math] (8) shows that

[math]\displaystyle{ \begin{align} \langle f,f\rangle &= (-1)^m \int_{\mathbb{R}^d} f(\mathbf{x}) \sum_{i=1}^N w_i (-1)^m C_{m,d}\delta(\mathbf{x - \mathbf{c}_i}) \,d\mathbf{x} = (-1)^m C_{m,d} \sum_{i=1}^N w_i f(\mathbf{c}_i) \\ &= (-1)^m C_{m,d} \sum_{i=1}^N \sum_{j=1}^N w_i w_j \varphi(\mathbf{c}_i - \mathbf{c}_j) = (-1)^m C_{m,d} \mathbf{w}^{\textrm{T}} A \mathbf{w}. \end{align} }[/math]

So if [math]\displaystyle{ \sum w = 0 }[/math] and [math]\displaystyle{ \sum w\mathbf{c} = 0 , }[/math]

[math]\displaystyle{ \int_{\mathbb{R}^d} |\nabla^m f|^2 \,d\mathbf{x} = (-1)^m C_{m,d} \mathbf{w}^{\textrm{T}} A \mathbf{w}. }[/math]

 

 

 

 

(10)

Now the origin of the constraints [math]\displaystyle{ B^{\textrm{T}}\mathbf{w} = 0 }[/math] can be explained. Here [math]\displaystyle{ B }[/math] is a generalization of the [math]\displaystyle{ B }[/math] defined above to possibly include monomials up to degree [math]\displaystyle{ m-1. }[/math] In other words, [math]\displaystyle{ B=\begin{bmatrix} 1 & 1 & \dots & 1\\ \mathbf{c}_1 & \mathbf{c}_2 & \dots & \mathbf{c}_N \\ \vdots & \vdots & \dots & \vdots \\ \mathbf{c}_1^{m-1} & \mathbf{c}_2^{m-1} & \dots & \mathbf{c}_N^{m-1} \end{bmatrix} ^ {\textrm{T}} }[/math] where [math]\displaystyle{ \mathbf{c}_i^j }[/math] is a column vector of all degree [math]\displaystyle{ j }[/math] monomials of the coordinates of [math]\displaystyle{ \mathbf{c}_i. }[/math] The top half of (2) is equivalent to [math]\displaystyle{ A\mathbf{w} + B\mathbf{v} - \mathbf{f} = 0. }[/math] So to obtain a smoothing spline, one should minimize the scalar field [math]\displaystyle{ F:\mathbb{R}^{N+d+1}\rightarrow \mathbb{R} }[/math] defined by

[math]\displaystyle{ F(\mathbf{w}, \mathbf{v}) = |A\mathbf{w} + B\mathbf{v} - \mathbf{f}|^2 + \lambda C \mathbf{w}^{\textrm{T}} A \mathbf{w}. }[/math]

The equations

[math]\displaystyle{ \frac{\partial F}{\partial w_i} = 2 A_{i*} (A\mathbf{w} + B\mathbf{v} - \mathbf{f}) + 2\lambda C A_{i*}\mathbf{w}=0 \quad \textrm{for} \ i=1,2,\ldots,N }[/math]

and

[math]\displaystyle{ \frac{\partial F}{\partial v_i} = 2 B^{\textrm{T}}_{i*} (A\mathbf{w} + B\mathbf{v} - \mathbf{f})=0 \quad \textrm{for} \ i=1,2,\ldots,d+1 }[/math]

(where [math]\displaystyle{ A_{i*} }[/math] denotes row [math]\displaystyle{ i }[/math] of [math]\displaystyle{ A }[/math]) are equivalent to the two systems of linear equations [math]\displaystyle{ A(A\mathbf{w} + B\mathbf{v} - \mathbf{f} +\lambda C \mathbf{w}) = 0 }[/math] and [math]\displaystyle{ B^{\textrm{T}}(A\mathbf{w} + B\mathbf{v} - \mathbf{f}) = 0. }[/math] Since [math]\displaystyle{ A }[/math] is invertible, the first system is equivalent to [math]\displaystyle{ A\mathbf{w} + B\mathbf{v} - \mathbf{f} +\lambda C \mathbf{w} = 0. }[/math] So the first system implies the second system is equivalent to [math]\displaystyle{ B^{\textrm{T}}\mathbf{w} = 0. }[/math] Just as in the previous smoothing spline coefficient derivation, the top half of (2) becomes [math]\displaystyle{ (A+\lambda C I)\mathbf{w} + B\mathbf{v} = \mathbf{f}. }[/math]

This derivation of the polyharmonic smoothing spline equation system did not assume the constraints necessary to guarantee that [math]\displaystyle{ \int_{\mathcal{\mathbb{R}}^d} |\nabla^m f|^2 \,d\mathbf{x} = C w^{\textrm{T}}Aw. }[/math] But the constraints necessary to guarantee this, [math]\displaystyle{ \sum w = 0 }[/math] and [math]\displaystyle{ \sum w \mathbf{c} = 0 , }[/math] are a subset of [math]\displaystyle{ B^{\textrm{T}}w=0 }[/math] which is true for the critical point [math]\displaystyle{ w }[/math] of [math]\displaystyle{ F. }[/math] So [math]\displaystyle{ \int_{\mathcal{\mathbb{R}}^d} |\nabla^m f|^2 \,d\mathbf{x} = C w^{\textrm{T}}Aw }[/math] is true for the [math]\displaystyle{ f }[/math] formed from the solution of the polyharmonic smoothing spline equation system. Because the integral is positive for all [math]\displaystyle{ w\neq 0, }[/math] the linear transformation resulting from the restriction of the domain of linear transformation [math]\displaystyle{ A }[/math] to [math]\displaystyle{ w }[/math] such that [math]\displaystyle{ B^T w = 0 }[/math] must be positive definite. This fact enables transforming the polyharmonic smoothing spline equation system to a symmetric positive definite system of equations that can be solved twice as fast using the Cholesky decomposition.[9]

Examples

The next figure shows the interpolation through four points (marked by "circles") using different types of polyharmonic splines. The "curvature" of the interpolated curves grows with the order of the spline and the extrapolation at the left boundary (x < 0) is reasonable. The figure also includes the radial basis functions φ = exp(−r2) which gives a good interpolation as well. Finally, the figure includes also the non-polyharmonic spline phi = r2 to demonstrate, that this radial basis function is not able to pass through the predefined points (the linear equation has no solution and is solved in a least squares sense).

Interpolation with different polyharmonic splines that shall pass the 4 predefined points marked by a circle (the interpolation with phi = r2 is not useful, since the linear equation system of the interpolation problem has no solution; it is solved in a least squares sense, but then does not pass the centers)

The next figure shows the same interpolation as in the first figure, with the only exception that the points to be interpolated are scaled by a factor of 100 (and the case phi = r2 is no longer included). Since φ = (scale·r)k = (scalekrk, the factor (scalek) can be extracted from matrix A of the linear equation system and therefore the solution is not influenced by the scaling. This is different for the logarithmic form of the spline, although the scaling has not much influence. This analysis is reflected in the figure, where the interpolation shows not much differences. Note, for other radial basis functions, such as φ = exp(−kr2) with k = 1, the interpolation is no longer reasonable and it would be necessary to adapt k.

The same interpolation as in the first figure, but the points to be interpolated are scaled by 100

The next figure shows the same interpolation as in the first figure, with the only exception that the polynomial term of the function is not taken into account (and the case phi = r2 is no longer included). As can be seen from the figure, the extrapolation for x < 0 is no longer as "natural" as in the first figure for some of the basis functions. This indicates, that the polynomial term is useful if extrapolation occurs.

The same interpolation as in the first figure, but without the polynomial term

See also

References

  1. R.L. Harder and R.N. Desmarais: Interpolation using surface splines. Journal of Aircraft, 1972, Issue 2, pp. 189−191
  2. J. Duchon: Splines minimizing rotation-invariant semi-norms in Sobolev spaces. Constructive Theory of Functions of Several Variables, W. Schempp and K. Zeller (eds), Springer, Berlin, pp. 85−100
  3. Wendland, Holger (2005). Scattered Data Approximation. Cambridge University Press. p. 9. ISBN 0521843359. https://archive.org/details/scattereddataapp00libg_040. 
  4. G.F. Fasshauer G.F.: Meshfree Approximation Methods with MATLAB. World Scientific Publishing Company, 2007, ISPN-10: 9812706348
  5. A. Iske: Multiresolution Methods in Scattered Data Modelling, Lecture Notes in Computational Science and Engineering, 2004, Vol. 37, ISBN:3-540-20479-2, Springer-Verlag, Heidelberg.
  6. R.K. Beatson, M.J.D. Powell, and A.M. Tan: Fast evaluation of polyharmonic splines in three dimensions. IMA Journal of Numerical Analysis, 2007, 27, pp. 427–450.
  7. J. B. Cherrie; R. K. Beatson; D. L. Ragozin (2000), Fast evaluation of radial basis functions: methods for four-dimensional polyharmonic splines 
  8. Damian Brown; Leevan Ling; Edward Kansa; Jeremy Levesley (2000), On Approximate Cardinal Preconditioning Methods for Solving PDEs with Radial Basis Functions 
  9. 9.0 9.1 Powell, M. J. D. (1993). "Some algorithms for thin plate spline interpolation to functions of two variables". Cambridge University Dept. Of Applied Mathematics and Theoretical Physics Technical Report. http://www.univie.ac.at/nuhag-php/bibtex/open_files/po94_M%20J%20D%20Powell%2003%2093.pdf. Retrieved January 7, 2016. 
  10. Evans, Lawrence (1998). Partial Differential Equations. Providence: American Mathematical Society. pp. 450−452. ISBN 0-8218-0772-2. https://archive.org/details/partialdifferent00evan_947. 

External links

Computer Code