LectureNotes New PDF
LectureNotes New PDF
These lecture notes were inspired mainly by two seminal books on the topic by Holger
Wendland [74] and by Gregory E. Fasshauer [32]. The first presents more theoretical aspects
while the second provides also useful Matlab functions for understanding better the theory
and all the applictions discussed. The notes have then been used during a short teaching-
visit of the author to the University of Antwerp, for the Erasmus Teaching Staff Mobility.
People interested on radial basis functions, can refer to the wide literature available
that, especially in the last two decades, has grown very fast. The popularity of radial basis
functions can be understood by means of the following ”parallelism”. In many cooking
recepies the parsley is used to give flavour and colour to dishes. Radial basis functions
can be considered as a mathematical parsley since they have been used in all mathematical
problems requiring a powerful, i.e. efficient and stable, approximation tool.
These lectures were thoughts for students without a strong background on functional
analysis, so in the presentation of the topics we deliberately avoid, when possible, to intro-
duce functional analysis concepts. This is a great lack, but we hope that the people who
will use these notes will be not too critical to us.
Moreover, these are only introductory lectures and some examples on the topic.
Many important aspects and applications, for lack of time and because there are many
other books (see e.g. [74, 32, ?]), are not considered. Every lecture provides also a set of
exercises solvable by using Matlab. This choice has been done with the aim of making the
discussion more interesting from both the numerical and geometrical point of view.
We do hope that after this brief introduction, interested students will be encouraged
and also interested in getting into this fascinating mathematical tool that has become more
and more popular in used and popular in many fields.
2
Contents
1.1 Motivations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.1 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3
S. De Marchi, E. Perracchione Lectures on radial basis functions
4 Error estimates 49
4.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
6.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7 Financial applications 83
8 Software for PU 93
References 107
5
S. De Marchi, E. Perracchione Lectures on radial basis functions
6
List of Figures
1.2 A typical basis function for the Euclidean distance matrix fit, Bk (x) = kx −
xk k2 with xk = 0 and d = 2. . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.3 tensor products of equally spaced points and tensor products of Chebyshev
points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.3 First row: G-L when d = 1 and n = 1, 2. Second row: G-L for d = 2
and n = 1, 2. In both cases we used the scaling factor = 3. For the two
dimensional case we also normalized so that Φ(0) = 1. . . . . . . . . . . . 36
4.2 Power function for the Gaussian kernel with = 6 on a grid of 81 uniform,
Chebyshev and Halton points, respectively. . . . . . . . . . . . . . . . . . . 52
4.3 Trial and error strategy for the interpolation of the 1-dimensional sinc func-
tion by the Gaussian for ∈ [0, 20], taking 100 values of and for different
equispaced data points. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.4 The sup-norm of the 2D power function on uniform points for the Gaussian
kernel, varying ∈ [0, 20] for different values of N . . . . . . . . . . . . . . 57
4.5 LOOCV 1d: sup norm of the error on Chebyshev points for the Gaussian
kernel, varying ∈ [0, 20] for different values of N . . . . . . . . . . . . . . 58
5.2 An example of a 2D partitioning structure: the k-th block (red solid line),
a subdomain centre belonging to the k-th block (magenta circle) and the
neighborhood set (green dashed line). . . . . . . . . . . . . . . . . . . . . . 66
5.4 Inconsistent normals estimation (left) and consistent set of normals (right). 72
5.5 The augmented data set (left) and the surface interpolating the augmented
data set (right). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.6 The interpolant curve, i.e. the zero contour of the interpolant surface. . . . 73
6.1 The approximate solution computed on N = 289 Halton data with the Gaus-
sian C ∞ kernel as local approximant. . . . . . . . . . . . . . . . . . . . . . . 82
8
List of Tables
9
S. De Marchi, E. Perracchione Lectures on radial basis functions
10
Introduction
These lectures focus on recent theoretical and computational aspects (implemented with the
Matlab software) in the field of scattered data approximation. More precisely, our attention
is devoted to meshfree or meshless methods. Indeed, taking advantage of being independent
of a mesh, they turn out to be truly performing in high dimensions. Unfortunately, not all
of them allow to deal with a large number of points. Therefore, we also review the basic
theory concerning local methods and in particular the Partition of Unity (PU) method.
Furthermore, we give a general outline of collocation methods via RBF.
Historical remarks
Even if here we consider meshfree methods in the context of approximation theory, we have
to point out that they have been used for the first time in statistics. In fact, their study
began in 1870 with the work of W.S.B. Woolhouse [76]. It has been further developed few
years later by E.L. De Forest [21, 22] and in 1883 by J.P. Gram [38]. Such works gave rise to
moving least squares approximation (also known as local regression in statistic literature).
For what concerns approximation theory, the historical and theoretical foundation of
meshless methods lies in the concept of positive definite functions or, more in general,
positive definite kernels. Their development can be traced back to both the work of J.
Mercer (1909) [57], a Fellow of Trinity College at Cambridge University, and the one of
M. Mathias (1923) [50], who was a student at the University of Berlin. Their studies have
been linked to Fourier transforms in the 1930s by S. Bochner [5], lecturer at the University
of Munich at that time, and by I. Schoenberg [66], who was assistant professor at Colby
College. Further studies about positive definite functions up to the mid 1970s have been
collected by J. Stewart [71]. Later, C.A. Micchelli in 1986 made the connection between
scattered data interpolation and positive definite functions [59]. At the same time, E.J.
Kansa gave rise to the first methods for solving PDEs via meshless methods [48].
Many positive definite functions are nowadays classified as RBFs. Such term appeared
for the first time in a publication made by N. Dyn and D. Levin in 1983 [30]. However,
earlier in the 1970s, many researchers introduced functions that are now called RBFs. For
instance, the term multiquadrics is due to R. Hardy, geodesist at Iowa State University [40].
11
S. De Marchi, E. Perracchione Lectures on radial basis functions
Moreover, in 1972 R.L. Harder and R.N. Desmarais, two aerospace engineers, introduced the
Thin Plate Splines (TPSs) [39]. Always at the same time, such functions appeared in several
papers by J. Duchon, a mathematician at the Université Joseph Fourier in Grenoble [27,
28, 29]. Furthermore, we also have to mention J. Meingnet who, working at the Université
Catholique de Luouvain, in 1970s introduced what are now known as polyharmonic splines
[52, 53, 54, 55]. However, in the theory of RBFs the main step forward has been carried
out by R. Franke in the 1980s. He proposed a comprehensive study about several methods
for multivariate interpolation [34, 35].
Finally, concerning local techniques, we can affirm that the pioneer of the PU scheme
has been D. Shepard. In fact, in the late 1960s he introduced, as an undergraduate student
at Harvard University, what are now called the Shepard weights [69]. His studies have
been motivated by the fields of geophysics and meteorology. Moreover, related to the same
topics, we also have to mention few papers that contain sentences and traces which seem to
indicate that the Shepard’s scheme was known before his work (see the paper by I.K. Crain
and B.K. Bhattacharyya (1967) [18] or the one by W.R. Goodin et al. [36]).
Aside from this short historical remark, in this dissertation we mainly refer to the recent
books by M.D. Buhmann, G.E. Fasshauer, M.J. McCourt and H. Wendland [8, 32, 33, 74].
12
Lecture 1
1.1 Motivations
In many cases the data are scattered, that is they have no special structure, and they
are in a big amount (several millions). Moreover in several applications the data sites are
considered in high dimension. Hence, for a unifying approach, methods have been developed
in the last decades with the aim to meet all these (new) situations.
We start from the univariate setting. We suppose that the data sites are ordered as follows
and we have some data values f1 , . . . , fN to be interpolated at the data set X. What we
want to do, mathematically speaking, is finding s : [a, b] → R with the property s(xj ) = fj
for all j = 1, . . . , N .
Notice, that the data values fj is not necessary stem from a function f but we shall
keep in mind this possibility for reasons that will become clearer later.
In the univariate setting, a simple solution of the above problem consists in taking
s as polynomial p of degree at most N − 1. However, as we can see later, this solution
is not working in higher dimensions. Remaining in the univariate case, no one with
13
S. De Marchi, E. Perracchione Lectures on radial basis functions
Let us review briefly the main properties of univariate splines, especially in the case of
cubic splines. The set of cubic splines corresponding to the subdivision (1.1) is the space
with a = x0 and xN +1 = b. The space S3 (X) has dimension N + 4, so that the interpolation
conditions s(xi ) = fi , 1 ≤ i ≤ N are not sufficient to guarantee a unique interpolant. To
enforce uniqueness, in the case of natural splines, i.e. the set
that consists of all cubic splines that are linear polynomials on the outer intervals [a, x1 ] and
[xN , b]. It come easy to see that a cubic spline s is a natural spline if and only if it satisfies
s00 (x1 ) = s(3) (x1 ) = 0 and s00 (xN ) = s(3) (xN ) = 0. With this choice we have imposed 4
additional conditions to the space, so it is natural to assume that the dim(N3 (X)) = N .
Even more, it can be shown that the initial interpolation problem has a unique solution in
N3 (X).
2. An interpolating natural cubic spline satisfies a minimal norm property. Assume that
f comes from the Sobolev space H2 [a, b], i.e. f is continuous in [a, b] and has weak
first and second order derivatives in L2 [a, b] (a more precise definition will be done
later or can be found in any books of functional analysis). Assume further that f is
such that f (xj ) = fj , 1 ≤ j ≤ N . If sf,X denotes the natural cubic spline interpolant
(at the data set X) then
indicating that the natural cubic splines interpolant is the function from H2 [a, b] that
minimizes the semi-norm kf 00 k2L2 [a,b] under the conditions f (xj ) = fj , 1 ≤ j ≤ N .
3. They possess a local basis called B-splines. This basis, which is more stable than any
other, can be defined by recursion, by divided differences of the truncated cubic power
p(x; t) = (x − t)3+ or by convolution. Here x+ takes the value of x for nonnegative x
and zero otherwise.
14
S. De Marchi, E. Perracchione Lectures on radial basis functions
Interested readers on splines and their many properties can refer to the following funda-
mental books by Schumaker [67] or de Boor [23].
Remarks
• Property 1. combined with the local basis, not only allows the efficient computation
and evaluation of splines but also is the key ingredient for a simple error analysis.
Hence, the natural way of extending splines to the multivariate setting is
based on this property. To this end, a bounded region Ω ⊂ Rd is partitioned
into essentially disjoint regions {Ωj }N
j=1 (patches). Then the spline space consists of
those functions s that are piecewise polynomials on each Ωj and that have smooth
connections on the boundaries of two adjacent patches. In two dimensions the most
popular subdivision of a polygonal region is by triangles. It is interesting to note
that even in this simple case, the dimension of the spline space is in general unknown.
When coming to higher dimensions it is not all clear what an appropriate replacement
for the triangulation would be. Hence, even if great progresses have been made in the
2-dimensional setting, the method is not suited for general dimensions.
• Another possible generalization to the multivariate setting is based on the property
3. In particular a construction based on convolution led to the so called Box-splines.
Again, even in the 2-dimensions the problem can be handle, for higher dimensions is
still an open problem.
The property 2. is the motivation for a general framework in higher dimensions. This
approach has allowed to develop a beautiful theory where all space dimensions can be
handled in the same way. The resulting approximation spaces no longer consist of piecewise
polynomials, so they can not be called splines. The new functions are known with the
”fashionable words” of Radial Basis Functions (in what follows we refer to them simply as
RBF).
To get a better idea, let us remind that the set S3 (X) has the basis of truncated powers
(· − xj )3+ , 1 ≤ j ≤ N plus an arbitrary basis for P3 (R). Hence every s ∈ N3 (X) can be
represented in the form
N
X 3
X
s(x) = aj (x − xj )3+ + bj xj , x ∈ [a, b] . (1.4)
j=1 j=0
Because s is a natural spline we have the additional information that s is linear on the two
outer intervals. That is on [a, x1 ] the spline is simply s(x) = b0 + b1 x (since b2 = b3 = 0).
Thus (1.4) becomes
N
X
s(x) = aj (x − xj )3+ + b0 + b1 x, x ∈ [a, x1 ] . (1.5)
j=1
15
S. De Marchi, E. Perracchione Lectures on radial basis functions
3 N
X 3 X
s(x) = (−1)3−l aj xj3−l xl + b0 + b1 x, x ∈ [xN , b] . (1.6)
l
l=0 j=1
N
X N
X
aj = aj xj = 0 . (1.7)
j=1 j=1
1 PN 3 3 PN 2
where ãj = aj /2, 1 ≤ j ≤ N , b̃0 = b0 − 2 j=1 aj xj and b̃1 = b1 + 2 j=1 aj xj .
where φ(r) = r3 , r ≥ 0 and p ∈ P1 (R). The coefficients {aj } have to satisfy the relations
(6.1.4). On the contrary, for every set X = {x1 , . . . , xN } ⊂ R of pairwise distinct points and
for every f ∈ RN there exists a function s of the form (6.1.4), with (6.1.4), that interpolates
the data, i.e. s(xj ) = f (xj ), 1 ≤ j ≤ N .
This is the starting point for understanding the origin of RBF. The resulting interpolant
is, up to a low-degree polynomial, a linear combination of shifts of a radial function Φ =
φ(| · |). The function is then called radial because is the composition of a univariate function
with the Euclidean norm on R.
The generalization to Rd is straightforward where the name ”radial” becomes even more
evident. In fact
16
S. De Marchi, E. Perracchione Lectures on radial basis functions
N
X
s(x) = aj φ(kx − xj k2 ) + p(x), x ∈ Rd , (1.9)
i=1
where φ : [0, ∞) → R is a univariate fixed function and p ∈ Pm−1 (Rd ) is a low degree d-
variate polynomial. The additional conditions on the coefficients (corresponding to (6.1.4))
become
XN
aj q(xj ) = 0, ∀ q ∈ Pm−1 (Rd ) . (1.10)
i=1
In many cases (see Lecture 2), we can avoid the side conditions on the coefficients
(1.10). In these cases the interpolation problem has solution if the matrix
Problem 1. Does there exist a function φ : [0, ∞) → R such that for all d, N ∈ N and all
pairwise distrinct x1 , . . . , xn ∈ Rd the matrix Aφ,X is nonsingular ?
The answer is affirmative. Examples of functions that allow to build matrices nonsin-
2
gular are: the gaussians φ(r) = e−αr , α > 0, the inverse multiquadric φ(r) = (c2 + r2 )−1/2
and the multiquadric φ(r) = (c2 + r2 )1/2 , c > 0. In the two first cases it is even true that
the matrix Aφ,X is always positive definite (and so invertible).
Remark. In what follows, in the context of RBFs, instead of Aφ,X we shall use simply
A thinking to the interpolation matrix with radial basis functions.
In many disciplines one faces the following problem: we are given a set of data (measure-
ments, locations at which these measurements are taken,...) and we want to find a rule
which allows to get information about the process we are studying also at locations different
from those at which the measurements are taken (or provided).
The main reasons why we are interested on such a problem in our setting are:
Solving the interpolation problem under this assumption leads to a system of linear
equations of the form
Ac = y,
where the entries of the interpolation matrix A are given by Ajk = Bk (xj ), j, k = 1, . . . , N ,
c = [c1 , . . . , cN ]T , and y = [y1 , . . . , yN ]T .
The scattered data fitting problem will be well-posed, that is a solution to the problem
will exist and be unique, if and only if the matrix A is non-singular.
18
S. De Marchi, E. Perracchione Lectures on radial basis functions
Definition 1. Let the finite-dimensional linear function space B ⊂ C(Ω) have a basis
{B1 , . . . , BN }. Then B is a Haar space on Ω if
det(A) 6= 0
for any set of distinct points x1 , . . . , xN ∈ Ω. Here, A is the matrix with entries Ai,j =
Bj (xi ).
The existence of a Haar space guarantees the invertibility of the matrix A. In the
univariate setting it is well known that one can interpolate to arbitrary data at N distinct
data sites using a polynomial of degree N − 1. This means that the polynomials of degree
N − 1 form an N -dimensional Haar space for the set of distinct points X = {x1 , . . . , xN }.
Theorem 1. (Haar-Mairhuber-Curtis)
If Ω ⊂ Rd , d ≥ 2 contains an interior point, then there exist no Haar spaces of continuous
functions except for the 1-dimensional case.
Proof. Let d ≥ 2 and assume that B is a Haar space with basis {B1 , . . . , BN } with
N ≥ 2. We show that this leads to a contradiction. In fact, let x1 , . . . , xn be a set of N
distinct points in Ω ⊂ Rd and A the matrix such that Aj,k = Bk (xj ), j, k = 1, . . . , N . By the
above definition of Haar space det(A) 6= 0. Now, consider the closed path P in Ω connecting
only x1 and x2 . This is possibile since Ω by assumption contains an interior point. We
then can exchange x1 and x2 by moving them continuosly along P (without interfering
with other point xj ). This means that the rows 1 and 2 of the matrix A have been changed
and so the determinant has changed sign. Since the determinant is a continuous function
of x1 and x2 we must have had det(A) = 0 at some point along P . This contradicts the
fact that det(A) 6= 0.
19
S. De Marchi, E. Perracchione Lectures on radial basis functions
d
Y
For example fd (x) = 4d xk (1 − xk ), x = (x1 , . . . , xd ) ∈ [0, 1]d , which is zeros on the
k=1
boundary of the unit cube in Rd and has a maximum value of one at the center of the
d-dimensional cube.
Assume for now that d = 1. We have already seen that for small N one can use
univariate polynomials; if N is relatively large it is better to use splines (the simplest
approach is the C 0 piecewise linear splines “connect the dots”)
{Bk = | · −xk | k = 1, . . . , N } .
N
X
Pf (x) = ck |x − xk |, x ∈ [0, 1]
k=1
Pf (xj ) = f1 (xj ), j = 1, . . . , N
Some observations.
• The basis functions Bk = | · −xk | are dependent on the data sites xk as suggested by
Haar-Mairhuber-Curtis.
• The points xk to which the basic function is shifted to form the basis functions, are
usually referred to as centers or knots.
• Technically, one could choose these centers different from the data sites. However,
usually centers coincide with the data sites. This simplifies the analysis of the method,
and is sufficient for many applications. In fact, relatively little is known about the
case when centers and data sites differ.
Now the coefficients ck in the scattered data interpolation problem are found by solving
the linear system
|x1 − x1 | |x1 − x2 | . . . |x1 − xN | c1 f1 (x1 )
|x2 − x1 | |x2 − x2 | . . . |x2 − xN | c2 f1 (x2 )
.. = (1.12)
.. .. . . .. ..
. . . . . .
|xN − x1 | |xN − x2 | . . . |xN − xN | cN f1 (xN )
• Distance matrices have been studied in geometry and analysis in the context of iso-
metric embeddings of metric spaces for a long time.
• It is known that the distance matrix based on the Euclidean distance between a set
of distinct points in Rd is always non-singular (see below).
Since distance matrices are non-singular for Euclidean distances in any space dimension
d we have an immediate generalization: for the scattered data interpolation problem on
[0, 1]d we can take
XN
Pf (x) = ck kx − xk k2 , x ∈ [0, 1]d , (1.13)
k=1
and find the ck by solving
kx1 − x1 k2 kx1 − x2 k2 ... kx1 − xN k2 c1 fd (x1 )
kx2 − x1 k2 kx2 − x2 k2 ... kx2 − xN k2 c2 fd (x2 )
= .
.. .. .. .. .. ..
. . . . . .
kxN − x1 k2 kxN − x2 k2 . . . kxN − xN k2 cN fd (xN )
• Piecewise linear splines in higher space dimensions are usually constructed differently
(via a cardinal basis on an underlying computational mesh)
• For d > 1 the space span{k · −xk k2 , k = 1, . . . , N } is not the same as piecewise linear
splines
In order to show the non-singularity of our distance matrices we use the Courant-Fischer
theorem (see for example the book by Meyer [58]):
Theorem 2. Let A be a real symmetric N ×N matrix with eigenvalues λ1 ≥ λ2 ≥ · · · ≥ λN ,
then
λk = max min xT Ax and λk = min max xT Ax.
dimV=k x∈V dimV=N −k+1 x∈V
kxk=1 kxk=1
21
S. De Marchi, E. Perracchione Lectures on radial basis functions
Figure 1.2: A typical basis function for the Euclidean distance matrix fit, Bk (x) = kx−xk k2
with xk = 0 and d = 2.
N
X
for all c = [c1 , . . . , cN ]T 6= 0 ∈ RN that satisfy cj = 0.
j=1
N
X
so that A has at least N − 1 negative eigenvalues. But since tr(A) = λk ≥ 0, A also
k=1
must have at least one positive eigenvalue.
Depending on the type of approximation problem we are given, we may or may not be able
to select where the data is collected, i.e., the location of the data sites or design.
Standard choices in low space dimensions are depicted in Fig. 1.3. In higher space di-
mensions it is important to have space-filling (or low-discrepancy) quasi-random point sets.
Examples include: Halton points, Sobol points, lattice designs, Latin hypercube
designs and quite a few others (digital nets, Faure, Niederreiter, etc.).
Figure 1.3: tensor products of equally spaced points and tensor products of Chebyshev
points
23
S. De Marchi, E. Perracchione Lectures on radial basis functions
Here we show how one can generate Halton points in every spatial dimension. Halton
points are uniformely distributed random point in (0, 1)d generated from Van der Corput
sequences. We start by generating Van der Corput sequences. Let k ∈ N be chosen.
where the coefficients ai are integer such that 0 ≤ ai < p. For example taking n = 10
and p = 3
10 = 1 · 30 + 0 · 31 + 1 · 32
giving k = 2, a0 = a2 = 1, a1 = 0.
Pk
i=0 ai
(ii) We define the function hp : N → [0, 1) as hp (n) = pi+1
. For example
1 1 10
hp (10) = + = .
3 33 27
In our example
1 2 1 4 7 2 5 8 1 10
h3,10 = {0, , , , , , , , , , } .
3 3 9 9 9 9 9 9 27 27
Starting from the Van der Corput sequence, the Halton seqnuence is generated as follows:
take d distinct primes p1 , . . . , pd and generated hp1 ,N , . . . , hpd ,N that we use as coor-
dinates of d-dimensional points, so that
Proposition 2. Halton points form a nested sequence, that is if M < N then Hd,M ⊂ Hd,N .
24
S. De Marchi, E. Perracchione Lectures on radial basis functions
These points can be constructed sequentially. Similar to these points are Leja se-
quences [24]. As a final observation, for Halton points we have
C(log N )d
DN (Hd,N ) ≤ .
N
The difference between the standard (tensor product) designs and the quasi-random
designs shows especially in higher space dimensions, as shown in Fig. 1.6
25
S. De Marchi, E. Perracchione Lectures on radial basis functions
1.4 Exercises
In practice, using different colours plot the Halton points for different values of M
and N .
3. Again, by using the function DistanceMatrix.m on different set of Halton points of di-
mension d = 2, verify that the corresponding distance-matrix, say A, is ill-conditioned,
by computing its condtion number in the 2-norm (in Matlab cond(A)).
5. Repeat the previous exercise by using the Gaussian radial basis function, Φ(x) =
2 2
e− kxk , > 0 again for d = 2. For accomplish this interpolation, use the function
RBFInterpolation2D.m that generalizes the DistanceMatrixFit.m.
http://www.math.unipd.it/∼demarchi/TAA2010
27
S. De Marchi, E. Perracchione Lectures on radial basis functions
28
Lecture 2
In the first lecture we saw that the scattered data interpolation problem with RBFs leads
to the solution of a linear system
Ac = y
with Ai,j = φ(kxi − xj k2 ) and yi the i-th data value. The solution of the system requires
that the matrix A is non-singular. The situation is favourable if we know in advance that
the matrix is positive definite. Moroever we would like to characterize the class of functions
φ for which the matrix is positive definite.
for c ∈ RN . If the quadratic form (2.1) is zero only for c = 0 then A is called positive
definite (sometimes we will use the shorthand notation PD).
The most important property of such matrices, is that their eigenvalues are positive and
so is its determinant. The contrary is not true, that is a matrix with positive determinant
is not necessarly positive definite. Just consider as a trivial example the matrix (in Matlab
notation) A=[-1 0 ; 0 -3] whose determinant is positive, but A is not PD.
29
S. De Marchi, E. Perracchione Lectures on radial basis functions
Hence, if in (1.11) the basis Bk generates a positive definite interpolation matrix that
we would always have a well-defined interpolation problem. In order to get such property,
we need to introduce the class of positive definite functions.
is nonnegative. The function Φ is then called positive definite if the quadratic form
above is positive for c ∈ CN , c 6= 0.
Ty
Example 4. The function Φ(x) = eix , for a fixed y ∈ Rd , is PD on Rd . If fact,
N X
N N X
N
Ty
X X
ci c̄j Φ(xi − xj ) = ci c̄j ei(xi −xj )
i=1 j=1 i=1 j=1
N
! N
T T
c̄j e−ixj y
X X
= ci eixi y
i=1 j=1
N 2
X
ixT y
= ci e ≥ 0.
i
i=1
Remark. From the previous definition and the discussion done on Lecture 1, we
should usePPD functions as basis, i.e. Bi (x) = Φ(x − xi ), that is an interpolant of the form
N
Pf (x) = i=1 ci Bi (x). Moreover at this point, we do not need Pf be a radial function, but
simply translation invariant (that is, Pf is the same as the translated interpolant to the
original data). We will characterize PD and radial functions in Rd later in this lecture.
These functions have some properties that we summarize in the following theorem.
Theorem 4. Suppose Φ is a positive semi-definite function. Then
Proof. If Φ is PD and real valued, then it is even by the previous theorem (by property
2.). Letting ck = ak + i bk then
N
X N
X
ci c̄j Φ(xi − xj ) = (ai aj + bi bj )Φ(xi − xj ) +
i,j=1 i,j=1
N
X
+ i aj bi [Φ(xi − xj ) − Φ(xj − xi )] .
i,j=1
As Φ is even, the second sum on the right hand side is zero. The first sum is nonnegative
bacause of the assumption, vanishing only if ai = bi = 0.
ix −ix
Example 5. The cosine function is PD on R. In fact, for all x ∈ R, cos x = e +e
2 . By
property 4. of Theorem 4 and the fact that the exponential is PD (see Example 4), we
conclude.
When we are dealing with radial functions i.e Φ(x) = φ(kxk), then it will be con-
venient to refer to the univariate function φ as positive definite radial function. A
consequence of this notational convention is the following Lemma.
31
S. De Marchi, E. Perracchione Lectures on radial basis functions
The classical way to characterize PD and radial functions is by this Theorem, due to Schoen-
berg [66].
where (
cos(r) d=1
Ωd (r) = d 2 (d−2)/2
Γ( 2 ) r J(d−2)/2 (r) d ≥ 2
Here Jν is the classical Bessel function of the first kind of order ν, that is the solution of
the Bessel differential equation. For example, around x = 0, this function can be expressed
as the Taylor series
∞
X (−1)k x 2k+ν
Jν (x) = .
k! Γ(k + ν + 1) 2
k=0
In particular, as already seen, Φ(x) = cos(x) can be seen as a fundamental PD and radial
function on R.
Observation. Since these lectures are intended for people with no preperation and
mathematical background on measure theory and functional analysis, we prefer to avoid to
introduce more results characterizing PD functions by using (Fourier) transforms. We prefer
to use another and more comprehensible approach based on the definition of completely
monotone and multiply monotone functions. Interested readers can satisfy their hunger for
knowledge by looking at the books [8, 32, 74].
In the framed Theorem 6 and successive remark, we observed that we avoid to characterize
the positive definiteness of RBF using Fourier transforms, also because Fourier transforms
are not always easy to compute.
This definition allows to verify when a function φ is positive definite and radial for all
dimensions d.
Here we enumerate some of the most important PD functions showing that they are
CM.
1
3. The function φ(r) = (1+r)β
, β ≥ 0 is CM on [0, ∞) since
There are now two Theorems to quote that give more informations
Hence as a consequence of these two theorems, the functions φ(r) = e−cr , c > 0 and
1 d
φ(r) = (1+r)β , β ≥ 0 are CM on [0, ∞) and since they are not constant, in R for all d,
we have
2 2
1. Φ(x) = e−c kxk , c > 0 is positive definite and radial on Rd for all d. This is
the family of Gaussians. The parameter c is a shape parameter that change the
shape of the function, making it more spiky when c → ∞ and flatter when c → 0.
2. Φ(x) = (1 + kxk2 )−β , β ≥ 0 is positive definite and radial on Rd for all d. This
is the family of inverse multiquadrics.
This characterization allows to check when a function is PD and radial on Rd for some
fixed d.
33
S. De Marchi, E. Perracchione Lectures on radial basis functions
Definition 7. A function φ : (0, ∞) → R which is C s−2 (0, ∞), s ≥ 0 and for which
(−1)k φ(k) (r) ≥ 0, non-increasing and convex for k = 0, 1, . . . , s − 2 is called s times
monotone on (0, ∞). In case s = 1 we only require φ ∈ C(0, ∞) to be non-negative and
non-increasing.
In what follows sometimes we use the shorthand notation MM for multiply monotone func-
tions.
Convexity can be expressed by the inequality φ00 ≥ 0 if φ00 exists. Hence, a MM function
is essentially a CM function with truncated monotonicity.
Example 6. Here we introduce two new families of radial basis functions.
φk (r) = (1 − r)k+
These functions (we will see later) lead to radial functions that are PD on Rd provided
k ≥ bd/2c + 1.
Figure 2.2: Left: truncated power with k = 1. Right: truncated power with k = 2.
2
Φ(x) = ekxk Ld/2 2
n (kxk )
d/2
where Ln indicates the Laguerre polynomial of degree n and order d/2, that is
n
(−1)k n + d/2 k
X
d/2
Ln (t) = t .
k! n−k
k=0
d n=1 n=2
2 2
1 (3/2 − x2 )e−x (15/8 − 5/2 x2 + 1/2x4 )e−x
2 2
2 (2 − kxk2 )e−kxk (3 − 3kxk2 + 1/2kxk4 )e−kxk
Figure 2.3: First row: G-L when d = 1 and n = 1, 2. Second row: G-L for d = 2 and
n = 1, 2. In both cases we used the scaling factor = 3. For the two dimensional case we
also normalized so that Φ(0) = 1.
the cases d = 2, 3, 4.) Notice: Jp in Matlab can be computed using the function
besselj(p, z) (where z is an array of evaluation points)
Kβ−d/2 (kxk)kxkβ−d/2
Φ(x) = , d < 2β ,
2β−1 Γ(β)
where Kp is the modified Bessel function of the second kind of order p, that can be
defined as a function of the Bessel function of first kind as follows
π J−p (x) − Jp (x)
Kp (x) =
2 sin(π p)
In Table 2.3 we present the Mátern functions for three values of β, indicated as
36
S. De Marchi, E. Perracchione Lectures on radial basis functions
Figure 2.4: Poisson RBF for d = 2, 3, 4, respectively. Here the shape parameter is = 10
It is worth to mention that the requirement d < 2β implies the dependence of the
space dimension. This is required so that Φ(x) ∈ L1 (Rd ). As observed in [74, p. 77],
this restriction can be relaxed and take β > 0 leading to a positive definite function
in Rd ).
5. Whittaker functions. The idea of these functions is based on the following construc-
tion. Let f ∈ C[0, ∞) be a non-negative and not identically equal to zero, and define
the function Z ∞
k−1
φ(r) = (1 − rt)+ f (t)dt . (2.3)
0
37
S. De Marchi, E. Perracchione Lectures on radial basis functions
Figure 2.5: Matern RBF for different β, respectively. The shape parameter is = 5
Figure 2.6: Inverse multiquadric with shape parameter = 3. On the left β = 1/2 that
corresponds to the Hardy multiquadric. On the right with β = 1 that corresponds to the
inverse quadric.
α k=2 k=3
39
S. De Marchi, E. Perracchione Lectures on radial basis functions
2.2 Exercises
1. Plot some of the radial function positive definite (centered in the origin). When d = 1
take x ∈ [−1, 1] while for d = 2 consider x ∈ [−1, 1]2 .
- The Gaussians -Laguerre for n = 1, 2 and d = 1, 2. See Table 2.1 for the corre-
sponding definitions.
- The Poisson functions for d = 2, 3, 4 in [−1, 1]2 using as shape parameter = 10,
see Table 2.2
- The Matérn function in [−1, 1]2 , for three different values of β and shape param-
eter = 10, as defined in Table 2.3.
- The generalized inverse multiquadrics Φ(x) = (1 + kxk2 )−β , s < 2β, in [−1, 1]2 ,
in these two (simple) cases (with = 5): β = 1/2 (which corresponds to the so-
called Hardy inverse multiquadrics) and β = 1 (which is the inverse quadrics).
- The truncated powers Φ(x) = (1 − kxk)l+ for l = 2, 4 (in [−1, 1]2 ).
- The Whittaker’s potentials in the square [−1, 1]2 for different values of the pa-
rameters α, k and β, as defined in Table 2.4. For these last plots use β = 1.
f (x1 , x2 ) = .75 exp[−((9x1 − 2)2 + (9x2 − 2)2 )/4] + .75 exp[−(9x1 + 1)2 /49 − (9x2 + 1)/10]
+ .5 exp[−((9x1 − 7)2 + (9x2 − 3)2 )/4] − .2 exp[−(9x1 − 4)2 − (9x2 − 7)2 ];
on a grid of 20 × 20 Chebyshev points in [0, 1]2 with Poisson and Matérn functions.
Compute also the corresponding RMSE.
40
Lecture 3
The multivariate polynomials are not suitable for solving the scattered data interpolation
problem. Only data sites in special locations can guarantee well-posedness of the inter-
polation problem. In order to have a flavour of this setting, we introduce the notion of
unisolvency.
Definition 8. A set X = {x1 , . . . , xN } ⊂ Rd is called m-unisolvent, if the only polyno-
mial of total degree at most m interpolating the zero data on X is the zero polynomial.
Then, to get a unique solution of the polynomial interpolation problem with a d-variate
d
≤ m,
polynomial of degree to some given data, we need to find a subset of X ⊂ R with
m+d
cardinality M = = dim(Pm (Rd ) which is m-unisolvent.
m
Example 7. These are examples of points that form unisolvent sets
• A simple example is this one. Take N = 5 points in R2 . There is no unique way to use
bivariate linear interpolation o quadratic. In fact linear polynomials have dimension
M = 3, bivariate M = 6.
• The Padua points on the square [−1, 1]2 , form the first complete example of unisol-
vent points whose Lebesgue constant has optimal growth (cf. [6]).
• In R2 the Chung and Yao points. The construction of these( d points is based
) on
X
lattices. In practise, a lattice Λ ⊂ Rd has the form Λ = hi vi , hi ∈ Z with
i=1
{vi , . . . , vd } a basis for Rd . For details see the paper [17].
41
S. De Marchi, E. Perracchione Lectures on radial basis functions
The m-unisolvency of the set X = {x1 , . . . , xN } is equivalent to the fact that the
matrix P such that
for any polynomial basis pj , has full (column)-rank. For N = M this is the classical
polynomial interpolation matrix.
This observation, can be easily checked when in R2 we take 3 collinear points: they are
not 1-unisolvent, since a linear interpolant, that is a plane through three arbitrary heights at
these three collinear points is not uniquely determined. Otherwise such a set is 1-unisolvent.
Remark. This problem arises when we want to construct interpolants with polynomial
precision. That is, interpolants that reproduce polynomials.
Example 8. Take the function f (x, y) = (x+y)/2 on the unit square [0, 1]2 . Using Gaussian
RBF (with = 6) interpolate it on a grid of N = 1089 = 33 × 33 uniformly distributed
points. This will lead to an interpolant which is not a linear function as is f (i.e. the
interpolation does not work).
Hence, instead of using an interpolant of the form Pf (x) = N −2 kx−xk k2 , we use
P
k=1 ck e
the following
N
2 kx−x k2
X
Pf (x) = ci e− i
+ cN +1 + cN +2 x + cN +3 y . (3.1)
| {z }
i=1
polynomial part
how can we find the remaining three conditions so that the resulting system will be square?
As we shall see later, the solution is
N
X N
X N
X
ci = 0, ci xi = 0, ci yi = 0 . (3.3)
i=1 i=1 i=1
Combining the interpolation conditions (3.2) with the side conditions (3.3), the resulting
linear system becomes
A P c y
= (3.4)
PT O d 0
where the matrix A and the vectors c and y are the same as in Lecture 1; while P is a
N × 3 matrix with entries Pi,j = pj (xi ) with p1 (x) = 1, p2 (x) = x, p3 (x) = y. Finally the
matrix O is 3 × 3 of zeros.
42
S. De Marchi, E. Perracchione Lectures on radial basis functions
N
X
ci pj (xi ) = 0, j = 1, . . . , M , (3.6)
i=1
A P c y
= (3.7)
PT O d 0
where now the matrices and arrays have the following dimensions: A is N × N , P is N × M ,
O is M × M ; c, y are N × 1 and d, 0 are M × 1.
Remark. It seems ill-adapted for the use to formulate the general setting for the
polynomial space Pm−1 (Rd ) instead, as before, of Pm (Rd ). The reason will be explained
later and, as we will see, it will be quite natural.
In order to prove that the augmented system (3.7) is non-singular we start with the easiest
case of m = 1 (in any dimension d). This is equivalent to the reproduction of the polynomials
of degree m − 1 = 0, i.e. the constants.
The following theorem shows that the augmented system is uniquely solvable
43
S. De Marchi, E. Perracchione Lectures on radial basis functions
Proof.. Assume that the solution (c, d)T ∈ RN +1 is a solution of the homogeneous
system, i.e. with y = 0. We then prove that c = 0 and d = 0. From the first block,
multiplying by cT , we have
cT Ac + dcT P = 0
an using the second equation P T c = cT P = 0 we get that cT Ac = 0. Since A is CPD of
order 1, by asumption we get c = 0. Moreover, from the first block, Ac + dP = 0 that
implies d = 0.
Corollary 1. For reproducing constant functions in Rd , the system to be solved has the
form (3.9).
44
S. De Marchi, E. Perracchione Lectures on radial basis functions
Hence the natural question is to look for the smallest possibile order m. When
speak of the order of such class of functions we will always refer to the minimal possible m.
Here we list the most important conditionally positive definite radial functions
• Generalized multiquadrics.
• Radial powers
Φ(x) = kxkβ , x ∈ Rs , 0 < β ∈
/ 2N ,
which are CPD of order m = d β2 e (and higher).
For β = 3 we get a function which is CPD of order 2 and for β = 5 a function which
is CPD of order 3. A property of these functions is that they are shape parameter
free. This has the advantage that the user need not worry about finding a good (or
the best) value for .
• Thin-plate splines
As for the PD case, the definition reduces to real coefficients and polynomials if the
basis function is real-valued and even. This is the case when the function Φ is radial.
46
S. De Marchi, E. Perracchione Lectures on radial basis functions
The special case m = 1 appers already in the linear algebra literature and it is dealt
PN ≤ and is then referred as conditionally negative definite. The constraints are simply
with
i=1 ci = 0. Since the matrix A is CPD of order 1, it is PD in a subspace of dimension
N − 1 (or in general N − M where M = dim(Pm−1 (Rd )). That is only N − 1 (or N − M )
eigenvalues are positive.
Theorem 11. Suppose Φ is CPD of order 1 and that Φ(0) ≤ 0. Then the matrix
A ∈ RN ×N , i.e. Ai,j = Φ(xi − xj ), has one negative and N − 1 positive eigenvalues. In
particular it is invertible.
For example, the generalized multiquadrics Φ(x) = (−1)dβe (1 + kxk2 )β , 0 < β < 1 (which
includes the Hardy’s one, β = 1/2) satisfied the previous Theorem.
Proof.. Assume that the solution (c, d)T ∈ RN +M is a solution of the homogeneous
system, i.e. with y = 0. We then prove that c = 0 and d = 0. From the first block,
multiplying by cT , we have
cT Ac + cT P d = 0
an using the second equation P T c = cT P = 0T we get that cT Ac = 0. Since A is CPD
of order m, by assumption we get c = 0. The unisolvency of the data sites, i.e. P has
47
S. De Marchi, E. Perracchione Lectures on radial basis functions
columns linearly independent, and the fact that c = 0 guarantee d = 0 from the top block
Ac + P d = 0.
3.1 Exercises
1. Plot the most important conditionally positive definite functions in the square [−1, 1]2 .
The most important is the one for β = 1 which is CPD of order 2. For β = 2
we get a function which is CPD of order 3. Verify that also these functions are
shape parameter free.
2. For a CPD function of order 1 (such as the Hardy multiquadric) check the Theorem
11.
48
Lecture 4
Error estimates
In evaluating the error between the interpolant Pf and the data values at some set Ξ =
{ξ 1 , . . . , ξ M } ⊂ Rd of evaluation points we can compute the root-mean-square error,
that is v
u
u1 X M
1
RM SE := t (Pf (ξ j ) − f (ξ j ))2 = √ kPf − f k2 . (4.1)
M M
j=1
The root-mean-square error (RMSE) is a frequently used measure of the differences between
values predicted by a model or an estimator and the values actually observed. These
individual differences are called residuals when the calculations are performed over the
data sample that was used for estimation, and are called prediction errors when computed
out-of-sample. The RMSE serves to aggregate the magnitudes of the errors in predictions
for various times into a single measure of predictive power. RMSE is a good measure of
accuracy, but only to compare forecasting errors of different models for a particular variable
and not between variables, as it is scale-dependent. In practice, (4.1) is simply a quantitative
error estimator.
Our goal is to provide error estimates for scattered data interpolation with (condition-
ally) positive definite functions. We start by considering the PD case.
The measure that is always used in approximation theory is the fill-distance or mesh size
which represents how well the data in X fill out the domain Ω and corresponds to the radius
of the largest empty ball that can be placed among the data sites inside Ω.
49
S. De Marchi, E. Perracchione Lectures on radial basis functions
In Matlab the fill distance can be determined by the line h=max(min(DM eval’)), where
DM eval is the matrix consisting of the mutual distances between the evaluation points (for
example a uniform grid in Ω) and the data set X. In Fig. 4.1 we show 25 Halton points and
the corresponding fill distance computed on a grid of 11 × 11 evaluation points of [0, 1]2 .
(h)
What we want to analysize, is whether the error kf − Pf k∞ → 0 as h → 0, here
(h)
Pf indicates the interpolant depending on the fill-distance h. To understand the speed
of convergence to zero, one has to understand the so-called approximation order of the
interpolation process.
Definition 11. We say that the process has approximation order k if
(h)
kf − Pf kp = O(hk ), k → 0
here the norm is taken for 1 ≤ p ≤ ∞.
For completeness, another quantity often used for stability analysis purposes (or finding
”good” interpolation points) is the separation distance of the data sites X
1
qX := min kxi − xj k
2 i6=j
which represents the radius of the largest ball that can be placed around every point of
X such there are no overlaps. In Matlab qX=min(min(DM data+eye(size(DM data))))/2,
where DM data is the matrix of distances among the data sites. We added the identity
matrix in order to avoid that this minimum will be 0, which is the separation distance of
every points from itself.
This idea goes back to Wu and Schaback [78] and consists in expressing the interpolant by
means of cardinal functions as in the polynomial case.
Theorem 13. If Φ is a positive definite kernel on Rd . Then, for any set of distinct
points x1 , . . . , xN , there exist functions u∗j ∈ span{Φ(· − xj ), j = 1, . . . , N } such that
u∗j (xi ) = δi,j .
Here we enumerate a few facts in analogy with univariate fundamental Lagrange polyno-
mials.
• The u∗j can be determined as a ratio of determinants as for the fundamental Lagrange
polynomials. Letting V = det(u∗j (xi )), and Vi,x the same determinant when xi is
substituted by a general point x ∈ Ω, then u∗i (x) = Vi,x /V .
• The u∗j do not depend on the data values (i.e. the fj ). In fact, once the data sites
X and the kernel Φ are chosen, then they can be determined by solving the system
(4.3). That is, they do depend on the data sites and the kernel.
• An important aspect, related to stability issues, is the choice of the data points. As
proved in [25], the quasi-uniform points are always a good choice for RBF interpola-
tion.
Another ingredient for understanding the error estimates is the power function. The starting
point to define this function is the following quadratic form
Q(u) = Φ(0) − 2uT b + uT Au (4.4)
where the vector b ∈ RN is defined as in the previous section and u is any N dimensional
vector.
51
S. De Marchi, E. Perracchione Lectures on radial basis functions
Using formula (4.4), combined with the system that defines the cardinal functions (4.3),
we get two alternatives ways to compute the power function
q q
PΦ,X (x) = Φ(0) − (u (x)) b(x) = Φ(0) − (u∗ (x))T Au∗ (x) , (first) (4.6)
∗ T
q
PΦ,X (x) = Φ(0) − (b(x))T A−1 b(x) , (second). (4.7)
Notice that when Φ is a PD kernel then A is, therefore we get immediately the following
bounds: p
0 ≤ PΦ,X (x) ≤ Φ(0) .
Figure 4.2: Power function for the Gaussian kernel with = 6 on a grid of 81 uniform,
Chebyshev and Halton points, respectively.
Proof. Consider the formula (4.4), the minimum of this quadratic form is given by
the solution of the linear system Au = b(x) which, however yields the cardinal functions
u = u∗ (x).
The power function, by definition, is a positive function, vanishing at the data sites,
decreasing to zero as the number of data points increases. Therefore, if we take two data
sets such that Y ⊂ X then PY,Ω ≥ PX,Ω . This is referred as the maximality property of the
power function.
As a final remark, the power function is defined similarly for conditionally positive
definite functions.
The error bounds come rather naturally once we associate with each radial basic function
a certain space of functions called native space. This space in connected to the so called
Reproducing Kernel Hilbert Space (RKHS). The theory of RKHS is beyond our aims, but
for understanding a little better the error estimates that we will present, it is necessary to
introduce some very basic notions of RKHS.
Definition 13. A space of functions is called an Hilbert space if it is a real or complex
inner product space that is also a complete metric space w.r.t. the distance induced by the
inner product.
Z b
Here the inner product between two functions f and g is thought as (f, g) = f (x)g(x)dx ,
Z b a
in the real case or (f, g) = f (x)g(x)dx , in the complex case, which has many of the fa-
a
miliar properties of the Euclidean (discrete) dot product.
Examples of Hilbert spaces are: any finite dimensional inner product space (for example
Rn , Cn equipped with the dot product of two vectors); the Lebesgue spaces Lp , Sobolev
spaces. The space C([a, b]) is an incomplete product space dense in L2 ([a, b]) which is
complete.
Definition 14. Let H be a real Hilbert space of functions f : Ω → R with inner product
(·, ·)H . A function K : Ω × Ω → R is called a RKHS for H if
The second is the reproducing property. In particular, if f = K then we get the kernel
K since K(x, y) = (K(·, y), K(·, x))H for all x, y ∈ Ω.
Notice: the RKHS is known to be unique and that the kernel K is positive definite.
We now show that “every positive definite radial basis function can be associated
with a RKHS: its native space.”
provided xj ∈ Ω. Moreover
XN N
X
kf k2H = (f, f )H =( ci K(·, xi ), cj K(·, xj ))H
i=1 j=1
N
X
= ci cj (K(·, xi ), K(·, xj ))H
i,j=1
N
X
= ci cj K(xi , xj ) .
i,j=1
XNK NK
X NK
X
( ci K(·, xi ), dj K(·, y j ))K = ci dj K(xi , y j )
i=1 j=1 i,j=1
The last observation is that, this bilinear form defines an inner product on HK (Ω), so
that Hk (Ω) is a pre-Hilbert space, that means that it is not complete.
The native space for the kernel K, indicated as NK (Ω) (or if not confusion arises, simply
N ), is the completition of HK (Ω) w.r.t. the K-norm k · kK , so that kf kK = kf kN for all
f ∈ HK (Ω). For details, please refer to the book by Wendland [74].
54
S. De Marchi, E. Perracchione Lectures on radial basis functions
We quote here two results that gives a flavour of the topic. The first theorem gives a
pointwise estimate based on the power function, whose proof can be found in [32, p. 117-
118] while the second uses the fill-distance (the proof is again in [32, p. 121-122]).
and
CΦ (x) = max max |D2β Φ(w, z)| .
|β|=2k w,z∈Ω∪B(x,c2 hX,Ω )
Comparing (4.9) and (4.10) we get a bound of the power function in terms of the
fill-distance p
PΦ,X (x) ≤ ChkX,Ω CΦ (x) .
Moreover the Theorem 16 says that interpolation with a C 2k kernel Φ has approxima-
tion order k. This means that for kernels infinitely smooth, such as Gaussians, Laguerre-
Gaussians, Poisson and generalized inverse multiquadrics, the bound above is arbitrarely
high. On the contrary, Matérn, Whittaker radial functions have approximation order limited
by the smoothness of the basic function φ.
One more observation is that the above estimates consider f ∈ NΦ(Ω) . There exist
similar estimates for f ∈
/ NΦ(Ω) (see e.g. [32, §15.3]).
55
S. De Marchi, E. Perracchione Lectures on radial basis functions
This last section aims to give some insights to the problem of the choice of shape parameter
in order to get the smallest (possible) interpolation error. In the recent literature there
have been exploited various strategies. Here, we present only three of them, which turn out
to be indeed the most used by practictioners.
In all that follows, we assume to use the same kernel Φ, we use only one value to scale
all basis functions uniformly. The number of data points could be changed by comparison
of results.
Figure 4.3: Trial and error strategy for the interpolation of the 1-dimensional sinc function
by the Gaussian for ∈ [0, 20], taking 100 values of and for different equispaced data
points.
56
S. De Marchi, E. Perracchione Lectures on radial basis functions
This is simply connected to the error analysis presented in the previous section (cf. formula
(4.9)). Once we have decided which Φ and data set X to use, we calculate the power
function on scaled version of the kernel in order to optimize the error component that is
independent of f . This approach is similar to the Trial and Error strategy and has the limit
to forget the second part of the error, i.e. the one that depends on the basis function via
the native space norm of f . In Figure 4.5 we plot the sup-norm of the power function for
500 values of ∈ [0, 20] for the Gaussian kernel and the set of uniform data points X with
N = 9, 25, 81, 289. This strategy is implemented in the M-file Powerfunction2D.m in the
Matlab codes provided in [32].
Figure 4.4: The sup-norm of the 2D power function on uniform points for the Gaussian
kernel, varying ∈ [0, 20] for different values of N
This method is popular in the statistics literature, known in the case the 2-norm is used
as PRESS (Predictive REsidual Sum of Squares). The “optimal” value ∗ is obtained
minimizing the (least-squares) error for a fit of the data values based on an interpolant for
which one of the centers is left out. In details, we start by constructing Pf,k , the radial basis
57
S. De Marchi, E. Perracchione Lectures on radial basis functions
such that
Pf,k (xi ) = fi , i = 1, . . . , k − 1, k + 1, . . . , N .
Then we compute the error at the point xk , the one not used by Pf,k
Ek = fk − Pf,k (xk ) .
Then the ”quality” of the fit is determined by the (sup) norm of the vector E = [E1 , . . . , EN ]T .
In the experiments, people add a loop on in order to compare the error norms for
different values of the shape parameter, choosing for ∗ the one that yields the minimum
error norm. This method in general is quite expensive from the computation point of
view (it has a complexity of O(N 4 ) flops). There is a way to ”accelerate” the method, by
computing Ek as
ck
Ek = −1
Ak,k
where ck is the k-th coefficient in the interpolant Pf based on all the data points and A−1
k,k
is the k-th diagonal element of the inverse of the corresponding collocation matrix. Since
both ck and A−1 will be computed once for each value of , this results in O(N 3 ) flops.
This strategy is implemented in the M-file LOOCV.m in the Matlab codes provided in [32].
Figure 4.5: LOOCV 1d: sup norm of the error on Chebyshev points for the Gaussian kernel,
varying ∈ [0, 20] for different values of N
58
S. De Marchi, E. Perracchione Lectures on radial basis functions
4.7 Exercises
1. Find the optimal shape parameter, opt , by means of the trial & error strategy for the
following univariate functions:
(a)
sin πx
f1 (x) = sinc(x) = .
πx
(b) variant of the Franke function
3 −(9x−2)2 /4 2
1 2 1 2
f2 (x) = e + e−(9x+1) /49 + e−(9x−7) /4 − e−(9x−4) ,
4 2 10
For each of the fi , i = 1, 2 produce a table of the form
N kPfi − fi k∞ opt
3
5
9
17
33
65
where, for each N , opt corresponds to the minimum of the error curve in the sup-
norm, computed by varying the shape parameter ∈ [0, 20]. As radial basis function
for the Pfi take the Gaussian.
2. Plot the power function in 2-dimension for the Gaussian kernel with = 6 on a grid
of N = 92 = 81 equispaced, Chebyshev and Halton points in [−1, 1]2 . We’ll see that
the power function will depend on the chosen points.
Verify that PX,Ω (xi ) = 0 for all xi ∈ X. Show how varies the maximum value of the
power function as N increases.
Use the M-file Powerfunction2D.m.
3. Plot kPΦ,X k∞ for the Gaussian kernel in 2-dimensions, by using for the power function
the formula q
PΦ,X (x) = Φ(0) − (b(x))T A−1 b(x)
with A representing the interpolation matrix and b(x) = [Φ(x−x1 ), · · · , Φ(x−xN )]T ,
by varying ∈ [0, 20], and N = 9, 25, 81, 289. Take equispaced points both as centers
and evaluation points of the power function.
Make a table similar to the one of the previous exercise adding one column for the
condition number of A corresponding to the “optimal” shape parameter. Use the
function Powerfunction2D.m for computing the 2-dimensional power function.
59
S. De Marchi, E. Perracchione Lectures on radial basis functions
60
Lecture 5
Local techniques, such as the PU scheme, have been used for interpolation since around 1960
[51, 69]. Later, they have been coupled with RBFs [32, 75]. Moreover, the PU method for
solving Partial Differential Equations (PDEs), first introduced in the mid 1990s in [7, 56],
is nowadays a popular technique [64, 68].
The basic idea of the PU method is to start with a partition of the open and bounded domain
Ω into M subdomains or patches Ωj , such that Ω ⊆ ∪M j=1 Ωj , with some mild overlap among
them. In other words, the subdomains must form a covering of the domain and moreover,
the overlap must be sufficient so that each interior point x ∈ Ω is located in the interior of
at least one patch Ωj . The overlap condition is illustrated in Figure 5.1. Specifically, a 2D
view of a PU structure, covering a set of scattered data in the unit square and satisfying
the above mentioned properties, is shown in the left frame. In this particular example we
consider circular patches, but other shapes can be considered. In the right frame we plot a
PU structure which does not satisfy the overlap condition.
1 1
0.8 0.8
0.6 0.6
x2
x2
0.4 0.4
0.2 0.2
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x1 x1
Figure 5.1: An illustrative example of PU subdomains covering the domain Ω = [0, 1]2 and
satisfying the overlap condition (left). In the right frame the covering does not satisfy the
overlap condition; a critical point where no overlap occurs is marked with a green triangle.
The blue dots represent a set of scattered data and the orange circles identify the PU
subdomains.
iii. the local fill distances hXNj are uniformly bounded by the global fill distance hX , where
XNj = X ∩ Ωj .
M
X
Wj (x) = 1, x ∈ Ω,
j=1
Among several weight functions, a possible choice is given by the Shepard’s weights [69],
62
S. De Marchi, E. Perracchione Lectures on radial basis functions
i.e.
W̄j (x)
Wj (x) = M
, j = 1, . . . , M,
X
W̄k (x)
k=1
where W̄j are compactly supported functions, with support on Ωj . Moreover, such family
{Wj }M
j=1 forms a partition of unity.
Once we choose the partition of unity {Wj }Mj=1 , the global interpolant is formed by the
weighted sum of M local approximants Pfj , i.e.
M
X
I (x) = Pfj (x) Wj (x) , x ∈ Ω. (5.1)
j=1
Remark. Note that the assumptions in Definition 16 lead to the requirement that
the number of subdomains is proportional to the number of data. Furthermore, the first
property ensures that the sum in (5.1) is actually a sum over at most C summands. The
fact that C is independent of N , unlike M , is essential to avoid loss of convergence orders.
Moreover, for an efficient evaluation of the global interpolant it is crucial that only a constant
number of local approximants has to be evaluated. It means that it should be possible to
locate those C indices in constant time.
where Nj indicates the number of points on Ωj and xjk ∈ XNj , with k = 1, . . . , Nj . The
N
coefficients {cjk }k=1
j
in (5.2) are determined by enforcing the Nj local interpolation conditions
Thus, in case of strictly positive definite functions, the problem of finding the PU
interpolant (5.1) reduces to solving M linear systems of the form
Aj cj = fj ,
63
S. De Marchi, E. Perracchione Lectures on radial basis functions
5.1.1 Error bounds for radial basis function partition of unity interpolants
In order to formulate error bounds, we need to define the space Cνk (Rd ) of all functions
f ∈ C k whose derivatives of order |β| = k satisfy Dβ f (x) = O (||x||ν2 ) for ||x||2 −→ 0. We
are now able to give the following convergence result [75].
Theorem 17. Let Ω ⊆ Rd be open and bounded and suppose that X = {xi , i = 1, . . . , N } ⊆
Ω. Let φ ∈ Cνk (Rd ) be a strictly conditionally positive definite function. Let {Ωj }M
j=1 be
M M
a regular covering for (Ω, X ) and let {Wj }j=1 be k-stable for {Ωj }j=1 . Then the error
between f ∈ Nφ (Ω), where Nφ is the native space of φ, and its PU interpolant (5.1), with
Pfj ∈ span{Φ(·, x), x ∈ XN ∩ Ωj }, can be bounded by
0 (k+ν)/2−|β|
|Dβ f (x) − Dβ I (x) | ≤ C hX ||f ||Nφ (Ω) ,
for all x ∈ Ω and all |β| ≤ k/2.
Remark. If we compare the result reported in Theorem 17 with the global error
estimates shown in the previous sections [74], we can see that the PU interpolant preserves
the local approximation order for the global fit. Hence, we can efficiently compute large
RBF interpolants by solving small interpolation problems and then combine them together
with the global partition of unity {Wj }M
j=1 .
In the PU setting, an important issue is the one of organizing points among the subdomains.
In literature, techniques as kd-trees, which allow to partition data in a k-dimensional space,
and related searching procedures have already been designed [2, 20]. Even if such techniques
work with high dimensions, they are not specifically implemented for the PU method.
Here, we present a versatile scheme for multivariate interpolation which makes use of the
so-called Integer-based Partitioning Structure (I-PS) and a related searching procedure [15].
It strictly depends on the size of the PU subdomains and allows to deal with a truly large
number of data with a relatively low computational complexity. Such procedure follows
from the results shown in [1, 12, 13, 14], where efficient searching procedures based on the
partition of the underlying domains in strips or crossed strips are considered.
More precisely, the I-PS for bivariate and trivariate interpolation consists in covering, at
first, the domain with several non-overlapping small squares or cubes, named blocks. Then,
the usually large scattered data set is distributed among the different blocks rounding off to
an integer value. We point out that the Matlab software is made available to the scientific
community in a downloadable free package
64
S. De Marchi, E. Perracchione Lectures on radial basis functions
http://hdl.handle.net/2318/1527447.
In what follows, we fix for simplicity Ω = [0, 1]d . Assuming to have a nearly uniform
node distribution, M is a suitable number of PU subdomains on Ω if [11, 32]
N
≈ 2d .
M
Here we take
d
N 1/d
M= .
2
Also the PU radius δ must be carefully chosen. In fact, the patches must be a covering
of the domain Ω and must satisfy the overlap condition. For instance, the required property
can be fulfilled taking the radius
r
δ = 1/d ,
M
with r ∈ R, r ≥ 1.
The number q of blocks along one side of Ω is strictly linked to the PU radius δ and is
given by
1
q= . (5.3)
δ
From (5.3) we can deduce that the I-PS depends on the construction of the PU subdomains.
In such framework we will be able to get an efficient procedure to find the nearest points.
Thus, after defining the width of the blocks as in (5.3), we number blocks from 1 to q M .
In a 2D context they are numbered from bottom to top, left to right, see Figure 5.2. For
trivariate data sets, starting from the order shown in Figure 5.2, we continue numbering
blocks along the quote as well.
ii. given a set of data points X and a subdomain Ωj , find all points located in that patch.
Given a PU centre x̄j , if km is the index of the strip parallel to the subspace of dimension
d − 1 generated by xp , p = 1, . . . , d, and p 6= m, containing the m-th coordinate of x̄j , then
65
S. De Marchi, E. Perracchione Lectures on radial basis functions
d−1
X
k= (km − 1) q d−m + kd . (5.4)
m=1
As example in a 2D framework, the PU centre plotted in Figure 5.2 belongs to the k-th
block, with k = 4q + 3; in fact here k1 = 5 and k2 = 3.
Exactly the same procedure is adopted in order to store both the scattered data and
the evaluation points into the different blocks.
Specifically, supposing that the j-th PU centre belongs to the k-th block, the integer-
based searching procedure searches for all data lying in the j-th subdomain among those
lying on the k-th neighborhood, i.e. in the k-th block and in its 3d −1 neighboring blocks, see
Figure 5.2. In particular, the partitioning structure based on blocks enables us to examine
in the searching process at most 3d − 1 blocks. In fact, when a block lies on the boundary
of the bounding box, we reduce the number of neighboring blocks to be considered.
1
q 2q q2
0.8
0.6
x2
0.4
0.2
2
1 q+1 (q−1)q+1
0
0 0.2 0.4 0.6 0.8 1
x
1
Figure 5.2: An example of a 2D partitioning structure: the k-th block (red solid line), a
subdomain centre belonging to the k-th block (magenta circle) and the neighborhood set
(green dashed line).
66
S. De Marchi, E. Perracchione Lectures on radial basis functions
The I-PS, after organizing the scattered data into the different blocks, given a subdomain
Ωj searches for all the points lying on Ωj in a reduced number of blocks. Specifically, in
order to store the scattered data among the different blocks, it makes use of an integer-based
procedure that assigns to each node xi , i = 1, . . . , N , the corresponding block. This step
requires O(N ) time. Then, we apply the optimized searching routine. Supposing to have
quasi-uniform data, it runs in a constant time.
In Table 5.1, we sum up the the total computational cost of the integer-based parti-
tioning and searching procedures, compared with kd-trees.
Table 5.1: Computational costs concerning integer-based and the kd-tree routines.
Since from Definition 16, the number of centres in each PU subdomain is bounded by a
constant, we need O(1) space and time for each patch to solve the local RBF interpolation
problems. In fact, to get the local interpolants, we have to solve M linear systems of size
Nj × Nj , with Nj N , thus requiring a running time O(Nj3 ), j = 1, . . . , M , for each patch.
Besides reporting the points in each patch in O(1), as the number M of PU subdomains is
bounded by O(N ), this leads to O(N ) space and time for solving all of them. Finally, we
have to add up a constant number of local RBF interpolants to get the value of the global
fit (5.1). This can be computed in O(1) time.
A common problem in computer aided design and computer graphics is the reconstruction
of surfaces defined in terms of point cloud data, i.e. a set of unorganized points in 3D. Such
applications arise in computer graphics, modeling complicated 3D objects or in medical
imaging (see e.g. [16, 19, 60, 79]).
An approach to obtain a surface that fits the given 3D point cloud data is based on the
use of implicit surfaces defined in terms of some meshfree approximation methods, such as
RBF interpolant [32]. Further details can also be found in [9, 10, 61, 73, 77].
67
S. De Marchi, E. Perracchione Lectures on radial basis functions
For the implicit approach, we think of M as the surface of all points x ∈ R3 satisfying
the implicit equation
f (x) = 0, (5.5)
for some function f . So it implicitly defines the surface M∗ . This means that the equation
(5.5) is the zero iso-surface of the trivariate function f , and therefore this iso-surface coin-
cides with M. The surface M can be constructed via PU interpolation. Unfortunately, the
solution of this problem, by imposing the interpolation conditions (5.5), leads to the trivial
solution, given by the identically zero function [19].
The key to finding the interpolant of the trivariate function f , from the given data
points is to use additional significant interpolation conditions, i.e. to add an extra set of
off-surface points. Once we define the augmented data set, we can then compute a three
dimensional interpolant I, via the PU method, to the total set of points [32, 75].
Thus, the reconstruction of the surface leads to a method consisting of three steps:
Let us suppose that, for each point xi , the oriented normal ni ∈ R3 is given. We
construct the extra off-surface points by taking a small step away along the surface normals,
i.e. we obtain for each data point xi two additional off-surface points. One point lies outside
the manifold M and is given by
xN +i = xi + ∆ni ,
x2N +i = xi − ∆ni ,
+ −
∆ being the stepsize. The union of the sets X∆ = {xN +1 , . . . , x2N }, X∆ = {x2N +1 , . . . ,
x3N } and X , namely X3N , gives the overall set of points on which the interpolation condi-
tions are assigned. Note that if we have zero normals in the given normal data set, we must
exclude such points. Finally, we construct the augmented set of function values F3N . It is
defined as the union of the following sets:
Now, after creating the data set, we compute the interpolant I whose zero contour
(iso-surface I = 0) interpolates the given point cloud data.
The values +1 or −1 are arbitrary. Their precise value is not as critical as the choice
of ∆. In fact the stepsize can be rather critical for a good surface fit [32]. Finally, we just
render the resulting approximating surface M∗ as the zero contour of the 3D interpolant
[32]. If the normals are not explicitly given, we now illustrate some techniques to estimate
them.
To implement the implicit PU method, for each point xi , we need to find the oriented
normal ni . To this aim, we follow the technique presented in [43, 44]. Of course, we have
to assume that the surface is indeed orientable.
More precisely, we compute the centre of gravity of {xk , k ∈ K(xi )}, i.e.
1 X
oi = xk ,
K
k∈K(xi )
which is a symmetric 3 × 3 positive semi-definite matrix. The eigenvalues λi1 ≥ λi2 ≥ λi3
and the corresponding unit eigenvectors vi1 , vi2 , vi3 of this positive semi-definite matrix
represent the plane and the normal to this plane. Specifically, let us suppose that two
eigenvalues λi1 and λi2 are close together and the third one is significantly smaller, so
the eigenvectors for the first two eigenvalues vi1 and vi2 determine the plane, while the
eigenvector vi3 determines the normal to this plane.
The second step is to orient the normal consistently, in fact ni is chosen to be either vi3
or −vi3 . Note that if two data points xi and xk are close, their associated normals ni and
nk are nearly parallel, i.e. ni nTk ≈ ±1. Consequently, if ni nTk ≈ −1 either ni or nk should
be flipped. The difficulty in finding a consistent global orientation is that this condition
should hold between all pairs of sufficiently close data points.
69
S. De Marchi, E. Perracchione Lectures on radial basis functions
We propose the approximate solution described in [43]. The idea is simply to start
with an arbitrary normal orientation and then to propagate it to neighboring normals.
Intuitively, we would like to choose an order of propagation that favors propagation from
Tp (xi ) to Tp (xk ) if the unoriented planes are nearly parallel. To assign orientation to
an initial plane, the unit normal of the tangent plane whose centre has the third largest
coordinate is made to point toward the positive x3 -axis. We assign to each edge eik the
cost w(eik ) = 1 − |ni nTk |, as suggested by [43]. Note that w(eik ) is small if the unoriented
tangent planes are nearly parallel. A favourable propagation order can therefore be achieved
by traversing the minimal spanning tree of the Riemann graph. The advantage of this order
consists in propagating the orientation along directions of low curvature in the data.
To such scope, we need some preliminary definitions (see e.g. [3]) for further details.
Definition 17. In any connected graph G, a spanning tree is a subgraph of G having the
following two properties:
Even if the normals can be analytically computed, in what follows we suppose that they
are unknown.
1
x2
−1
−2
−3
−3 −2 −1 0 1 2 3
x1
Next, to obtain the set of off-surface points, we add the function values. Specifically,
we assign the value 0 to each original data point and the value 1 or −1 to outside or inside
points (obtained by marching a small distance ∆ along the normals), see Figure 5.5 (left).
The step size is taken to be 1% of the size of the data set.
Now the problem is turned into a full 2D interpolation problem. Thus, in order to
reconstruct the surface interpolating the augmented data set, we use the PU method with
the Wendland’s C 2 function ϕ3,1 . Moreover, the same function is used for the PU weights.
We point out that in this dissertation the Wendland’s C 2 function will be always used for
the computation of the PU weights. The result, choosing the shape parameter ε equal to 0.6,
is shown in Figure 5.5 (right).
The interpolant curve, shown in Figure 5.6, is the zero contour of the interpolant sur-
face.
71
S. De Marchi, E. Perracchione Lectures on radial basis functions
3 3
2 2
1 1
x2
x2
0 0
−1 −1
−2 −2
−3 −3
−3 −2 −1 0 1 2 3 −3 −2 −1 0 1 2 3
x1 x1
Figure 5.4: Inconsistent normals estimation (left) and consistent set of normals (right).
Figure 5.5: The augmented data set (left) and the surface interpolating the augmented data
set (right).
5.3 Exercises
i. Prove that
|f (x) − I(x)| ≤ max ||f |Ωj − Pfj ||L∞(Ωj ) .
i=1,...,M
ii. Construct a suitable multidimensional PU setting made of balls, i.e. choose suitable
72
S. De Marchi, E. Perracchione Lectures on radial basis functions
x2 0
−1
−2
−3
−3 −2 −1 0 1 2 3
x1
Figure 5.6: The interpolant curve, i.e. the zero contour of the interpolant surface.
iii. If we use squares or rectangles instead of balls, what are the consequences on the PU
weights? Hint: we need to modify the supports of the CSRBFs.
73
S. De Marchi, E. Perracchione Lectures on radial basis functions
74
Lecture 6
Collocation methods via RBFs for PDEs take advantage of being meshfree and easy to
compute. In what follows, we consider symmetric collocation, Kansa’s approach, local
schemes and the method of lines.
Given a linear elliptic differential operator L, the goal consists in finding an approximate
solution of the BVP problem (Dirichlet boundary conditions)
We present here a method for computing the solution of elliptic BVPs via Kansa’s col-
location method which was introduced by E. Kansa in [48]. Originally it consisted of an
unsymmetric scheme, based on multiquadrics, whose convergence properties were studied
only later by R. Schaback (see e.g. [65]).
The problem (6.1) is discretized on a global set of collocation points X = XNc ∪ XNb =
{xi , i = 1, . . . , N }, where Nb and Nc are the number of nodes on ∂Ω and Ω\∂Ω, respectively.
For Kansa’s collocation method we then choose to represent the approximate solution Pf
by a radial basis function expansion analogous to that used for scattered data interpolation,
i.e.,
75
S. De Marchi, E. Perracchione Lectures on radial basis functions
N
X
Pf (x) = ci φ(||x − ξi ||2 ),
i=1
where
(A)ik = φ(||xi − ξk ||2 ), xi ∈ ∂Ω, ξk ∈ ∂Ω,
and
(AL )ik = Lφ(||x − ξk ||2 )|x=xi , xi ∈ Ω, ξk ∈ Ω.
Moreover, Kansa suggests the use of varying shape parameters. While the theoretical
analysis of the resulting method is near intractable, Kansa shows that this technique im-
proves the accuracy and stability of the method when compared to using only one constant
value. A problem with Kansa’s method is that the matrix L may be singular for certain
configurations of the centers [42]. This fact is not really surprising since the matrix for
the collocation problem is composed of rows that are built from different functions, which
might not even be radial. Since the numerical experiments of Hon and Schaback show
that Kansa’s method cannot be well-posed for arbitrary center locations, it is now an open
question to find sufficient conditions on the center locations that guarantee invertibility of
the Kansa matrix. One possible approach is to adaptively select good centers from a large
set of possible candidates. Following this strategy it is possible to ensure invertibility of the
collocation matrix throughout the iterative algorithm. This approach is described in [49].
To introduce the symmetric approach, we need to recall the basic theory of Hermite-based
interpolation. To this aim, let us take {xi , λi f }, i = 1, . . . , N , where Λ = {λ1 , . . . , λN } is
a linearly independent set of continuous linear functionals. For instance, λi could denote
point evaluation at the points and thus we recover the interpolation conditions, or it could
denote evaluation of some derivative at the points. In this setting, we also allow more
general functionals, such as integrals.
76
S. De Marchi, E. Perracchione Lectures on radial basis functions
where the notation λξi indicates that the functional acts on φ viewed as a function of its
second argument. Furthermore, we do not add any superscript if λ acts on the kernel as a
function of its first variable. Of course, similarly as we do for interpolation conditions, we
require that
λi Pf = λi f, i = 1, . . . , N.
Therefore, after imposing such conditions, we reduce to solving:
Ac = fλ ,
(A)ik = λi λξk φ, i, k = 1, . . . , N.
It can be shown that A is non-singular for the same classes of φ that were admissible
for the standard scattered data interpolation.
For the collocation setting, we propose the following expansion for the unknown solution
of the PDE:
Nc
X N
X
Pf (x) = ck Lξ φ(||x − ξ||2 )ξ=ξk + ck φ(||x − ξk ||2 ).
k=1 k=Nc +1
where
(ALLξ )ik = LLξ φ(||x − ξ||2 )|x=xi ,ξ=ξk , xi , ξk ∈ Ω,
(AL )ik = Lφ(||x − ξk ||2 )|x=xi , xi ∈ Ω, ξk ∈ ∂Ω
(ALξ )ik = Lξ φ(||xi − ξ||2 )|ξ=ξk , xi ∈ ∂Ω, ξk ∈ Ω
(A)ik = φ(||xi − ξk ||2 ), xi , ξk ∈ ∂Ω.
Thus, if the RBF centers coincide with collocation points we certainly have a symmetric
matrix L and we have the following convergence result [74].
or have no zero there. Suppose that Φ ∈ C 2k (Rd ) is a strictly positive definite function.
Suppose further that the boundary value problem
has a unique solution f ∈ NΦ (Ω) for given g1 ∈ C(Ω) and g2 ∈ C(∂Ω). Let Pf the
approximate solution constructed via Hermite collocation, then
for all sufficiently small h, where h is the larger of the fill distances in the interior and on
the boundary of Ω, respectively.
Many PDEs of interest are time-dependent. Thus, in what follows we review a method for
incorporating both spatial and time derivatives in the boundary value problems. To solve
these time-dependent problems, we choose to use the method of lines (refer to [33]) because
of its simplicity in dealing with the time component. For other time-dependent methods
such as Laplace transforms see e.g. [70]. Let us consider
∂
f (x, t) = Lf (x, t), (6.2)
∂t
where at any fixed time t∗ , the function
f ∗ (x) = f (x, t∗ ),
has only spatial arguments. In other words, the standard kernel-based methods can be used
to approximate it. Let us introduce the following notation:
c∗
where must be solved in the interpolation context. Let us write the interpolation problem
at any time t∗ as ∗
Lk(x1 )T
f (x1 )
.. ∗ ..
c = . .
.
Lk(xN )T f ∗ (xN )
Notice that if the kernel centres are fixed with respect to time, only c∗ varies with the
choice of time. This is the key factor which will allow us to separate the time and spatial
78
S. De Marchi, E. Perracchione Lectures on radial basis functions
components. Using the independence of the kernel centres with respect to time, we can
write
Pf∗ (x, t) = k(x)T c(t).
∂
k(x)T c(t) = Lk(x)T c(t),
∂t
By collocating we obtain
k(x1 )T Lk(x1 )T
.. ∂ ..
c(t) = c(t).
. ∂t .
k(xN )T Lk(xN ) T
However, we need to incorporate the boundary conditions into the method of lines.
Suppose that we consider
∂
f (x, t) = Lf (x, t) + g1 (x), x∈Ω t > 0,
∂t
0 = f (x, t) + g2 (x), x ∈ ∂Ω t ≥ 0, (6.3)
f (x, t) = f0 (x), x ∈ ∂Ω t = 0,
k(xNc +1 )T
0 g2 (xNc +1 )
.. .. ..
. = c(t) + .
. .
0 k(xNc +Nb ) T g2 (xNc +Nb )
k(x1 )T Lk(x1 )T
g1 (x1 )
.. ∂ .. ..
c(t) = c(t) + .
. ∂t . .
k(xNc ) T Lk(xNc ) T g1 (xNc )
79
S. De Marchi, E. Perracchione Lectures on radial basis functions
All the methods presented in above provide suitable solutions provided that we consider
few nodes. Otherwise, it might be advantageous to work with the PU method.
We present here a method for computing the solution of elliptic BVPs the partition of unity
method.
Once we assume that (6.1) admits a solution of the form (5.1) then (see e.g. [64, 68]),
PM
LI(xi ) = j=1 L Wj (xi ) Pfj (xi ) = g1 (xi ), xi ∈ Ω\∂Ω,
PM (6.4)
I(xi ) = j=1 Wj (xi ) Pfj (xi ) = g2 (xi ), xi ∈ ∂Ω.
Let Pfj = (Pfj (xj1 ), . . . , Pfj (xjNj ))T be the vector of local nodal values. Since the local
coefficients cj = (cj1 , . . . , cjNj )T are so that cj = A−1
j Pfj , we get
−1
LPfj = AL
j Aj Pfj , (6.5)
where AL
j is the matrix
j j
(AL
j )ik := Lφ(||xi − xk ||2 ), i, k = 1, . . . , Nj .
To fix things, consider the Poisson problem, i.e. L = −∆. The elliptic operator L can
be expanded to get [41]
L(Wj (xi )Pfj (xi )) = − ∆Wj (xi )Pfj (xi ) − 2∇Wj (xi ) · ∇Pfj (xi )
− Wj (xi )∆Pfj (xi ), xi ∈ Ω\∂Ω,
where the scalar product should be applied to the components of the gradients. Let A∆
j
and A∇
j be the matrices with entries
j j
(A∆
j )ik = ∆φ(||xi − xk ||2 ), i, k = 1, . . . , Nj ,
80
S. De Marchi, E. Perracchione Lectures on radial basis functions
and
j j
(A∇
j )ik = ∇φ(||xi − xk ||2 ), i, k = 1, . . . , Nj ,
we have
∆ −1
∆Pfj = A∆
j cj = Aj Aj Pfj .
and similarly we define W̄j∇ and W̄j . Finally, by including the boundary conditions, we can
express the discrete local Laplacian as
(
(L̄j )ik , for xji ∈ Ω\∂Ω,
(Lj )ik =
δik , for xji ∈ ∂Ω,
In what follows we will refer to the collocation method described in this section as the RBF
Standard approach (RBF-S), meaning that the standard basis is used to approximate the
solution.
Note that, since we use the Laplacian, we require that both the kernel and the weight
functions are at least twice differentiable. Let xζkj ∈ XNj be the node corresponding to
xk ∈ X . In order to obtain the global discrete PDE operator, we need to assemble the local
ones into a global the matrix L as follows
M
X
(L)ik = (Lj )ζij .ζkj , i, k = 1, . . . , N.
j=1
Lz = f , (6.7)
matrix L suggests that its non-singularity could be ensured only with a similar distinction
between RBF centres and collocation data. This needs further investigations. Nevertheless,
as for Kansa’s collocation, the solution of PDEs via the PU method as presented here has
already been shown to be an effective numerical tool.
Example 10. In order to test the method, we consider an elliptic problem on Ω = [0, 1]2
with a manufactured solution f from which we can compute g1 and g2 . In particular [41]
f (x1 , x2 ) = sin(x1 + 2x22 ) − sin(2x21 + (x2 − 0.5)2 ).
The graphical result is plotted in Figure 6.1.
Figure 6.1: The approximate solution computed on N = 289 Halton data with the Gaussian
C ∞ kernel as local approximant.
6.2 Exercises
i. Extend Kansa’s collocation to conditionally positive definite functions.
ii. Explicitly write the collocation matrices for the Hermite-based approach when the
Gaussian and Inverse MultiQuadric are used.
iii. Extend Kansa’s collocation to elliptic equations with variable coefficients and homo-
geneous Dirichlet boundary conditions
∂ ∂ ∂ ∂
a(x1 , x2 ) f (x1 , x2 ) + b(x1 , x2 ) f (x1 , x2 ) = f (x1 , x2 ),
∂x1 ∂x1 ∂x2 ∂x2
for (x1 , x2 ) ∈ Ω = [0, 1]2 and
f (x1 , x2 ) = 0, (x1 , x2 ) ∈ ∂Ω.
82
Lecture 7
Financial applications
In this chapter we present and discuss an RBF method for pricing financial contracts by
solving the well-known Black-Scholes equation (in the sequel we simply refer to it as BS
equation).
Financial markets have become more and more complex, with the trading of many different
finacial products. Among them derivatives are very important and worth to be studied.
Henceforth it is of fundamental interest to dispose of method that simulates and updates
the financial products very fast and as accurately as possible (cf. [26, 63]).
Definition 20. A derivative is a contract that derives its value from the performance of
an underlying entity (for example: asset, index, interest rate), simply called underlying
Here we introduce a small vocabulary (ordered alphabetically) of the terms that we will
use.
Basket options are options on a basket of assets. The assets can be stocks, commodities,
indices and other financial securities. A commonly traded basket option is a vanilla
call/put option which is a linear combination of assets.
Derivative is every contract whose value depend on underlyings (stocks, indexes, curren-
cies, interest rates etc.). Common derivates are forward, features, options, swaps and
their variation.
Payoff literarly means the final outcome or a result of an activity. In finance is given by
difference between exercise price and spot price of contract.
83
S. De Marchi, E. Perracchione Lectures on radial basis functions
Risk-free interest rate is the rate of return of a hypothetical investment with no risk of
financial loss, over a given period of time.
Spot price is the price of goods traded on a spot market and available for almost imme-
diate delivery.
Strike price is the price (or exercise price) at which a specific derivative contract can be
exercised. The term is mostly used to describe stock and index options in which strike
prices are fixed in the contract. For call options, the strike price is where the security
can be bought (up to the expiration date); for put options, the strike price is the price
at which shares can be sold.
Underlying is any entity (not necessarily financial) from which the derivative depends on.
Volatility (indicated often with σ) is the degree of variation of a trading price series over
time as measured by the standard deviation of logarithmic returns.
The first problem we afford is pricing, by a model, a financial contract based on several
underlyings (assets). The contract chosen is the European Basket Option. The model used
in the well-known Blank-Scholes-Merton linear parabolic partial differential equation, in
which the spatial dimension is determined by the number of assets.
For completeness, there exist other models for pricing high-dimensional contracts like
Monte-Carlo, sparse grids or finite differences.
The BS equation (cf. e.g. [62]), is a linear parabolic PDE that models the price evolution
of an European call option (or an European put option). We start our discussion with the
one-dimensional case.
Let F (s, t) be the price of the option at the time t while s indicates the space variable
which represent the stock price. The BS equation determines the arbitrage free price of a
contigent claim and is given as
∂F ∂F 1 ∂2F
+ σ 2 s2 2 − rF = 0
+rs
∂t ∂s 2 ∂s (7.1)
F (s, T ) = Ψ(s)
where σ is the volatity and r the risk-free interest rate. The equation domain is the stripe
s > 0, t ∈ [0, T ). By solving this equation backwards in time, we obtain the arbitrage free
price of the contingent claim for all s we are interested in.
84
S. De Marchi, E. Perracchione Lectures on radial basis functions
d d
∂F X ∂F 1 X ∗ ∂2F
+ r si + [σσ ] s s
i,j i j − rF = 0
∂t ∂si 2 ∂si ∂sj
i=1 i,j=1 (7.2)
F (s, T ) = Ψ(s)
Here d is the number of the underlyings, s = (s1 , . . . , sd )T and σ is now a matrix of volatities
([σσ ∗ ] is symmetric and positive definite). We can transform (7.2) in a non-dimensional
initial value problem by using the transformations (scaling)
s = Kx, r̄ = r/σ̂ 2 , t̂ = 21 σ̂ 2 (T − t) ,
(7.3)
P (x, t̂) = F (s, t)/K, σ̄ = σ/σ̂, KΦ(x) = Ψ(s)
d d
∂P X ∂P X ∂2P
[σ̄σ̄ ∗ ]i,j xi xj
= 2r̄ xi + − 2r̄P
∂ t̂ ∂xi ∂xi ∂xj
i=1 i,j=1 (7.4)
P (x, 0) = Φ(x)
Letting
d d
X ∂ X ∂2
L := 2r̄ xi + [σ̄σ̄ ∗ ]i,j xi xj − 2r̄
∂xi ∂xi ∂xj
i=1 i,j=1
the elliptic operator, then the initial value problem (7.4) can be written
∂P
(x, t̂) = LP (x, t̂), t̂ ∈ R+ , x ∈ Rd+
∂ t̂ (7.5)
P (x, 0) = Φ(x)
d d
! !
1X 1X
Φ(x) = xi − K̃ = max xi − K̃, 0 . (7.6)
d d
i=1 + i=1
As reference solution we can consider the one give by an adaptive finite difference method,
as the one derived in [62]. For a finite difference discretization of BS, we need boundary
85
S. De Marchi, E. Perracchione Lectures on radial basis functions
conditions all around all the boundary. The implementation in [62] (and used also in [72])
assume that on all the boudary
∂ 2 P (x, t̂)
=0 (7.7)
∂x2i
which implies that the option price is nearly linear w.r.t. the spot price at the boundary.
Notice that the previous conditions are equivalent to that of the derivatives along the
normals, because of the shape of the domain (a stripe).
Inside the domain instead, we consider a second order finite difference approximation
on a structured but not equispaced grid (i.e. adaptive). In formulas this can be written as
follows
dPh
= Ah P h
dt̂
where Ph is the vector of ordered unknowns and Ah is the second order FD-discretizazion
of the elleptic operator L.
Unfortunately, the condtions (7.7) do not work well with RBF, especially with infinitely
smooth kernels. In any case the problem is well-posed if the growth of the solution to infinity
is limited.
For this reason we propose to use only of near and far field boundary conditions. This
means that on the boundaries of type
Γi = {x ∈ Rd+ : x 6= 0, xi = 0}, i = 1, . . . , d
Obviously other choices can be made as suggested for instance in [31, 26].
• The hypercube
d
O
D= [0, ai ]
i=1
• RBF approach is meshfree. This suggests to take artificial far-field boundary condi-
tions at our choice.
86
S. De Marchi, E. Perracchione Lectures on radial basis functions
Concerning the RBF method, considering the payoff function (7.6), it makes sense to use
the boundary surface
Xd
xi = C
i=1
where the constant C will be chosen far enough from the origin so that the far-field solution,
introduced above, will be a good approximation of the our solution.
As for every differential equation depending on the time, solving the BS equation we want
to know the solution at the time t̂ = T .
1. Practically, this means to know the price of an option today with excercise time T
years from today. The error at a generic point x will then be
e(x) = P (x, T ) − u(x, T ) . (7.8)
2. The second observation to make is that the most interesting region (called Region of
Interest (RoI)) where to consider the error is when the mean value of the stock prices
is in a neighbor of the strike price. This means that
d
1X
xi ∈ UK̄ (7.9)
d
i=1
with UK̄ an interval around K̄ that will be given by the observation of the referred
stock market. For instance, in [63], observing
h the
i Stockholm stock exhange market
K̄ 5K̄
they suggested (see also Fig. 7.1) UK̄ = 3 , 3
Another financial norm that can be used is the following weighted intergral norm ( cf.
[62] ) Z
Ew = |e(x)|w(x)dx (7.11)
Ω
where Ω is the whole domain and the R weight function is chosen as a product of d Gaussians
centered in the RoI and such that Ω w(x)dx = 1. For example in 1-d, w1 (x) ≈ exp(−5(x −
K̄)2 ) amd in 2-d w2 (x1 , x2 ) ≈ exp(−4(x1 + x2 − 2K̄)2 ) exp(−(x1 − x2 )2 ). In the case of the
Z 2 Z
normalized value K̄ = 1 we get w1 (x)dx ≈ 0.79 and w2 (x)dx ≈ 0.77, see Fig. 7.2
0 [0,2]2
for the plot of these two functions. These functions are indeed good approximation of the
finantial error in the RoI.
87
S. De Marchi, E. Perracchione Lectures on radial basis functions
Our approximation in time is a linear combination of radial basis functions. Notice that in
the sequel for the sake of simplicity we use t intending t̂.
N
X N
X
u(x, t) = λi (t)φ((kx − xi k) = λi (t)φi (x) . (7.12)
i=1 i=1
88
S. De Marchi, E. Perracchione Lectures on radial basis functions
Now defining the vectors ui (t) = (u(x1 , t), . . . , u(xNi , t))T and ub (t) = (u(xNi +1 , t), . . . , u(xN , t))T
we can write the linear system
ui (t) Aii Aib λi (t)
= (7.13)
ub (t) Abi Abb λb (t)
| {z }
A
where the whole matrix A has entries aij = φ(kxi − xj k). If the radial function φis positive
definite, we know that the matrix is invertible. Moreover
λi (t) −1 ui (t) ui (t)
Lui (t) = (Bii Bib ) = (Bii Bib ) A = (Cii Cib ) (7.14)
| {z } λb (t) ub (t) | {z } ub (t)
B C
As well known, the stability of the time-steps is determined by the eigenvalues of the
block Cii which all have no positive real part. This allows to use, for the advancing time
step an unconditionally stable method like BDF2.
Let tn = c n be our constant time step and uni ≈ ui (tn ). Then the BDF2 applied to
our problem is
uni + b1 uin−1 + b2 uin−2 = c b0 Luni (7.15)
where the coefficients bs are b0 = 1, b1 = −1, b2 = 0 for the initial step and b0 = 2/3, b1 =
−4/3, b2 = 1/3 for the successive steps.
At each time step the boundary conditions are unb = γbn with γbn = (γ(xNi +1 , tn ), . . . , γ(xN , tn ))T
and the function γ is such that
0 x=0
γ(x, t) =
Pd
1
k=1 xk − K̄e−2r̄t kxk1 = C
d
Now, combining (7.14), (7.15) and the boundary conditions unb we get the advancing
time step scheme
The aim is to reduce the error in the RoI. Therefore, chosen the model parameters (that
is φ, r̄, σ̄, the final time step M so that we get the exercise time T ) and the far-field
89
S. De Marchi, E. Perracchione Lectures on radial basis functions
surface C, then the accuracy of the method would depend on node distribution and the
shape parameter.
In the paper [63] the considered for the examples that we are going to show the following
data
√
• φ(r) = 1 + r2 , multiquadrics
d
1X
• far-field boundary surface xi = 4K̄
d
i=1
About the node distribution, we can use an adaptive deterministic strategy based on
the fact that we want to reduce the finantial error in the RoI. The recipe is simple. Let us
consider the 1d case first. For some p ∈ N, we can distribute for example N = 3p + 2 points
as follows: p + 1 equally spaced points in the intervals [0, K̄ − δ] and [K̄ + δ, 2 ∗ K̄], while
the remaining p, also equally spaced, in (K̄ − δ, K̄ + δ), with δ = 1/(N − 1) (the spacing).
Similarly for the 2d case. An example for p = 5 is displayed in Fig. 7.3. As shown in [63]
this strategy reduces significantly the finantial error Ef . The price to pay is of a bigger
condition number of A, but we know that this is the a consequence of the trade-off principle.
90
S. De Marchi, E. Perracchione Lectures on radial basis functions
Another way to reduce the error is by chosing the optimal shape parameter, say ∗ , by
one of the strategies discussed in Section 4.6.
• RBF provide spectral accuracy when the φ has infinite smoothness. In order to see
this accuracy in space one has to fix and varying N = 20...200 compute the error
(this is the non-stationary approach). One can observe that indeed one get
• For accuracy in time, we fix N and , but we vary the time-steps, say from M =
2, . . . , 103 . Since we have used a BDF2 discretization method, we can expect to have
and order 2 of convergence as required. We can also observe that using the weighted
norm it is possible to reduce further the error.
This method, proposed in [63], compared with the adaptive FD, has shown to be 20
uo to 40 times faster in the low to intermediate accuracy range. The memory requirements
still the same. The only limitation was that it was applied on maximum dimension 2.
A new RBF-PUM for pricing 1d and 2d vanilla basket options has been proposed in [68].
We recall that a vanilla call/put option is a basket option made of a linear combination
of assets. Precisely, let Si (t), i = 1, ..., N the prices of N stocks at the time t. Consider
N
X
U (t) = ai Si (t), i = 1, ..., N .
i=1
where the ai are constants. A vanilla is an option on U (t). In more detail, on an exercise
date t, the payoff of the option is
with K the exercise price and α = 1 for a call option or α = −1 in the case of put.
The method proposed is a penalty method for American basket call options. American
call options differ from European call ones because they consider the dividend. In the case
of put options the dividend may be zero.
91
S. De Marchi, E. Perracchione Lectures on radial basis functions
where e is the penalty parameter (chosen quite small), Di is the dividend of the i-th assets,
r the risk-free interest rate and
N
X
q(x) = αi xi − K
i=1
is the barrier function corresponding to the nonzero part of the payoff function Φ. The
penalized BS equation, with initial and boundaty conditions is then
∂V
= LV − P (V ), x ∈ ΩE = Rd+ , 0 < t ≤ T
∂t
V (x, 0) = Φ(x), x ∈ ΩE
V (0, t) = 0, t ∈ (0, T ]
V (x, t) = Φ(x), x ∈ ΓE , t ∈ (0, T ] .
This equation can be solved by RBF-PUM in space and BDF2 in time. Some attention
should be done to the choice of the penalty parameter, the shape parameter and the number
of partions. For details and numerical results see again [68].
92
Lecture 8
Software for PU
In what follows we list the codes for both PU interpolation and collocation.
We give a brief description of the implemented Matlab functions. For more details
concerning input and output parameters and the usage of single functions, see the the
comments within the Matlab routines.
Remarks :
a . the function DistanceMatrix . m is from the book
Meshfree Approximations Methods with Matlab ,
Fasshauer , World Scientific , 2007.
b . routines 4 - -7 are from
93
S. De Marchi, E. Perracchione Lectures on radial basis functions
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
%
% File : PU (M , dsites , neval , npu , rbf , wf ,f , rhs , ep );
%
% Goal : script that performs partition of unity with variable
% patches and shape parameters
%
% Inputs : M : space dimension
% dsites : NXM matrix representing a set of N data
% sites
% neval : evaluation points in one direction
% npu : PU subdomains in one direction
% rbf : radial basis function
% wf : weight function
% f: the test function
% rhs : the function values
% ep : the shape parameter
%
% Outputs : epoints : the evaluation points
% Pf : the interpolant at the evaluation points
%
% Calls on : IntegerBased_MD_Structure ,
% IntegerBased_MD_Neighbourhood
% IntegerBased_MD_RangeSearch ,
% IntegerBased_MD_ContainingQuery ,
% DistanceMatrix , MakeSDGrid .
%
% Remark : DistanceMatrix , MakeSDGrid come from the book :
% [ G . E . Fasshauer , Meshfree approximation methods with
% Matlab , World Scientific , Singapore , 2007].
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
function [ epoints , Pf ] = PU (M , dsites , neval , npu , rbf , wf ,f , rhs , ep )
% Create npu ^ M equally spaced PU centres
puctrs = MakeSDGrid (M , npu );
% Create neval ^ M equally spaced evaluation points
epoints = MakeSDGrid (M , neval );
puradius = 1./ npu ; % Define the initial PU radius
wep = 1./ puradius ; % Parameter for weight function
npu_M = size ( puctrs ,1); neval_M = size ( epoints ,1); % Initialize ;
rbfctrs = dsites ; % Define the RBF centres
Pf = zeros ( neval_M ,1); % Initialize
% Compute Shepard evaluation matrix
DM_eval = DistanceMatrix ( epoints , puctrs );
SEM = wf ( wep , DM_eval );
SEM = spdiags (1./( SEM * ones ( npu_M ,1)) ,0 , neval_M , neval_M )* SEM ;
94
S. De Marchi, E. Perracchione Lectures on radial basis functions
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
%
% File : DistanceMatrix ( dsites , ctrs )
%
% Goal : Forms the distance matrix of two sets of points in R ^M ,
%
% Inputs : dsites : NxM matrix representing a set of N data in R ^ M
% ( i . e . , each row contains a M - dimensional point )
% ctrs : sxM matrix representing a set of s centers in
% R ^ M ( one center per row )
%
% Outputs : DM : Mxs matrix whose i , j position contains the
95
S. De Marchi, E. Perracchione Lectures on radial basis functions
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
%
% File : MakeSDGrid (s , neval )
%
% Goal : Produces matrix of equally spaced points
%
% Inputs : s : space dimension
% neval : number of points in each coordinate direction
%
% Outputs : gridpoints : neval ^s - by - s matrix
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
function gridpoints = MakeSDGrid (s , neval )
if ( s ==1)
gridpoints = linspace (0 ,1 , neval ) ’;
return ;
end
% Mimic this statement for general s :
% [ x1 , x2 ] = ndgrid ( linspace (0 ,1 , neval ));
outputarg = ’ x1 ’;
for d = 2: s
outputarg = strcat ( outputarg , ’ ,x ’ , int2str ( d ));
end
makegrid = strcat ( ’[ ’ , outputarg , ’ ]= ndgrid ( linspace (0 ,1 , neval )); ’ );
eval ( makegrid );
% Mimic this statement for general s :
% gridpoints = [ x1 (:) x2 (:)];
gridpoints = zeros ( neval ^s , s );
for d = 1: s
matrices = strcat ( ’ gridpoints (: , d ) = x ’ , int2str ( d ) , ’ (:); ’ );
eval ( matrices );
end
96
S. De Marchi, E. Perracchione Lectures on radial basis functions
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
%
% File : I n t e g e r B a s e d _ M D _ C o n t a i n i n g Q u e r y ( puctr ,q , puradius , M )
%
% Goal : script that given a subdomain centre returns the index of
% the square block containing the subdomain centre
%
% Inputs : puctr : subdomain centre
% q: number of blocks in one direction
% puradius : radius of the PU subdomains
% M: space dimension
%
% Outputs : index : the index of the block containing the subdomain
% centre
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
function [ index ] = I n t e g e r B a s e d _ M D _ C o n t a i n i n g Q u e r y ( puctr ,q ,...
puradius , M )
idx = ceil ( puctr ./ puradius ); k = 1: M -1;
idx ( idx == 0) = 1;
index = sum (( idx ( k ) -1).* q .^( M - k )) + idx ( end );
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
%
% File : I n t e g e r B a s e d _ M D _ N e i g h b o u r h o o d ( dsites , idx_ds , index1 ,q ,M , t )
%
% Goal : script that founds the neighbouring blocks
%
% Inputs : dsites : NXM matrix representing a set of N data sites
% idx_ds : the integer - based data structure
% index1 : indices of points lying in the k - th block
% q: number of blocks in one direction
% M: space dimension
% t: it is related to the number of neighbouring
% blocks , the procedure searches in the k - th block
% and in its (3 + 2^ t )^ M - 1 neighboring blocks
%
% Outputs : dxx : points lying in the k - th neighbourhood
% dx : indices of points lying in the k - th neighbourhood
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
function [ dxx , dx ] = I n t e g e r B a s e d _ M D _ N e i g h b o u r h o o d ( dsites ,...
idx_ds , index1 ,q ,M , t )
neigh = []; k = M -1; index = index1 ; k1 = 1: t ; % Initialize
% Find neighbouring blocks
while k > 0
neigh = [ index1 + k1 .* q .^ k , index1 - k1 .* q .^ k ];
if k - 1 > 0
neigh = [ neigh , neigh + q .^( k -1) , neigh - q .^( k -1)];
end
k = k - 1;
97
S. De Marchi, E. Perracchione Lectures on radial basis functions
end
k2 = 1: t ; k3 = k2 ;
for i = 1: length ( neigh )
neighplus ( k2 ) = neigh ( i ) + k3 ;
neighminus ( k2 ) = neigh ( i ) - k3 ;
k2 = k2 + t ;
end
neigh = [ neigh , index1 + k1 , index1 - k1 , neighplus , neighminus ];
% Reduce the number of neighbouring blocks for border blocks
j = find ( neigh > 0 & neigh <= q ^ M );
index = [ index ; neigh ( j ) ’];
dxx = []; dx = [];
for p = 1: length ( index )
dxx = [ dxx ; dsites ( idx_ds { index ( p )} ,:)];
dx = [ dx ; idx_ds { index ( p )}];
end
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
%
% File : I n t e g e r B a s e d _ M D _ S t r u c t u r e ( dsites ,q , puradius , M )
%
% Goal : find the data sites located in each of the q ^ M blocks
%
% Inputs : dsites : NXM matrix representing a set of N data sites
% q: number of blocks in one direction
% puradius : radius of PU subdomains
% M: space dimension
%
% Outputs : idx_dsites_k : multiarray containing the indices of the
% points located in k - th block
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
function [ idx_dsites_k ] = I n t e g e r B a s e d _ M D _ S t r u c t u r e ( dsites ,q ,...
puradius , M )
N = size ( dsites ,1); idx_dsites_k = cell ( q ^M ,1); k = 1: M -1;
for i = 1: N
idx = ceil ( dsites (i ,:)./ puradius );
idx ( idx == 0) = 1;
index = sum (( idx ( k ) -1).* q .^( M - k )) + idx ( end );
idx_dsites_k { index } = [ idx_dsites_k { index }; i ];
end
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
%
% File : I n t e g e r B a s e d _ M D _ R a n g e S e a r c h ( puctr , puradius , dsites , index )
%
% Goal : find the data sites located in a given subdomain and the
% distances between the subdomain centre and data sites
%
% Inputs : puctr : subdomain centre
% puradius : radius of PU subdomains
98
S. De Marchi, E. Perracchione Lectures on radial basis functions
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
%
% File : LaplaceMain (N ,x , neval , ep , fun , Lfun , phi )
%
% Goal : script that solves the Poisson equation by means of HVSKs
%
% Inputs : N : number of central points
% x: the central points
% neval : number of evaluation points in one direction
% ep : shape parameter
% fun : the test function
% Lfun : Laplacian of the test function
% phi : the kernel function
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
function [ RMSE ] = LaplaceMain (N ,x , neval , ep , fun , Lfun , phi )
99
S. De Marchi, E. Perracchione Lectures on radial basis functions
100
S. De Marchi, E. Perracchione Lectures on radial basis functions
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
%
% File : W2weight ( xc , locpts , Cp , cellradius )
%
% Goal : solves the Poisson equation by means of stable methods
%
% Inputs : xc : the collocation points
% locpts : the collocation points on the subdomains
% Cp : centre of PU subdomains
% cellradius : the radius of patches
%
% Outputs : pu : the PU weights
%
% Calls on : PU_weight
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
function [ pu ] = W2weight ( xc , locpts , Cp , cellradius )
Np = size ( Cp ,1); % Initialize
% Construct the weight functions
[ phi , phix , phiy , phixx , phiyy ] = PU_weight ( xc , locpts , Cp , cellradius );
% Compute the sums of the generating functions and their derivatives
s = sum ( phi ,2); sx = sum ( phix ,2); sy = sum ( phiy ,2); ...
101
S. De Marchi, E. Perracchione Lectures on radial basis functions
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
%
% File : PU_weight ( xc , locpts , Cp , cellradius )
%
% Goal : evaluates Wendland ’ s function and its derivatives
%
% Inputs : xc : the collocation points
% locpts : the collocation points on the subdomains
% Cp : centre of PU subdomains
% cellradius : the radius of patches
%
% Outputs : phi , phix , phiy , phixx , phiyy : evaluation of the PU weights
% and the derivatives
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
function [ phi , phix , phiy , phixx , phiyy ] = PU_weight ( xc , locpts , Cp ,...
cellradius )
Np = size ( Cp ,1);
for i = 1: length ( Np )
N ( i ) = length ( locpts ( i ). ind );
end
zs = spalloc ( size ( xc ,1) , Np , sum ( N ));
[ phi , phix , phiy , phixx , phiyy ] = deal ( zs );
for i = 1: Np
rho = 1/ cellradius ;
dx = xc ( locpts ( i ). ind ,1) - Cp (i ,1);
dy = xc ( locpts ( i ). ind ,2) - Cp (i ,2);
r = sqrt ( dx .^2 + dy .^2);
102
S. De Marchi, E. Perracchione Lectures on radial basis functions
r1 = r .* rho ;
phi ( locpts ( i ). ind , i ) = (4* rho * r +1).*((1 - rho * r )).^4;
phix ( locpts ( i ). ind , i ) = -20* rho ^2* dx .*((1 - rho * r )).^3;
phiy ( locpts ( i ). ind , i ) = -20* rho ^2* dy .*((1 - rho * r )).^3;
if r == 0
phixx =20/ cellradius .^2; phiyy =20/ cellradius .^2;
else
phixx ( locpts ( i ). ind , i )=20*((1 - r1 )).^2.*( - r1 +4*...
( dx .^2./ cellradius .^2)+( dy .^2./ cellradius .^2))./...
cellradius .^2./ r1 ;
phiyy ( locpts ( i ). ind , i )=20*((1 - r1 )).^2.*( - r1 +( dx .^2....
/ cellradius .^2)+4*( dy .^2./ cellradius .^2))./...
cellradius .^2./ r1 ;
end
end
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
%
% File : R B F _ P U M _ d i f f m a t _ g a u s s ( data , ep )
%
% Goal : script that computes the differentiation matrices
%
% Inputs : data : the collocation points
% ep : the shape parameter
%
% Calls on : gauss_PUM
%
% Outputs : A , Ax , Axx , Ay , Ayy : the differentian matrices
%
% Calls on : gauss_PUM
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
function [A , Ax , Axx , Ay , Ayy ] = R B F _ P U M _ d i f f m a t _ g a u s s ( data , ep )
N = size ( data ,1); [A , Ax , Ay , Axx , Ayy ] = deal ( zeros (N , N ));
% Generate differentiation matrices
for i = 1: N
[ psi , psix , psiy , psixx , psiyy ] = gauss_PUM ( ep , data , data (i ,:));
% Compute the differentiation matrices
A (i ,:) = psi ; Ax (i ,:) = psix ; Ay (i ,:) = psiy ; Axx (i ,:) = psixx ;
Ayy (i ,:) = psiyy ;
end
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
%
% File : gauss_PUM ( ep , xc , xe )
%
% Goal : script that evaluates the differentiation matrices
%
% Inputs : ep : the shape parameter
% xc : the data sites
% xe : the evaluation points
103
S. De Marchi, E. Perracchione Lectures on radial basis functions
%
% Outputs : w , wx , wy , wxx , wyy : evaluation of the gaussian function and
% its the derivatives
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
function [w , wx , wy , wxx , wyy ] = gauss_PUM ( ep , xc , xe )
dx = xe (1 ,1) - xc (: ,1); dy = xe (1 ,2) - xc (: ,2); % Initialize
r2 = dx .^2 + dy .^2; % Initialize
% Evaluate the RBF and its derivatives
we = exp ( - ep ^2* r2 ); w = we ’;
wex = ( -2* ep ^2* dx ).* we ; wx = wex ’;
wey = ( -2* ep ^2* dy ).* we ; wy = wey ’;
wexx =( -2* ep ^2).* we +(4* dx .^2* ep ^4).* we ; wxx = wexx ’;
weyy =( -2* ep ^2).* we +(4* dy .^2* ep ^4).* we ; wyy = weyy ’;
8.3 Exercises
i. Run the following code
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
close all
clear all
warning off
disp ( ’ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ’)
M = 2; % space dimension
N = 17.^ M ; % number of scattered data
dsites1 = haltonset ( M ); % the type of data
dsites = dsites1 (1: N ,:);
neval = 40; % for evaluation points
npu = floor ((( N )./(4))^(1/ M )); % parameter for PU centres
rbf = @ ( ep , r ) exp ( -( ep * r ).^2); % local kernel type
wf = @ ( ep , r ) ( max (1 -( ep * r ) ,0).^4).* ...
(4*( ep * r )+1); % define weight function
f = @ ( x ) ( x (: ,1)+ x (: ,2) -1).^9; % the test function
rhs = f ( dsites ); % the function values
ep = 1; % the shape parameter
PU (M , dsites , neval , npu , rbf , wf ,f , rhs , ep );
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -%
close all
clear all
warning off
disp ( ’ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ’)
N = 81; % Number of central nodes
% Define the central nodes
load ( ’ data_demo ’ );
104
S. De Marchi, E. Perracchione Lectures on radial basis functions
105
S. De Marchi, E. Perracchione Lectures on radial basis functions
106
Bibliography
[2] S. Arya, D.M. Mount, N.S. Netanyahu, R. Silverman, A.Y. Wu, An optimal
algorithm for approximate nearest neighbor searching in fixed dimensions, J. ACM 45
(1998), pp. 891–923.
[4] D. Belton, Improving and extending the information on principal component analysis
for local neighborhoods in 3D point clouds, in: C. Jun et al. (Eds.), The International
Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences-
Part B5, vol. 37, 2008, pp. 477–484.
[7] I. Babuška, J.M. Melenk, The partition of unity method, Int. J. Numer. Meth. Eng.
40 (1997), pp. 727–758.
[8] M.D. Buhmann, Radial Basis Functions: Theory and Implementation, Cambridge
Monogr. Appl. Comput. Math., vol. 12, Cambridge Univ. Press, Cambridge, 2003.
[9] J.C. Carr, R.K. Beatson, J.B. Cherrie, T.J. Mitchell, W.R. Fright, B.C.
Mccallum, T.R. Evans, Reconstruction and representation of 3D objects with radial
basis functions, in: Proceedings of the 28-th Annual Conference on Computer Graphics
and Interactive Techniques, ACM press, New York, 2001, pp. 67–76.
[10] J.C. Carr, W.R. Fright, R.K. Beatson, Surface interpolation with radial basis
functions for medical imaging, IEEE Trans. Med. Imaging 16 (1997), pp. 96–107.
107
S. De Marchi, E. Perracchione Lectures on radial basis functions
[26] Stefano De Marchi, Maddalena Mandarà and Anna Viero, Meshfree approx-
imation of multi-asset European and American option problems, Aracne ed. Roma, pp.
76, ISBN: 9788854851511 (2012).
[27] J. Duchon, Sur l’erreur d’interpolation des fonctions de plusieurs variables par les
Dm -splines, Rev. Francaise Automat. Informat. Rech. Opér. Anal. Numer. 12 (1978),
pp. 325–334.
[29] J. Duchon, Interpolation des fonctions de deux variables suivant le principe de la flex-
ion des plaques minces, Rev. Francaise Automat. Informat. Rech. Opér. Anal. Numer.
10 (1976), pp. 5–12.
[30] N. Dyn, D. Levin, Iterative solution of systems originating from integral equations
and surface interpolation, SIAM J. Numer. Anal. 2 (1981), pp. 377–390.
[31] G.E. Fasshauer, A.Q.M Khaliq and D.A. Voss, Using Meshfree Approximations
for multi-asset American Option Problems , J. Chin. Inst. Eng. 27 (2004), pp. 563–571.
[32] G.E. Fasshauer, Meshfree Approximations Methods with Matlab, World Scientific,
Singapore, 2007.
[34] R. Franke, Scattered data interpolation: Tests of some methods, Math. Comp. 38
(1982), pp. 181–200.
[35] R. Franke, A critical comparison of some methods for interpolation of scattered data,
Report No. NPS-53-79-003, Naval Postgraduate School, Monterey, 1982.
[36] W.R. Goodin, G.J. McRae, J.H. Seinfeld, A comparison of interpolation methods
for sparse data: Application to wind and concentration fields, J. Appl. Meteor. 18
(1979), pp. 761–771.
[38] J.P. Gram, Über Entwicklung reeler Functionen in Reihen mittelst der Methode der
kleinsten Quadrate, J. Math. 94 (1883), pp. 41–73.
[39] R.L. Harder, R.N. Desmarais, Interpolation using surface splines, J. Aircraft 9
(1972), pp. 189–191.
[40] R.L. Hardy, Multiquadric equations of topography and other irregular surfaces, J.
Geophys. Res. 76 (1971), pp. 1905–1915.
109
S. De Marchi, E. Perracchione Lectures on radial basis functions
[42] Y.C. Hon, R. Schaback, On unsymmetric collocation by radial basis functions, Appl.
Math. Comput. 119 (2001), pp. 177–186.
[43] H. Hoppe, Surface Reconstruction from Unorganized Points, Ph.D. Thesis, University
of Washington, Washington, 1994.
[46] A. Iske, Multiresolution Methods in Scattered Data Modelling, Lecture Notes in Com-
putational Science and Engineering Vol. 37, Springer (2004).
[47] I.T. Jolliffe, Principal Component Analysis, Springer-Verlag, New York, 1986.
[51] D.H. McLain, Two dimensional interpolation from random data, Comput. J. 19
(1976), pp. 178–181.
[52] J. Meinguet, Surface spline interpolation: Basic theory and computational aspects,
in: S.P. Singh et al. (Eds.), Approximation Theory and Spline Functions, Reidel, Dor-
drecht, 1984, pp. 127–142.
[55] J. Meinguet, Basic mathematical aspects of surface spline interpolation, in: G. Ham-
merlin (Ed.), Numerische Integration, Birkhauser, Basel, 1979, pp. 211–220.
[56] J.M. Melenk, I. Babuška, The partition of unity finite element method: Basic theory
and applications, Comput. Meth. Appl. Mech. Eng. 139 (1996), pp. 289–314.
110
S. De Marchi, E. Perracchione Lectures on radial basis functions
[57] J. Mercer, Functions of positive and negative type and their connection with the
theory of integral equations, Phil. Trans. Royal Society 209 (1909), pp. 415–446.
[58] C.D. Meyer, Matrix Analysis and Applied Linear Algebra, SIAM (Philadelphia), 2000.
[59] C.A. Micchelli, Interpolation of scattered data: Distance matrices and conditionally
positive definite functions, Constr. Approx. 2 (1986), pp. 11–22.
[60] B. Morse, T.S. Yoo, P. Rheingans, D.T. Chen, K.R. Subramanian, Interpolat-
ing implicit surfaces from scattered surface data using compactly supported radial basis
functions, in: IEEE International Conference on Shape Modeling and Applications
2001, IEEE Press, Los Alamitos, 2001, pp. 89–98.
[61] Y. Ohtake, A. Belyaev, H.P. Seidel, Sparse surface reconstruction with adaptive
partition of unity and radial basis functions, Graph. Models 68 (2006), pp. 15–24.
[62] Jonas Persson and Lina von Sydow , Pricing European Multi-asset Options Using
a Space-time Adaptive FD-method, Technical report 2003-059 (2003), Department of
Information Technology Uppsala University.
[66] I.J. Schoenberg, Metric spaces and completely monotone functions, Ann. Math. 39
(1938), pp. 811–841.
[67] L.L. Schumaker, Spline Functions - Basic Theory, Wiley-Interscience, New York
1981.
[68] V. Shcherbakov, E. Larsson, Radial basis function partition of unity methods for
pricing vanilla basket options, Comput. Math. Appl. 71 (2016), pp. 185–200.
[69] D. Shepard, A two-dimensional interpolation function for irregularly spaced data, in:
Proceedings of 23-rd National Conference, Brandon/Systems Press, Princeton, 1968,
pp. 517–524.
[71] J. Stewart, Positive definite function and generalizations, an historical survey, Rocky
Mountain J. Math. 6 (1976), pp. 409–434.
111
S. De Marchi, E. Perracchione Lectures on radial basis functions
[72] D.Tavella, C.Randall, Pricing finantial instuments: the Finite Difference Method,
John Wiey & Son, Ed. New York (2000)
[73] G. Turk, J.F. O’Brien, Modelling with implicit surfaces that interpolate, ACM
Trans. Graph. 21 (2002), pp. 855–873.
[75] H. Wendland, Fast evaluation of radial basis functions: Methods based on partition
of unity, in: C.K. Chui et al. (Eds.), Approximation Theory X: Wavelets, Splines, and
Applications, Vanderbilt Univ. Press, Nashville, 2002, pp. 473–483.
[76] W.S.B. Woolhouse, Explanation of a new method of adjusting mortality tables, with
some observations upon Mr. Makeham’s modification of Gompertz’s theory, J. Inst.
Act. 15 (1870), pp. 389–410.
[77] G. Yao, J. Duo, C.S. Chen, L.H. Shen, Implicit local radial basis function inter-
polations based on function values, Appl. Math. Comput. 265 (2015), pp. 91–102.
[78] Z. Wu, R. Schaback, Local error estimates for radial basis function interpolation of
scattered data, IMA J. Numer. Anal. 13 (1993), pp. 13–27.
[79] S. Zhu, A.J. Wathen, Convexity and solvability for compactly supported radial basis
functions with different shapes, J. Sci. Comput. 63 (2015), pp. 862–884.
112