Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

 Open In Colab

Radial basis functions are an n-dimensional interpolation technique that doesn’t rely on polynomials. Rather, we define a radial basis function, called a kernel, applied to each data point:

φi(∣∣x−xi∣∣)\varphi_i(||x-x_i||)

Commonly, we say φi(x=xi)≡1\varphi_i(x=x_i)\equiv 1.

The kernel only depends on the Euclidian distance between the associated data point, xix_i and the evaluation point xx (and are therefore radial).

The interpolation function y(x)y(x) is the weighted sum of the NN kernels:

y(x)=∑j=1Nωjφ(∣∣x−xj∣∣)y(x) = \sum_{j=1}^N \omega_j \varphi(||x-x_j||)

To determine the weights ωj\omega_j, we evaluate the function at each data point xix_i:

y(xi)=∑j=1Nωjφ(∣∣xi−xj∣∣)=yiy(x_i) = \sum_{j=1}^N \omega_j \varphi(||x_i-x_j||) = y_i

Applying this to all NN data points generates a linear system to solve for ωj\omega_j: $$

[φ(∥x1−x1∥)φ(∥x1−x2∥)⋯φ(∥x1−xN∥)φ(∥x2−x1∥)φ(∥x2−x2∥)⋯φ(∥x2−xN∥)⋮⋮⋱⋮φ(∥xN−x1∥)φ(∥xN−x2∥)⋯φ(∥xN−xN∥)]\begin{bmatrix} \varphi(\|x_1 - x_1\|) & \varphi(\|x_1 - x_2\|) & \cdots & \varphi(\|x_1 - x_N\|) \\ \varphi(\|x_2 - x_1\|) & \varphi(\|x_2 - x_2\|) & \cdots & \varphi(\|x_2 - x_N\|) \\ \vdots & \vdots & \ddots & \vdots \\ \varphi(\|x_N - x_1\|) & \varphi(\|x_N - x_2\|) & \cdots & \varphi(\|x_N - x_N\|) \end{bmatrix}

\omega_1 \ \omega_2 \ \vdots \ \omega_N \end{bmatrix} = \begin{bmatrix} y_1 \ y_2 \ \vdots \ y_N \end{bmatrix} $$

which we know how to solve!

RBF Kernels

Kernels are defined with r=∥x−xi∥r = \| x-x_i\| and a tuning parameter ϵ\epsilon. Some common simple kernels are:

KernelFormula
Gaussiane−ϵ2r2e^{-\epsilon^2 r^2}
Inverse quadratic11+[ϵr]2\frac{1}{1+[\epsilon r ]^2}
Inverse multiquadric11+[ϵr]2\frac{1}{\sqrt{1+[\epsilon r ]^2}}

Determination of optimal ϵ\epsilon is a nuanced question, but a good rule of thumb is to use the average distance between samples.

ϵ=1avg∥xi−xj∥\epsilon = \frac{1}{avg \|x_i-x_j\|}

We will see that its choice has a large effect on the condition number of the matrix, and therefore the numerical robustness!

Let’s see the kernels:

1D RBF Interpolation

For these kernels, the influence of a data point diminishes the further from them you get.

In general, φi(r=0)\varphi_i(r=0) is not necessarily 1, and φ(r→∞)≠0\varphi(r \rightarrow \infty) \ne 0, but this requires one more key factor to implement robustly.

Example - Our Toy problem from last lecture (Gaussian sampled at 10 points, equally spaced)

2D RBF Interpolation

Note this is a great result, but it works because the true function tends to zero outside of the data samples.

Example - 2D gaussian