This glossary provides brief definitions of the basic mathematical terms and notation used in this guide to splines. The terms are not in alphabetical order. Terms and definitions are presented in order such that the explanation of each term only uses terms discussed earlier. In this way, the first time, you can choose to read the entire glossary from start to finish, for a cohesive introduction to these terms.

- Intervals
Because MATLAB

^{®}uses the notation`[a,b]`

to indicate a matrix with the two columns,`a`

and`b`

, this guide uses the notation [`a`

..`b`

] to indicate the closed interval with endpoints`a`

and`b`

. This guide does the same for open and half-open intervals. For example, [`a`

..`b`

) denotes the interval that includes its left endpoint,`a`

, and excludes its right endpoint,`b`

.- Vectors
A

*d-vector*is a list of*d*real numbers, i.e., a point in ℜ^{d}. In MATLAB, a*d*-vector is stored as a matrix of size [1,*d*], i.e., as a row-vector, or as a matrix of size [*d*,1], i.e., as a column-vector. In the Curve Fitting Toolbox™ spline functions, vectors are column vectors.- Functions
In this toolbox, the term

*function*is used in its mathematical sense, and so describes any rule that associates, to each element of a certain set called its*domain*, some element in a certain set called its*target*. Common examples in this toolbox are polynomials and splines. But even a point*x*in ℜ^{d}, i.e., a*d*-vector, may be thought of as a function, namely the function, with domain the set {1,...,*d*} and target the real numbers ℜ, that, for*i*= 1,...,*d*, associates to*i*the real number*x*(*i*).The

*range*of a function is the set of its values.There are scalar-valued, vector-valued, matrix-valued, and

*ND*-valued splines. Scalar-valued functions have the real numbers ℜ (or, more generally, the complex numbers) as their target, while*d*-vector-valued functions have ℜ^{d}as their target; if, more generally,*d*is a vector of positive integers, then*d*-valued functions have the*d*-dimensional real arrays as their target. Curve Fitting Toolbox spline functions can deal with univariate and multivariate functions. The former have some real interval, or, perhaps, all of ℜ as their domain, while*m*-variate functions have some subset, or perhaps all, of ℜ^{m}as their domain.- Placeholder notation
If

*f*is a*bivariate*function, and*y*is some specific value of its second variable, then$$f\left(\cdot ,y\right)$$

is the

*univariate*function whose value at*x*is*f*(*x*,*y*).- Curves and surfaces vs. functions
In this toolbox, the term

*function*usually refers to a scalar-valued function. A vector-valued function is called here a:*curve*if its domain is some interval*surface*if its domain is some rectangleTo be sure, to a mathematician, a curve is

*not*a vector-valued function on some interval but, rather, the range of such a (continuous) function, with the function itself being just one of infinitely many possible parameterizations of that curve.- Tensor products
A bivariate

*tensor product*is any weighted sum of products of a function in the first variable with a function in the second variable, i.e., any function of the form$$f(x,y)={\displaystyle \sum _{i}{\displaystyle \sum _{j}a(i,j){g}_{i}(x){h}_{j}(y).}}$$

More generally, an

*m*-variate tensor product is any weighted sum of products*g*_{1}(*x*_{1})*g*_{2}(*x*_{2})...*g*_{m}(*x*_{m}) of*m*univariate functions.- Polynomials
A univariate scalar-valued polynomial is specified by the list of its polynomial coefficients. The length of that list is the order of that polynomial, and, in this toolbox, the list is always stored as a row vector. Hence an

*m*-list of polynomials of order*k*is always stored as a matrix of size`[`

*m*,*k*`]`

.The coefficients in a list of polynomial coefficients are listed from "highest" to "lowest", to conform to the MATLAB convention, as in the command

`polyval(a,x)`

. To recall: assuming that`x`

is a scalar and that`a`

has`k`

entries, this command returns the number$$a(1){x}^{k-1}+a(2){x}^{k-2}+\cdots +a(k-1)x+a(k).$$

In other words, the command treats the list

`a`

as the coefficients in a*power form*. For reasons of numerical stability, such a coefficient list is treated in this toolbox, more generally, as the coefficients in a*shifted*, or,*local*power form, for some given*center*`c`

. This means that the value of the polynomial at some point`x`

is supplied by the command`polyval(a,x-c)`

.A vector-valued polynomial is treated in exactly the same way, except that now each polynomial coefficient is a vector, say a

*d*-vector. Correspondingly, the coefficient list now becomes a matrix of size`[d,k]`

.Multivariate polynomials appear in this toolbox mainly as

*tensor products*. Assuming first, for simplicity, that the polynomial in question is scalar-valued but*m*-variate, this means that its coefficient “list”*a*is an*m*-dimensional array, of size [*k*_{1},...,*k*] say, and its value at some_{m}*m*-vector*x*is, correspondingly, given by$$\sum _{{i}_{1}=1}^{{k}_{1}}\cdots}{\displaystyle \sum _{{i}_{m}=1}^{{k}_{m}}a({i}_{1},\mathrm{...},{i}_{m}){\left(x\left({i}_{1}\right)-c\left({i}_{1}\right)\right)}^{{k}_{1}-{i}_{1}}\cdots {\left(x\left({i}_{m}\right)-c\left({i}_{m}\right)\right)}^{{k}_{m}-{i}_{m}},$$

for some "center"

*c*.- Piecewise-polynomials
A

*piecewise-polynomial*function refers to a function put together from polynomial pieces. If the function is univariate, then, for some strictly increasing sequence*ξ*_{1}< ... <*ξ*_{l + 1}, and for*i*= 1:*l*, it agrees with some polynomial*p*on the interval [_{i}*ξ*.._{i}*ξ*_{i + 1}). Outside the interval [*ξ*_{1}..*ξ*_{l + 1}), its value is given by its first, respectively its last, polynomial piece. The*ξ*are its_{i}*breaks*. All the multivariate piecewise-polynomials in this toolbox are tensor products of univariate ones.- B-splines
In this toolbox, the term

*B-spline*is used in its original meaning only, as given to it by its creator, I. J. Schoenberg, and further amplified in his basic 1966 article with Curry, and used in*PGS*and many other books on splines. According to Schoenberg, the B-spline with knots*t*, ...,_{j}*t*_{j+k}is given by the following somewhat obscure formula (see, e.g., IX(1) in*PGS*):$${B}_{j,k}(x)=B\left(x|{t}_{j},\mathrm{...},{t}_{j+k}\right)=\left({t}_{j+k}-{t}_{j}\right)\left[{t}_{j},\mathrm{...},{t}_{j+k}\right]{(x-\cdot )}_{+}^{k-1}.$$

To be sure, this is only one of several reasonable normalizations of the B-spline, but it is the one used in this toolbox. It is chosen so that

$$\sum _{j=1}^{n}{B}_{j,k}(x)}=1,\text{\hspace{1em}}{t}_{k}\le x\le {t}_{n+1}.$$

But, instead of trying to understand the above formula for the B-spline, look at the reference pages for the GUI

`bspligui`

for some of the basic properties of the B-spline, and use that GUI to gain some firsthand experience with this intriguing function. Its most important property for the purposes of this toolbox is also the reason Schoenberg used the letter B in its name:*Every space of (univariate) piecewise-polynomials of a given order has a**Basis consisting of*B*-splines (hence the “B” in B-spline).*- Splines
Consider the set

$$S:={\Pi}_{\xi ,k}^{\mu}$$

of all (scalar-valued) piecewise-polynomials of order

*k*with breaks*ξ*_{1}< ... <*ξ*_{l + 1}that, for*i*= 2...*l*, may have a jump across*ξ*in its_{i}*μ*th derivative but have no jump there in any lower order derivative. This set is a linear space, in the sense that any scalar multiple of a function in_{i}*S*is again in*S*, as is the sum of any two functions in*S*.Accordingly,

*S*contains a basis (in fact, infinitely many bases), that is, a sequence*f*_{1},...,*f*so that every_{n}*f*in*S*can be written*uniquely*in the form$$f(x)={\displaystyle \sum _{j=1}^{n}{f}_{j}(x){a}_{j}},$$

for suitable coefficients

*a*. The number_{j}*n*appearing here is the*dimension*of the linear space*S*. The coefficients*a*are often referred to as the_{j}*coordinates*of*f*with respect to this basis.In particular, according to the Curry-Schoenberg Theorem, our space

*S*has a basis consisting of B-splines, namely the sequence of all B-splines of the form $$B\left(\xb7|{t}_{j},\mathrm{...},{t}_{j+k}\right)$$,*j*= 1...*n*, with the knot sequence*t*obtained from the break sequence*ξ*and the sequence*µ*by the following conditions:Have both

*ξ*_{1}and*ξ*_{l + 1}occur in*t*exactly*k*timesFor each

*i*= 2:*l*, have*ξ*occur in_{i}*t*exactly*k*–*µ*times_{i}Make sure the sequence is nondecreasing and only contains elements from

*ξ*

Note the correspondence between the multiplicity of a knot and the smoothness of the spline across that knot. In particular, at a simple knot, that is a knot that appears exactly once in the knot sequence, only the (

*k*– 1)st derivative may be discontinuous.- Rational splines
A

*rational spline*is any function of the form*r*(*x*) =*s*(*x*)/*w*(*x*), with both*s*and*w*splines and, in particular,*w*a scalar-valued spline, while s often is vector-valued. In this toolbox, there is the additional requirement that both*s*and*w*be of the same form and even of the same order, and with the same knot or break sequence. This makes it possible to store the rational spline*r*as the ordinary spline*R*whose value at*x*is the vector [*s*(*x*);*w*(*x*)]. It is easy to obtain*r*from*R*. For example, if`v`

is the value of*R*at*x*, then`v(1:end-1)/v(end)`

is the value of*r*at*x*. As another example, consider getting derivatives of*r*from those of*R*. Because*s*=*wr*, Leibniz' rule tells us that$${D}^{m}s={\displaystyle \sum _{j=0}^{m}\left(\begin{array}{c}m\\ j\end{array}\right){D}^{j}w{D}^{m-j}r.}$$

Hence, if

`v(:,j)`

contains*D*^{j–1}*R*(*x*),*j*= 1...`m`

+ 1, then$$\left(\left(\left(v(1:\text{end}-1,m+1\right)-{\displaystyle \sum _{j=1}^{m}\left(\begin{array}{c}m\\ j\end{array}\right)v(\text{end},j+1)v(1:\text{end}-1,j+1)}\right)/v(\text{end},1)\right)$$

provides the value of

*D*(^{m}R*x*).- Thin-plate splines
A bivariate thin-plate spline is of the form

$$f(x)={\displaystyle \sum _{j=1}^{n-3}\phi \left({\left|x-{c}_{j}\right|}^{2}\right){a}_{j}}+x(1){a}_{n-2}+x(2){a}_{n-1}+{a}_{n},$$

with

*φ*(*t*) =*t*log*t*a univariate function, and ∥*y*∥ denoting the Euclidean length of the vector*y*. The sites*c*are called the_{j}*centers*, and the radially symmetric function*ψ*(*x*) :=*φ*(|*x*|^{2}) is called the*basis function*, of this particular stform.- Interpolation
*Interpolation*is the construction of a function*f*that matches given*data values*,*y*, at given_{i}*data sites*,*x*, in the sense that_{i}*f*(*x*) =_{i}*y*, all_{i}*i*.The interpolant,

*f*, is usually constructed as the unique function of the form$$f(x)={\displaystyle \sum _{j}{f}_{j}(x){a}_{j}}$$

that matches the given data, with the functions

*f*chosen “appropriately”. Many considerations might enter that choice. One of these considerations is sure to be that one can match in this way arbitrary data. For example, polynomial interpolation is popular because, for arbitrary_{j}*n**data points*(*x*,_{i}*y*) with distinct data sites, there is exactly one polynomial of order_{i}*n*– 1 that matches these data. Explicitly, choose the*f*in the above “model” to be_{j}$${f}_{j}(x)=\underset{i\ne j}{{\displaystyle \Pi}}\left(x-{x}_{i}\right),$$

which is an

*n*– 1 degree polynomial for each*j*.*f*(_{j}*x*) = 0 for every_{i}*i*≠*j*, but*f*(_{j}*x*) ≠ 0 as long as the_{j}*x*are all distinct. Set_{i}*a*=_{j}*y*/_{j}*f*(_{j}*x*) so that_{j}*f*(*x*) =_{j}*f*(_{j}*x*)_{j}*a*=_{j}*y*for all_{j}*j*.In spline interpolation, one chooses the

*f*to be the_{j}*n*consecutive B-splines*B*(_{j}*x*) =*B*(*x*|*t*,...,_{j}*t*_{j+k}),*j*= 1:*n*, of order*k*for some knot sequence*t*_{1}≤*t*_{2}≤ ... ≤*t*_{n + k}. For this choice, there is the following important theorem.- Schoenberg-Whitney Theorem
Let

*x*_{1}<*x*_{2}< ... <*x*. For arbitrary corresponding values_{n}*y*,_{i}*i*= 1...*n*, there exists exactly one spline*f*of order*k*with knot sequence*t*,_{j}*j*= 1...*n*+*k*, so that*f*(*x*) =_{i}*y*,_{i}*i*= 1...*n*if and only if the sites satisfy the Schoenberg-Whitney conditions of order*k*with respect to that knot sequence*t*, namely*t*≤_{i}*x*≤_{i}*t*_{i+k},*i*= 1...*n*,with equality allowed only if the knot in question has multiplicity

*k*, i.e., appears*k*times in*t*. In that case, the spline being constructed may have a jump discontinuity across that knot, and it is its limit from the right or left at that knot that matches the value given there.- Least-squares approximation
In least-squares approximation, the data may be matched only approximately. Specifically, the linear system

$$f\left({x}_{i}\right)={\displaystyle \sum _{j}{f}_{j}\left({x}_{i}\right){a}_{j}}={y}_{i},\text{}i=\mathrm{1...}n,$$

is solved in the least-squares sense. In this, some weighting is involved, i.e., the coefficients

*a*j are determined so as to minimize the error measure$$E(f)={\displaystyle \sum _{i}{w}_{i}{\left|{y}_{i}-f\left({x}_{i}\right)\right|}^{2}}$$

for certain nonnegative weights

*w*at the user's disposal, with the default being to have all these weights the same._{i}- Smoothing
In spline smoothing, one also tries to make such an error measure small, but tries, at the same time, to keep the following roughness measure small,

$$F\left({D}^{m}f\right)={\displaystyle \underset{{x}_{1}}{\overset{{x}_{n}}{\int}}\lambda (x){\left|{D}^{m}f(x)\right|}^{2}\text{\hspace{0.17em}}dx},$$

with

*λ*a nonnegative weight function that is usually just the constant function 1, and*D*the^{m}f*m*th derivative of*f*. The competing claims of small*E*(*f*) and small*F*(*D*) are mediated by a smoothing parameter, for example, by minimizing^{m}f$$\rho E(f)+F\left({D}^{m}f\right)\text{or}\text{p}E(f)+(1-\text{p})F\left({D}^{m}f\right),$$

for some choice of

*ρ*or of`p`

, and over all*f*for which this expression makes sense.Remarkably, if the roughness weight

*λ*is constant, then the unique minimizer*f*is a spline of order 2*m*, with knots only at the data sites, and all the interior knots simple, and with its derivatives of orders*m*,...,2*m*–2 equal to zero at the two extreme data sites, the so-called “natural” end conditions. The larger the smoothing parameter*ρ*≥ 0 or`p`

∊ [0..1] used, the more closely*f*matches the given data, and the larger is its*m*th derivative.For data values

*y*at sites_{i}*c*in the_{i}*plane*, one uses instead the error measure and roughness measure$$E(f)={\displaystyle \sum _{i}{\left|{y}_{i}-f\left({c}_{i}\right)\right|}^{2}},\text{}F\left({D}^{2}f\right)={\displaystyle \int \left({\left|{D}_{11}f\right|}^{2}+2{\left|{D}_{12}f\right|}^{2}+{\left|{D}_{22}f\right|}^{2}\right)},$$

and, correspondingly, the minimizer of the sum

*ρE*(*f*) +*F*(*D*^{2}*f*) is not a polynomial spline, but is a thin-plate spline.Note that the unique minimizer of

*ρE*(*f*) +*F*(*D*^{2}*f*) for given 0 <*ρ*< ∞ is also the unique minimizer of`p`

*E*(*f*) + (1 –`p`

)*F*(*D*^{2}*f*) for`p`

=*ρ*/(1 +*ρ*) ∊ (0 .. 1) and*vice versa*.- 2D, 3D, ND
Terms such as “a 2D problem” or “a 3D problem” are not used in this toolbox, because they are not well defined. For example a 2D problem could be any one of the following:

Points on some curve, where you must construct a spline curve, i.e., a vector-valued spline function of one variable.

Points on the graph of some function, where you must construct a scalar-valued spline function of one variable.

Data sites in the plane, where you must construct a bivariate scalar-valued spline function.

A “3D problem” is similarly ambiguous. It could involve a curve, a surface, a function of three variables, ... . Better to classify problems by the domain and target of the function(s) to be constructed.

Almost all the spline construction commands in this toolbox can deal with ND-valued data, meaning that the data values are ND-arrays. If

`d`

is the size of such an array, then the resulting spline is called`d`

-valued.