Lately I have been working on an implementation of monotone smoothing splines, based on . As the title suggests, this technique is based on a univariate cubic B-spline. The form of the spline function used in the paper is as follows:
The knot points
I’m interested in providing an interpolated splines using the Apache Commons Math API, in particular the PolynomialSplineFunction class. In principle the above is clearly such a polynomial, but there are a few hitches.
PolynomialSplineFunctionwants its knot intervals in closed standard polynomial form
ax3 + bx2 + cx + d
- It wants each such polynomial expressed in the translated space
(x-Kj), where Kjis the greatest knot point that is <= x.
- The actual domain of S(x) is
K0 ... Km-1. The first 3 “negative” knots are there to make the summation for S(x) cleaner.
PolynomialSplineFunctionneeds its functions to be defined purely on the actual domain.
Consider the arguments to
We can apply this same manipulation to show that the arguments to
By the definition of
This suggests a way to manipulate the equations into a standard form. In the transformed space t, the four nonzero terms are:
and by plugging in the appropriate
PolynomialSplineFunction is going to automatically identify the appropriate
I substitute the argument (αu) into the definitions of the four
Lastly, collecting like terms gives me the standard-form coefficients that I need for
Now I am equipped to return a
PolynomialSplineFunction to my users, which implements the cubic B-spline that I fit to their data. Happy computing!
 H. Fujioka and H. Kano: Monotone smoothing spline curves using normalized uniform cubic B-splines, Trans. Institute of Systems, Control and Information Engineers, Vol. 26, No. 11, pp. 389–397, 2013