Polyharmonic spline

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 φ {\displaystyle \varphi } plus a polynomial term:

f ( x ) = i = 1 N w i φ ( | x c i | ) + v T [ 1 x ] {\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}}}

(1)

where

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

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

The polyharmonic RBFs are of the form:

φ ( r ) = { r k with  k = 1 , 3 , 5 , , r k ln ( r ) with  k = 2 , 4 , 6 , r = | x c i | = ( x c i ) T ( x c i ) . {\displaystyle {\begin{aligned}\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{aligned}}}

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

φ ( r ) = { r k 1 ln ( r r ) for  r < 1 , (this works because  0 0  is defined) r k ln ( r ) for  r 1. {\displaystyle \varphi (r)={\begin{cases}r^{k-1}\ln(r^{r})&{\text{for }}r<1,\quad {\text{(this works because }}0^{0}{\text{ is defined)}}\\r^{k}\ln(r)&{\text{for }}r\geq 1.\end{cases}}}

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

φ ( r ) = { 0 for  r < ϵ , (for some very small value of  ϵ , e.g. if using floating point numbers in double precisions,  ϵ = 10 200 ) r k ln ( r ) for  r ϵ . {\displaystyle \varphi (r)={\begin{cases}0&{\text{for }}r<\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\geq \epsilon .\end{cases}}}

The weights w i {\displaystyle w_{i}} and v j {\displaystyle v_{j}} are determined such that the function interpolates N {\displaystyle N} given points ( c i , f i ) {\displaystyle (\mathbf {c} _{i},f_{i})} (for i = 1 , 2 , , N {\displaystyle i=1,2,\ldots ,N} ) and fulfills the d + 1 {\displaystyle d+1} orthogonality conditions

i = 1 N w i = 0 , i = 1 N w i c i = 0 . {\displaystyle \sum _{i=1}^{N}w_{i}=0,\;\;\sum _{i=1}^{N}w_{i}\mathbf {c} _{i}=\mathbf {0} .}

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

[ A B B T 0 ] [ w v ] = [ f 0 ] {\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}}\;\;\;\;}

(2)

where

A i , j = φ ( | c i c j | ) , B = [ 1 1 1 c 1 c 2 c N ] T , f = [ f 1 , f 2 , , f N ] T . {\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}}.}

In order for this system of equations to have a unique solution, B {\displaystyle B} must be full rank. B {\displaystyle B} 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 B {\displaystyle B} 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 A {\displaystyle A} to the null space of B T {\textstyle B^{\textrm {T}}} is positive definite. This means that if B {\displaystyle B} 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 x R d {\displaystyle \mathbf {x} \in \mathbb {R} ^{d}} 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 e k r 2 {\displaystyle e^{-k\cdot r^{2}}} needs to be tuned, so that k {\displaystyle k} is selected according to the underlying grid of the independent variables. If this grid is non-uniform, a proper selection of k {\displaystyle k} 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 N {\displaystyle N} is large, since the memory required is O ( N 2 ) {\displaystyle O(N^{2})} and the number of operations required is O ( N 3 ) . {\displaystyle O(N^{3}).}
  • Evaluating the computed polyharmonic spline function at M {\displaystyle M} data points requires O ( M N ) {\displaystyle O(MN)} operations. In many applications (image processing is an example), M {\displaystyle M} is much larger than N , {\displaystyle N,} 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 k {\displaystyle k} 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 M {\displaystyle M} points changes from O ( N 3 + M N ) {\displaystyle O(N^{3}+MN)} to O ( k 3 M ) {\displaystyle O(k^{3}*M)} . This can yield better timings if k {\displaystyle k} is much less than N {\displaystyle N} . 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, k {\displaystyle k} . Recently, methods have been developed to overcome the aforementioned difficulties without sacrificing main advantages of polyharmonic splines.

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

  • Beatson et al.[6] present a method to interpolate polyharmonic splines with r 2 k 1 {\displaystyle r^{2k-1}} being a basis function at one point in 3 dimensions or less
  • Cherrie et al. [7] present a method to interpolate polyharmonic splines with r 2 k log r {\displaystyle r^{2k}\log r} 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 O ( N 3 ) {\displaystyle O(N^{3})} to O ( N 2 ) {\displaystyle O(N^{2})} , and further to O ( N log N ) {\displaystyle O(N\log N)} 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 O ( N 2 ) {\displaystyle O(N^{2})} to O ( N ) {\displaystyle O(N)} , 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 Δ m f = 0 {\displaystyle \Delta ^{m}f=0} for any natural number m {\displaystyle m} , where Δ {\displaystyle \Delta } is the Laplace operator. For example, the biharmonic equation is Δ 2 f = 0 {\displaystyle \Delta ^{2}f=0} and the triharmonic equation is Δ 3 f = 0 {\displaystyle \Delta ^{3}f=0} . 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 ( Δ = x x + y y {\displaystyle \Delta =\partial _{xx}+\partial _{yy}} ) to the thin plate radial basis function f tp ( x , y ) = ( x 2 + y 2 ) log x 2 + y 2 {\textstyle f_{\text{tp}}(x,y)=(x^{2}+y^{2})\log {\sqrt {x^{2}+y^{2}}}} either by hand or using a computer algebra system shows that Δ f tp = 4 + 4 log r {\displaystyle \Delta f_{\text{tp}}=4+4\log r} . Applying the Laplace operator to Δ f tp {\displaystyle \Delta f_{\text{tp}}} (this is Δ 2 f tp {\displaystyle \Delta ^{2}f_{\text{tp}}} ) yields 0. But 0 is not exactly correct. To see this, replace r 2 = x 2 + y 2 {\displaystyle r^{2}=x^{2}+y^{2}} with ρ 2 = x 2 + y 2 + h 2 {\displaystyle \rho ^{2}=x^{2}+y^{2}+h^{2}} (where h {\displaystyle h} is some small number tending to 0). The Laplace operator applied to 4 log ρ {\displaystyle 4\log \rho } yields Δ 2 f tp = 8 h 2 / ρ 4 {\displaystyle \Delta ^{2}f_{\text{tp}}=8h^{2}/\rho ^{4}} . For ( x , y ) = ( 0 , 0 ) , {\displaystyle (x,y)=(0,0),} the right hand side of this equation approaches infinity as h {\displaystyle h} approaches 0. For any other ( x , y ) {\displaystyle (x,y)} , the right hand side approaches 0 as h {\displaystyle h} approaches 0. This indicates that the right hand side is a Dirac delta function. A computer algebra system will show that

lim h 0 8 h 2 / ( x 2 + y 2 + h 2 ) 2 d x d y = 8 π . {\displaystyle \lim _{h\to 0}\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }8h^{2}/(x^{2}+y^{2}+h^{2})^{2}\,dx\,dy=8\pi .}

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

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

lim h 0 3 h 2 / ( x 2 + y 2 + z 2 + h 2 ) 5 / 2 d x d y d z = 4 π , {\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 ,}

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

Polyharmonic smoothing splines

Polyharmonic splines minimize

i = 1 N ( f ( c i ) f i ) 2 + λ B R d | m f | 2 d x {\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} }

(3)

where B {\displaystyle {\mathcal {B}}} is some box in R d {\displaystyle \mathbb {R} ^{d}} containing a neighborhood of all the centers, λ {\displaystyle \lambda } is some positive constant, and m f {\displaystyle \nabla ^{m}f} is the vector of all m {\displaystyle m} th order partial derivatives of f . {\displaystyle f.} For example, in 2D 1 f = ( f x   f y ) {\displaystyle \nabla ^{1}f=(f_{x}\ f_{y})} and 2 f = ( f x x   f x y   f y x   f y y ) {\displaystyle \nabla ^{2}f=(f_{xx}\ f_{xy}\ f_{yx}\ f_{yy})} and in 3D 2 f = ( f x x   f x y   f x z   f y x   f y y   f y z   f z x   f z y   f z z ) {\displaystyle \nabla ^{2}f=(f_{xx}\ f_{xy}\ f_{xz}\ f_{yx}\ f_{yy}\ f_{yz}\ f_{zx}\ f_{zy}\ f_{zz})} . In 2D | 2 f | 2 = f x x 2 + 2 f x y 2 + f y y 2 , {\displaystyle |\nabla ^{2}f|^{2}=f_{xx}^{2}+2f_{xy}^{2}+f_{yy}^{2},} 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:

i = 1 N ( f ( c i ) f i ) 2 = B i = 1 N ( f ( x ) f i ) 2 δ ( x c i ) d x . {\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} .}

So equation (3) can be written as the functional

J [ f ] = B F ( x , f , α 1 f , α 2 f , , α n f ) d x = B [ i = 1 N ( f ( x ) f i ) 2 δ ( x c i ) + λ | m f | 2 ] d x . {\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} .}

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

F f = 2 i = 1 N ( f ( x ) f i ) δ ( x x i ) {\displaystyle {\partial F \over \partial f}=2\sum _{i=1}^{N}(f(\mathbf {x} )-f_{i})\delta (\mathbf {x} -x_{i})}

and

i = 1 n α i F ( α i f ) = 2 λ Δ m f {\displaystyle \sum _{i=1}^{n}\partial ^{\alpha _{i}}{\partial F \over \partial (\partial ^{\alpha _{i}}f)}=2\lambda \Delta ^{m}f}

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

( i = 1 N ( f ( x ) f i ) δ ( x c i ) ) + ( 1 ) m λ Δ m f = 0. {\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.}

(4)

A weak solution f ( x ) {\displaystyle f(\mathbf {x} )} of (4) satisfies

B ( i = 1 N ( f ( x ) f i ) δ ( x c i ) ) g ( x ) + ( 1 ) m λ ( Δ m f ) g ( x ) d x = 0 {\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}

(5)

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

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

Δ m f = i = 1 M w i C m , d δ ( x c i ) {\displaystyle \Delta ^{m}f=\sum _{i=1}^{M}w_{i}C_{m,d}\delta (\mathbf {x} -\mathbf {c} _{i})}

where C 2 , 2 = 8 π , {\displaystyle C_{2,2}=8\pi ,} C 2 , 3 = 8 π , {\displaystyle C_{2,3}=-8\pi ,} and C 3 , 3 = 96 π . {\displaystyle C_{3,3}=-96\pi .} So (5) is equivalent to

B i = 1 N δ ( x c i ) ( f ( x ) f i + ( 1 ) m λ C m , d w i ) g ( x ) d x = i = 1 N ( f ( c i ) f i + ( 1 ) m λ C m , d w i ) g ( c i ) = 0. {\displaystyle {\begin{aligned}\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{aligned}}}

(6)

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

f ( c j ) f j + ( 1 ) m λ C m , d w j = 0 for   j = 1 , 2 , , N {\displaystyle f(\mathbf {c} _{j})-f_{j}+(-1)^{m}\lambda C_{m,d}w_{j}=0\quad {\text{for}}\ j=1,2,\ldots ,N}

(7)

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

Explanation of additional constraints

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

First, require that i = 1 N w i = 0. {\textstyle \sum _{i=1}^{N}w_{i}=0.} This ensures that all derivatives of order m {\displaystyle m} and higher of f ( x ) = i = 1 N w i φ ( | x c i | ) {\textstyle f(\mathbf {x} )=\sum _{i=1}^{N}w_{i}\varphi (|\mathbf {x} -\mathbf {c} _{i}|)} vanish at infinity. For example, let m = 3 {\displaystyle m=3} and d = 3 {\displaystyle d=3} and φ {\displaystyle \varphi } be the triharmonic RBF. Then φ z z y = 3 y ( x 2 + y 2 ) / ( x 2 + y 2 + z 2 ) 3 / 2 {\displaystyle \varphi _{zzy}=3y(x^{2}+y^{2})/(x^{2}+y^{2}+z^{2})^{3/2}} (considering φ {\displaystyle \varphi } as a mapping from R 3 {\displaystyle \mathbb {R} ^{3}} to R {\displaystyle \mathbb {R} } ). For a given center P = ( P 1 , P 2 , P 3 ) , {\displaystyle \mathbf {P} =(P_{1},P_{2},P_{3}),}

φ z z y ( x P ) = 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 . {\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}}}.}

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

φ z z y ( x P ) = 3 ( a 2 + b 2 t P 2 ) ( ( a 2 + b 2 t P 2 ) 2 + ( a 1 + b 1 t P 1 ) 2 ) ( ( a 1 + b 1 t P 1 ) 2 + ( a 2 + b 2 t P 2 ) 2 + ( a 3 + b 3 t P 3 ) 2 ) 3 / 2 . {\displaystyle \varphi _{zzy}(\mathbf {x} -\mathbf {P} )={\frac {3(a_{2}+b_{2}t-P_{2})((a_{2}+b_{2}t-P_{2})^{2}+(a_{1}+b_{1}t-P_{1})^{2})}{((a_{1}+b_{1}t-P_{1})^{2}+(a_{2}+b_{2}t-P_{2})^{2}+(a_{3}+b_{3}t-P_{3})^{2})^{3/2}}}.}

Dividing both numerator and denominator of this by t 3 {\displaystyle t^{3}} shows that lim t φ z y y ( x P ) = 3 b 2 ( b 2 2 + b 1 2 ) / ( b 1 2 + b 2 2 + b 3 2 ) 3 / 2 , {\textstyle \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},} a quantity independent of the center P . {\displaystyle \mathbf {P} .} So on the given line,

lim t f z y y ( x ) = lim t i = 1 N w i φ z y y ( x c i ) = ( i = 1 N w i ) 3 b 2 ( b 2 2 + b 1 2 ) / ( b 1 2 + b 2 2 + b 3 2 ) 3 / 2 = 0. {\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.}

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

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

f , g = R d ( m f ) ( m g ) d x . {\displaystyle \langle f,g\rangle =\int _{\mathbb {R} ^{d}}(\nabla ^{m}f)\cdot (\nabla ^{m}g)\,d\mathbf {x} .}

Integration by parts shows that

f , g = ( 1 ) m R d f ( Δ m g ) d x . {\displaystyle \langle f,g\rangle =(-1)^{m}\int _{\mathbb {R} ^{d}}f(\Delta ^{m}g)\,d\mathbf {x} .}

(8)

For example, let m = 2 {\displaystyle m=2} and d = 2. {\displaystyle d=2.} Then

f , g = ( f x x g x x + 2 f x y g x y + f y y g y y ) d x d y . {\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.}

(9)

Integrating the first term of this by parts once yields

f x x g x x d x d y = f x g x x | d y f x g x x x d x d y = f x g x x x d x d y {\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}

since f x g x x {\displaystyle f_{x}g_{xx}} vanishes at infinity. Integrating by parts again results in f g x x x x d x d y . {\textstyle \int _{-\infty }^{\infty }\int _{-\infty }^{\infty }fg_{xxxx}\,dx\,dy.}

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

f , g = f ( g x x x x + 2 g x x y y + g y y y y ) d x d y = f ( Δ 2 g ) d x d y . {\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.}

Since ( Δ m f ) ( x ) = i = 1 N w i C m , d δ ( x c i ) , {\textstyle (\Delta ^{m}f)(\mathbf {x} )=\sum _{i=1}^{N}w_{i}C_{m,d}\delta (\mathbf {x-\mathbf {c} _{i}} ),} (8) shows that

f , f = ( 1 ) m R d f ( x ) i = 1 N w i ( 1 ) m C m , d δ ( x c i ) d x = ( 1 ) m C m , d i = 1 N w i f ( c i ) = ( 1 ) m C m , d i = 1 N j = 1 N w i w j φ ( c i c j ) = ( 1 ) m C m , d w T A w . {\displaystyle {\begin{aligned}\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{aligned}}}

So if w = 0 {\textstyle \sum w=0} and w c = 0 , {\textstyle \sum w\mathbf {c} =0,}

R d | m f | 2 d x = ( 1 ) m C m , d w T A w . {\displaystyle \int _{\mathbb {R} ^{d}}|\nabla ^{m}f|^{2}\,d\mathbf {x} =(-1)^{m}C_{m,d}\mathbf {w} ^{\textrm {T}}A\mathbf {w} .}

(10)

Now the origin of the constraints B T w = 0 {\displaystyle B^{\textrm {T}}\mathbf {w} =0} can be explained. Here B {\displaystyle B} is a generalization of the B {\displaystyle B} defined above to possibly include monomials up to degree m 1. {\displaystyle m-1.} In other words,

B = [ 1 1 1 c 1 c 2 c N c 1 m 1 c 2 m 1 c N m 1 ] T {\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}}}
where c i j {\displaystyle \mathbf {c} _{i}^{j}} is a column vector of all degree j {\displaystyle j} monomials of the coordinates of c i . {\displaystyle \mathbf {c} _{i}.} The top half of (2) is equivalent to A w + B v f = 0. {\displaystyle A\mathbf {w} +B\mathbf {v} -\mathbf {f} =0.} So to obtain a smoothing spline, one should minimize the scalar field F : R N + d + 1 R {\displaystyle F:\mathbb {R} ^{N+d+1}\rightarrow \mathbb {R} } defined by

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

The equations

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

and

F v i = 2 B i T ( A w + B v f ) = 0 for   i = 1 , 2 , , d + 1 {\displaystyle {\frac {\partial F}{\partial v_{i}}}=2B_{i*}^{\textrm {T}}(A\mathbf {w} +B\mathbf {v} -\mathbf {f} )=0\quad {\textrm {for}}\ i=1,2,\ldots ,d+1}

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

This derivation of the polyharmonic smoothing spline equation system did not assume the constraints necessary to guarantee that R d | m f | 2 d x = C w T A w . {\textstyle \int _{{\mathcal {\mathbb {R} }}^{d}}|\nabla ^{m}f|^{2}\,d\mathbf {x} =Cw^{\textrm {T}}Aw.} But the constraints necessary to guarantee this, w = 0 {\textstyle \sum w=0} and w c = 0 , {\textstyle \sum w\mathbf {c} =0,} are a subset of B T w = 0 {\displaystyle B^{\textrm {T}}w=0} which is true for the critical point w {\displaystyle w} of F . {\displaystyle F.} So R d | m f | 2 d x = C w T A w {\textstyle \int _{{\mathcal {\mathbb {R} }}^{d}}|\nabla ^{m}f|^{2}\,d\mathbf {x} =Cw^{\textrm {T}}Aw} is true for the f {\displaystyle f} formed from the solution of the polyharmonic smoothing spline equation system. Because the integral is positive for all w 0 , {\displaystyle w\neq 0,} the linear transformation resulting from the restriction of the domain of linear transformation A {\displaystyle A} to w {\displaystyle w} such that B T w = 0 {\displaystyle B^{T}w=0} 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

  • Inverse distance weighting
  • Radial basis function
  • Subdivision surface (emerging alternative to spline-based surfaces)
  • Spline

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.
  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. ^ a b Powell, M. J. D. (1993). "Some algorithms for thin plate spline interpolation to functions of two variables" (PDF). Cambridge University Dept. Of Applied Mathematics and Theoretical Physics Technical Report. Archived from the original (PDF) on 2016-01-25. Retrieved January 7, 2016.
  10. ^ Evans, Lawrence (1998). Partial Differential Equations. Providence: American Mathematical Society. pp. 450−452. ISBN 0-8218-0772-2.

External links

Computer Code

  • Polyharmonic Spline, An interactive example with Matlab/Octave source code