Compute weights in thin plate spline radial basis function

interpolationradial-basis-functions

Consider the problem of approximating a function $f:R^n\rightarrow R$ using radial basis function(RBF). We are given with $p$ points $\{x^1,\ldots,x^p\}$ and their function values $\{y_1,\ldots,y_p\}$. We use the approximation function $g(x) = \sum_{i=1}^p w_i \varphi(||x-x^i||)$ where $w_i$ is the weight corresponding to point $x^i$. Let us use thin plate spline which is defined as $\varphi(r) = r^2 ln(r)$. In order to compute weights $w_i$, we solve the linear system $Az=b$ where $A_{ij} = \varphi(||x^i-x^j||)$, $z=(w_1,\ldots,w_p)^T$ and $b=(y_1,\ldots,y_p)^T$. The diagonal elements of $A$ are of the form $\phi(||x^i-x^i||)$ or $0\times ln(0)$ which is undefined.

How to compute the weights $w_i$ under such circumstances ? Should we consider diagonal elements as $0$ ?

Best Answer

In practical situations, you can simply use $r^2 \log(r+\epsilon)$

In my Matlab code, I use $\frac12 r^2 \log(r^2+\epsilon)$ with $\epsilon$ small