
A spline function f is a piecewise polynomial function defined on an interval [x_{min}, x_{max}] with specified continuity constraints, i.e., when the interval [x_{min}, x_{max}] is subdivided by points ξ_{i} such that x_{min} = ξ_{1} < ... < ξ_{q} = x_{max}, then within each subinterval [ξ_{j}, ξ_{j+1}) the function is a polynomial P_{j} of specified degree k.
A knot sequence t = {t_{1}, ..., t_{n+k}}, where n is the number of free parameters that specify the spline function, is derived from the ξ_{i} by placing knots at the boundary values ξ_{i} according to the order of continuity at that boundary. The most common continuity characteristics imposed on f request that for adjacent polynomials the derivatives up to order k−2 match. For example, the knot sequence of a spline of order k for a partition of [x_{min}, x_{max}] into three intervals (q = 4) will be t_{1} = ... = t_{k} = x_{min} (= ξ_{1}), t_{k+1} = ξ_{2}, t_{k+2} = ξ_{3} , t_{k+3} = ... = t_{k+k+2} = x_{max} (= ξ_{4}). This is called a simple knot sequence, because all interior knots are simple. The number of free parameters n for this case obeys a simple formula:
n = numberOfInteriorKnots + order. 
With suitable basis functions, for example, the Mspline family M_{i}(xk, t), i=1..n, we can write any spline f in the form:
f = ∑_{i=1..n} a_{i}M_{i}, 
where the M_{i} are defined by the following recursive formulas:
M_{i}(x1,t) = 1 / (t_{i+1} − t_{i}), t_{i} ≤ x < t_{i+1}, 0 otherwise 
M_{i}(xk,t) = k [(x−t_{i})M_{i}(xk−1,t) + (t_{i+k}−x)M_{i+1}(xk−1,t)] / ((k−1)(t_{i+k}−t_{i})) 
These M_{i} are localized because M_{i}(xk,t) > 0 only when t_{i} ≤ x < t_{i+k} and zero otherwise. Also, we have ∫ M_{i}(x)dx = 1. Because of this localization a change in coefficient a_{i} will only effect f within this interval.
The following picture shows an Mspline of order 3 on the interval [0, 1], with three interior knots at 0.3, 0.5 and 0.6.
Because the Msplines are nonnegative, monotone splines can be derived from them by integration:
I_{i}(xk,t) = ∫_{xmin}^{x} M_{i}(uk,t) du 
Because each M_{i}(xk, t) is a piecewise polynomial of degree k−1, each I_{i} will be of degree k. Now we can write:
f = ∑_{i=1..n} b_{i} I_{i}(xk,t) 
We can use an Mspline of order k+1 with a simple knot sequence t, for which t_{j} ≤ x < t_{j+1}, to put the Ispline of order k into a more convenient form:
I_{i}(xk,t) = 0, i > j 
I_{i}(xk,t) = ∑_{m=i+1..j} (t_{m+k+1}−t_{m})M_{m}(xk+1,t)/(k+1), j−k ≤ i ≤ j 
I_{i}(xk,t) = 1, i < j−k 
The following figure shows the Isplines that were derived from the Msplines above.
These spline formulas were taken from Ramsay (1988) and the errors in his Ispline formulas were corrected.
© djmw 20121101